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
JavaScript
NodeJS
Python
Bash
login=<...>
password=<...>
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/objects
curl -X GET $url -u $login:$password \
-G --data-urlencode "fields=parent_id,name"
JavaScript
let login = <...>
let password = <...>
let saymonHostname = <...>
let queryParams = "fields=parent_id,name";
let path = "/node/api/objects" + "?" + queryParams;
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 queryParams = "fields=parent_id,name";
let path = "/node/api/objects" + "?" + queryParams;
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 = <...>
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"
},
...
]