object maintenance.update(object/array maintenances)
This method allows to update existing maintenances.
This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.
(object/array)
Maintenance properties to be updated.
The maintenanceid
property must be defined for each maintenance, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.
Additionally to the standard maintenance properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
groups | object/array | Host groups to replace the current groups. The host groups must have the groupid property defined. |
hosts | object/array | Hosts to replace the current hosts. The hosts must have the hostid property defined. |
timeperiods | object/array | Maintenance time periods to replace the current periods. |
tags | object/array | Problem tags to replace the current tags. |
At least one host or host group must be defined for each maintenance.
"(object)" Restituisce un oggetto contenente gli ID dell'oggetto aggiornato manutenzioni sotto la proprietà maintenanceids
.
Replace the hosts currently assigned to maintenance with two different ones.
Request:
{
"jsonrpc": "2.0",
"method": "maintenance.update",
"params": {
"maintenanceid": "3",
"hosts": [
{"hostid": "10085"},
{"hostid": "10084"}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CMaintenance::update() in ui/include/classes/api/services/CMaintenance.php.