Get Object's Children

GET /node/api/objects/:id/children

Returns a list of object's children.

Permissions: objectPermissions.

Request parameters

Path parameters

Parameter

Type

Description

id

String

required

The ID of an object whose children should be retrieved.

Response description

Field

Type

Description

children

Array<Object>

An array of object's children.

Examples

Request examples

Bash
JavaScript
NodeJS
Python
Bash
login=<...>
password=<...>
saymon_hostname=<...>
object_id=<...>
url=https://$saymon_hostname/node/api/objects/$object_id/children
curl -X GET $url -u $login:$password
JavaScript
let login = <...>
let password = <...>
let saymonHostname = <...>
let objectId = <...>
let path = "/node/api/objects/" + objectId + "/children";
let auth = "Basic " + btoa(login + ":" + password);
let headers = new Headers();
headers.append("Authorization", auth);
let requestOptions = {
method: "GET",
headers: headers
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
NodeJS
const http = require("http");
let login = <...>
let password = <...>
let saymonHostname = <...>
let objectId = <...>
let path = "/node/api/objects/" + objectId + "/children";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
"method": "GET",
"hostname": saymonHostname,
"headers": {
"Authorization": auth
},
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Python
import requests
login = <...>
password = <...>
saymon_hostname = <...>
object_id = <...>
url = "https://" + saymon_hostname + "/node/api/objects/" + \
object_id + "/children"
response = requests.request("GET", url, auth=(login, password))
print(response.text)

Response example

[
{
"name": "SAYMON Agent",
"object_groups": [],
"geoposition": [],
"child_ref_ids": [],
"child_link_ids": [],
"child_ids": [],
"parent_id": "5e21b85b308c3c66d64e07bc",
"weight": 1,
"tags": [],
"last_state_update": 1585034440816,
"updated": 1583915705723,
"created": 1579268187073,
"state_id": 3,
"class_id": 2,
"_stateConditionRefs": [],
"operations": [],
"properties": [],
"client_data": "...",
"id": "5e21b85b308c3c66d64e07c8"
},
{
"name": "CPU",
"discovery_id": "192.168.1.82-CPU",
"object_groups": [],
"geoposition": [],
"child_ref_ids": [],
"child_link_ids": [],
"child_ids": [],
"parent_id": "5e21b85b308c3c66d64e07bc",
"weight": 1,
"tags": [],
"last_state_update": 1583141090805,
"updated": 1583916836283,
"created": 1579268187099,
"state_id": 7,
"class_id": 4,
"_stateConditionRefs": [],
"operations": [],
"properties": [],
"client_data": "{...}",
"manual_state": null,
"owner_id": "5e21b752308c3c66d64e072c",
"id": "5e21b85b308c3c66d64e07d2"
},
...
}