This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

service.adddependencies

Description

object service.adddependencies(object/array serviceDependencies)

This method allows to create dependencies between IT services.

Parameters

(object/array) Service dependencies to create.

Each service dependency has the following parameters.

Parameter Type Description
serviceid string ID of the IT service that depends on a service, that is, the parent service.
dependsOnServiceid string ID of the IT service that a service depends on, that is, the child service.
soft string Type of dependency.

Refer to the service dependency object page for more information on dependency types.

Return values

(object) Returns an object containing the IDs of the affected parent IT services under the serviceids property.

Examples

Creating a hard dependency

Make IT service "2" a hard-dependent child of service "3".

Request:

{
           "jsonrpc": "2.0",
           "method": "service.adddependencies",
           "params": {
               "serviceid": "3",
               "dependsOnServiceid": "2",
               "soft": 0
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

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

See also

Source

CService::addDependencies() in frontends/php/api/classes/CService.php.