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 or discovery ID of the object whose children must be retrieved.

Response description

Field
Type
Description
children
Array<Object>
An array of object's children.

Examples

Request examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
object_id=<...>
5
url=https://$saymon_hostname/node/api/objects/$object_id/children
6
7
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let objectId = <...>
5
let path = "/node/api/objects/" + objectId + "/children";
6
let auth = "Basic " + btoa(login + ":" + password);
7
8
let headers = new Headers();
9
headers.append("Authorization", auth);
10
11
let requestOptions = {
12
method: "GET",
13
headers: headers
14
};
15
16
fetch(saymonHostname + path, requestOptions)
17
.then(response => response.text())
18
.then(result => console.log(result))
19
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let login = <...>
4
let password = <...>
5
let saymonHostname = <...>
6
let objectId = <...>
7
let path = "/node/api/objects/" + objectId + "/children";
8
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
9
10
let options = {
11
"method": "GET",
12
"hostname": saymonHostname,
13
"headers": {
14
"Authorization": auth
15
},
16
"path": path
17
};
18
19
let req = http.request(options, function (res) {
20
let chunks = [];
21
22
res.on("data", function (chunk) {
23
chunks.push(chunk);
24
});
25
26
res.on("end", function (chunk) {
27
let body = Buffer.concat(chunks);
28
console.log(body.toString());
29
});
30
31
res.on("error", function (error) {
32
console.error(error);
33
});
34
});
35
36
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
object_id = <...>
7
url = "https://" + saymon_hostname + "/node/api/objects/" + \
8
object_id + "/children"
9
10
response = requests.request("GET", url, auth=(login, password))
11
print(response.text)
Copied!

Response example

1
[
2
{
3
"name": "SAYMON Agent",
4
"object_groups": [],
5
"geoposition": [],
6
"child_ref_ids": [],
7
"child_link_ids": [],
8
"child_ids": [],
9
"parent_id": "5e21b85b308c3c66d64e07bc",
10
"weight": 1,
11
"tags": [],
12
"last_state_update": 1585034440816,
13
"updated": 1583915705723,
14
"created": 1579268187073,
15
"state_id": 3,
16
"class_id": 2,
17
"_stateConditionRefs": [],
18
"operations": [],
19
"properties": [],
20
"client_data": "...",
21
"id": "5e21b85b308c3c66d64e07c8"
22
},
23
{
24
"name": "CPU",
25
"discovery_id": "192.168.1.82-CPU",
26
"object_groups": [],
27
"geoposition": [],
28
"child_ref_ids": [],
29
"child_link_ids": [],
30
"child_ids": [],
31
"parent_id": "5e21b85b308c3c66d64e07bc",
32
"weight": 1,
33
"tags": [],
34
"last_state_update": 1583141090805,
35
"updated": 1583916836283,
36
"created": 1579268187099,
37
"state_id": 7,
38
"class_id": 4,
39
"_stateConditionRefs": [],
40
"operations": [],
41
"properties": [],
42
"client_data": "{...}",
43
"manual_state": null,
44
"owner_id": "5e21b752308c3c66d64e072c",
45
"id": "5e21b85b308c3c66d64e07d2"
46
},
47
...
48
}
Copied!