integer/array service.get(object parameters)
The method allows to retrieve IT services according to the given parameters.
(object)
Parameters defining the desired output.
The method supports the following parameters.
Parameter | Type | Description |
---|---|---|
serviceids | string/array | Return only IT services with the given IDs. |
parentids | string/array | Return only IT services with the given hard-dependent parent IT services. |
childids | string/array | Return only IT services that are hard-dependent on the given child IT services. |
selectParent | query | Return a parent property with the hard-dependent parent service. |
selectDependencies | query | Return a dependencies property with child service dependencies. |
selectParentDependencies | query | Return a parentDependencies property with parent service dependencies. |
selectTimes | query | Return a times property with service times. |
selectAlarms | query | Return an alarms property with service alarms. |
selectTrigger | query | Return a trigger property with the associated trigger. |
sortfield | string/array | Sort the result by the given properties. Possible values are: name and sortorder . |
countOutput | flag | These parameters being common for all get methods are described in detail in the reference commentary. |
editable | boolean | |
excludeSearch | flag | |
filter | object | |
limit | integer | |
output | query | |
preservekeys | flag | |
search | object | |
searchByAny | boolean | |
searchWildcardsEnabled | boolean | |
sortorder | string/array | |
startSearch | flag |
(integer/array)
Returns either:
countOutput
parameter has been used.Retrieve all data about all IT services and their dependencies.
Request:
{
"jsonrpc": "2.0",
"method": "service.get",
"params": {
"output": "extend",
"selectDependencies": "extend"
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"serviceid": "2",
"name": "Server 1",
"status": "0",
"algorithm": "1",
"triggerid": "0",
"showsla": "1",
"goodsla": "99.9000",
"sortorder": "0",
"dependencies": []
},
{
"serviceid": "3",
"name": "Data center 1",
"status": "0",
"algorithm": "1",
"triggerid": "0",
"showsla": "1",
"goodsla": "99.9000",
"sortorder": "0",
"dependencies": [
{
"linkid": "11",
"serviceupid": "3",
"servicedownid": "2",
"soft": "0",
"sortorder": "0",
"serviceid": "2"
},
{
"linkid": "10",
"serviceupid": "3",
"servicedownid": "5",
"soft": "0",
"sortorder": "1",
"serviceid": "5"
}
]
},
{
"serviceid": "5",
"name": "Server 2",
"status": "0",
"algorithm": "1",
"triggerid": "0",
"showsla": "1",
"goodsla": "99.9900",
"sortorder": "1",
"dependencies": []
}
],
"id": 1
}
CService::get() in frontends/php/include/classes/api/services/CService.php.