object service.create(object/array services)
Este método permite criar novos serviços.
Este método está disponível para usuários de qualquer tipo. As permissões para chamar o método podem ser revogadas nas configurações de função do usuário. Consulte Funções do usuário para obter mais informações.
(object/array)
services to create.
Additionally to the standard service properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
children | array | Child services to be linked to the service. The children must have the serviceid property defined. |
parents | array | Parent services to be linked to the service. The parents must have the serviceid property defined. |
tags | array | Service tags to be created for the service. |
times | array | Service times to be created for the service. |
problem_tags | array | Problem tags to be created for the service. |
status_rules | array | Status rules to be created for the service. |
Valores de retorno
(object)
Retorna um objeto contendo os IDs dos serviços criados na propriedade serviceids
. A ordem dos IDs retornados corresponde à ordem dos serviços passados
Create a 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 will be 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:
CService::create() in ui/include/classes/api/services/CService.php.