Zabbix Documentation 1.8

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:template:massupdate

massUpdate()

Available since version: 1.8

Parameters

multidimensional array with Templates data

ParameterTypeOptionalDescriptionDetails
templatesarray Template objects to update
hoststring Yes Template name.
groupsarray Yes Update templates Host Group linkage. Missing objects will be linked, existed stay, others unlinked
hostsarray Yes Update templates Hosts linkage. Missing objects will be linked, existed stay, others unlinked
macrosarray Yes Update templates Macros. Missing objects will be added, existed updated, others removed
templates_linkarray Yes Update templates Template linkage. Missing objects will be linked, existed stay, others unlinked
templates_cleararray Yes Templates that should be unlinked and cleared.

Returns

ParameterDescription
resultOperation successful. Result will contain array of updated Template IDs.
errorIn case of any errors

Example

Update template with ID “100100000014792” so:

  1. Add to group, and remove from others
  2. Link host to this template and unlink others
  3. Unlink and clear linked template

{
"jsonrpc":"2.0",
"method":"template.massUpdate",
"params":{
	"templates": [{"templateid": "100100000014792"}],
	"groups": [{"groupid": "100100000000041"}],
	"hosts": [{"hostid": "100100000010092"}],
	"templates_clear": [{"templateid": 100100000010232}]
},
"auth":"f223adf833b2bf2ff38574a67bba6372",
"id":2
}
Templates updated successfully:

{
"jsonrpc":"2.0",
"result":{
	"templateids":["100100000014792"]
},
"id":2
}