Zabbix Documentation 2.0

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

User Tools

Site Tools


Sidebar

manual:appendix:api:maintenance:update

maintenance.update

Description

object maintenance.update(object/array maintenances)

This method allows to update existing maintenances.

Parameters

(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.

At this time, partial maintenance update is not supported, all parameters are mandatory. See ZBX-6167 for current status.

Additionally to the standard maintenance properties, the method accepts the following parameters.

Parameter Type Description
groupids array IDs of the host groups to replace the current groups.
hostids array IDs of the hosts to replace the current hosts.
timeperiods array Maintenance time periods to replace the current periods.
At least one host or host group must be defined for each maintenance.

Return values

(object) Returns an object containing the IDs of the updated maintenances under the maintenanceids property.

Examples

Assigning different hosts

Replace the hosts currently assigned to maintenance “3” with two different ones.

Request:

{
    "jsonrpc": "2.0",
    "method": "maintenance.update",
    "params": {
        "maintenanceid": "3",
        "hostids": [
            "10085",
            "10084"
        ]
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}

Response:

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

See also

Source

CMaintenance::update() in frontends/php/api/classes/CMaintenance.php.