Esta es una traducción de la página de documentación original en español. Ayúdanos a mejorarla.

maintenance.update

Description

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.

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.

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.
tags array Problem tags.

At least one host or host group must be defined for each maintenance.

Valores devueltos

(object) Devuelve un objeto que contiene los ID de los mantenimientos actualizados bajo la propiedad maintenanceids.

Ejemplos

Asignación de diferentes anfitriones

Reemplazar los hosts actualmente asignados a mantenimiento por dos diferentes.

Solicitud:

{
           "jsonrpc": "2.0",
           "method": "maintenance.update",
           "params": {
               "maintenanceid": "3",
               "hosts": [
                   {"hostid": "10085"},
                   {"hostid": "10084"}
               ]
           },
           "id": 1
       }

Response:

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

Ver también

-Periodo de tiempo

Fuente

CMaintenance::update() enui/include/classes/api/services/CMaintenance.php.