Get All Objects
Returns a list of all objects in the system (without properties).
Request
HTTP Request
Permissions
Path parameters
No parameters required.
Query parameters
Parameter | Type | Description |
---|---|---|
fields | String
|
A comma-separated list of objects' fields to be retrieved. |
Request body
The request body is empty.
Response
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
:
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));
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();
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"
},
...
]