Get All Objects

GET /node/api/objects

Returns a list of all objects in the system (without properties).
Permissions: objectPermissions.

Request parameters

Query parameters

Parameter
Type
Description
fields
String
required
A comma-separated list of objects' fields to be retrieved.

Response description

Field
Type
Description
objects
Array<Object>
An array of objects.

Examples

Request examples

The examples below show how to get a list of all objects each containing only the fields parent_id and name:
Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
saymon_hostname=<...>
4
url=https://$saymon_hostname/node/api/objects
5
6
curl -X GET $url -u $login:$password \
7
-G --data-urlencode "fields=parent_id,name"
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let queryParams = "fields=parent_id,name";
5
let path = "/node/api/objects" + "?" + queryParams;
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 queryParams = "fields=parent_id,name";
7
let path = "/node/api/objects" + "?" + queryParams;
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
url = "https://" + saymon_hostname + "/node/api/objects"
7
params = {"fields": "parent_id,name"}
8
9
response = requests.request("GET", url, auth=(login, password), params=params)
10
print(response.text)
Copied!

Response example

1
[
2
{
3
"name": "ROOT",
4
"parent_id": 0,
5
"id": 1
6
},
7
{
8
"name": "rossinnotw (192.168.1.82)",
9
"parent_id": 1,
10
"id": "5e21b85b308c3c66d64e07bc"
11
},
12
{
13
"name": "SAYMON Agent",
14
"parent_id": "5e21b85b308c3c66d64e07bc",
15
"id": "5e21b85b308c3c66d64e07c8"
16
},
17
{
18
"name": "CPU",
19
"parent_id": "5e21b85b308c3c66d64e07bc",
20
"id": "5e21b85b308c3c66d64e07d2"
21
},
22
...
23
]
Copied!
Last modified 3mo ago