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

...

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
NodeJS
Python
Bash
login=<your_login>
password=<your_password>
saymon_hostname=<your_saymon_hostname>
url=https://$saymon_hostname/node/api/objects
curl -X GET $url -u $login:$password \
-G --data-urlencode "fields=parent_id,name"
NodeJS
const http = require("http");
let login = <your_login>
let password = <your_password>
let saymon_hostname = <your_saymon_hostname>
let path = "/node/api/objects?fields=parent_id,name";
let auth = "Basic " + Buffer.from(login + ":" + password).toString("base64");
let options = {
"method": "GET",
"hostname": saymon_hostname,
"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 = <your_login>
password = <your_password>
saymon_hostname = <your_saymon_hostname>
url = "https://" + saymon_hostname + "/node/api/objects"
params = {"fields": "parent_id,name"}
response = requests.request("GET", url, auth=(login, password), params=params)
print(response.text)

Response example

[
{
"name": "ROOT",
"parent_id": 0,
"id": 1
},
{
"name": "rossinnotw (192.168.1.82)",
"parent_id": 1,
"id": "5e21b85b308c3c66d64e07bc"
},
{
"name": "SAYMON Agent",
"parent_id": "5e21b85b308c3c66d64e07bc",
"id": "5e21b85b308c3c66d64e07c8"
},
{
"name": "CPU",
"parent_id": "5e21b85b308c3c66d64e07bc",
"id": "5e21b85b308c3c66d64e07d2"
},
...
]