Sidebar

api:maintenance:update

Table of Contents

update()

This method allows you to update a maintenance as defined by the maintenance data array.

Parameters

ParameterTypeOptionalDescriptionDetails
maintenance dataarray or object No Array of Maintenance objects or a single objectmaintenanceid must be specified
groupidsarray No Host group ids add/remove to/from maintenance
hostidsarray No Host ids add/remove to/from maintenance

Returns

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

Example

Update maintenance name, remove all hosts and update groups:

{
"jsonrpc":"2.0",
"method":"maintenance.update",
"params":[{
	"maintenanceid":"100100000000005",
	"name":"TEST",
	"groupids":["100100000010229"],
	"hostids":[]
}],
"auth":"038e1d7b1735c6a5436ee9eae095879e",
"id":3
}

Maintenance updated successfully:

{
"jsonrpc":"2.0",
"result":{
   "maintenanceids": ["100100000000005"]
},
"id":3
}

Maintenance already exists:

{
"jsonrpc":"2.0",
"error":{
      "code":-32602,
      "message":"Invalid params.",
      "data":"[ CMaintenance::update ] Maintenance [ ZABBIX Servers ] already exists"
},
"id":3
}