object service.create(object/array services)
このメソッドで、新しいサービスを作成できます。
このメソッドはどのタイプのユーザーでも利用可能です。このメソッドを呼び出す権限は、ユーザーロール設定で取り消すことができます。詳しくはユーザーの役割を参照してください。
(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. |
(object)
serviceids
プロパティの下で作成されたサービスのIDを含むオブジェクトを返します。 返されるIDの順序は、渡されたサービスの順序と一致します。
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.