Available since version: 1.8
Multidimensional array with usermacros data
Parameter | Type | Optional | Description | Details |
---|---|---|---|---|
macros | array | Usermacro to remove. | ||
hostids | array | Yes | Hostids that should have usermacros removed. | |
templateids | array | Yes | Templateids that should have usermacros removed. |
NOTE: one of the hosts or templates is required.
Parameter | Description |
---|---|
result | Operation successful. Result will contain array of removed host/template usermacro IDs. |
error | In case of any errors |
Remove two host usermacros from two hosts with IDs "10092", "10086" and from two templates with IDs "10052", "10053"::
{
"jsonrpc":"2.0",
"method":"usermacro.massRemove",
"params":{
"macros": ["{$MACRO1}","{$MACRO2}"],
"hostids": ["10092", "10086"],
"templateids": ["10052", "10053"]
},
"auth":"f223adf833b2bf2ff38574a67bba6372",
"id":2
}
Host usermacros removed successfully:
NOTE: host and/or template usermacros will be listed together in the "hostmacroids" array.
Error when some host or template does not exist: