Get Object Child Metrics

Returns a list of all metrics in children of a specified object.

This method doesn’t return metrics from links and references.

Request

HTTP Request

GET /node/api/objects/:objectId/children/metrics

Permissions

User has to have access to the object with the ID specified in the request (objectId).

objectPermissions

Path parameters

Parameters Type Description

id

String
required

The ID of the object whose metrics should be retrieved.

Body parameters

Request body is empty.

Response

The response contains a list of all metrics found in children of the specified object.

Each record in the returned list contains the following fields:

Field Description

entityId

Object ID

entityName

Object Name

name

Metric Name

Response will also contain host metrics if the host has any.

Example

Request

  • Bash

  • JavaScript

  • NodeJS

  • Python

login=<...>
password=<...>
saymon_hostname=<...>
object_id=<...>
url=https://$saymon_hostname/node/api/objects/$object_id/children/metrics

curl -X GET $url -u $login:$password
let login = <...>
let password = <...>
let saymonHostname = <...>
let objectId = <...>
let path = "/node/api/objects/" + objectId + "/children/metrics";
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 objectId = <...>
let path = "/node/api/objects/" + objectId + "/children/metrics";
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();
import requests

login = <...>
password = <...>
saymon_hostname = <...>
object_id = <...>
url = "https://" + saymon_hostname + "/node/api/objects/" + object_id + "/children/metrics"

response = requests.request("GET", url, auth=(login, password))
print(response.text)

Response

[
    {
        "entityId": "632afd331cfdb9e6cf070ff9",
        "entityName": "Memory",
        "name": "MEM.bytesAvailable"
    },
    {
        "entityId": "632afd331cfdb9e6cf070245",
        "entityName": "Network IO",
        "name": "awdl0.outgoingBytesPerSecond"
    }
    ...
]