service.create
Description
object service.create(object/array itServices)
This method allows to create new IT services.
Parameters
(object/array) IT services to create.
Additionally to the standard IT service properties, the method accepts the following parameters.
| Parameter | Type | Description |
|---|---|---|
| dependencies | array | Service dependencies.
Each service dependency has the following parameters: |
| parentid | string | ID of a hard-linked parent IT service. |
| times | array | Service times to be created for the IT service. |
Return values
(object) Returns an object containing the IDs of the created IT services under the serviceids property. The order of the returned IDs matches the order of the passed IT services.
Examples
Creating an IT service
Create an IT service that will be switched to problem state, if at least one child has a problem. SLA calculation will be on and the minimum acceptable SLA is 99.99%.
Request:
{ "jsonrpc": "2.0", "method": "service.create", "params": { "name": "Server 1", "algorithm": 1, "showsla": 1, "goodsla": 99.99, "sortorder": 1 }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 }
Response:
{ "jsonrpc": "2.0", "result": { "serviceids": [ "5" ] }, "id": 1 }
Source
CService::create() in frontends/php/api/classes/CService.php.
Data source: Zabbix