service_id
, name
, description
, and timezone
. This endpoint creates a server monitoring resource, allowing you to visualize essential system metrics like CPU, memory, and disk usage through charts.const axios = require('axios');
const url = 'https://resource-cmd.api.pinghome.io/v1/server-resource';
const data = {
service_id: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98',
name: 'Resource name',
description: 'Resource description',
timezone: 'Europe/Berlin',
chart_type_default: 'line',
os: 'ubuntu',
metric_types_basic: ['cpu-total-usage'],
metric_types_advanced: ['disk-io-unified'],
metric_types_complex: ['processes-unified'],
interval: 60,
enabled: true
};
axios.post(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
monitor_ids
as query parameters. This bulk operation is ideal for cleaning up inactive, deprecated, or test servers from your monitoring environment.const axios = require('axios');
const url = 'https://resource-cmd.api.pinghome.io/v1/server-resource?id=6766163a-568d-47b4-a1fa-91a0957e06d4&id=c03b02ec-244f-4d2c-8f68-3910071ed5c8';
axios.delete(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
monitor_id
in the path and submitting the new configuration values in the request body. You can modify properties such as the name
, description
, or timezone
to keep the server's metadata up to date.const axios = require('axios');
const url = 'https://resource-cmd.api.pinghome.io/v1/server-resource/445a5c1f-c0eb-403a-96d7-3976e5dc74ed';
const data = {
service_id: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98',
name: 'Resource name',
description: 'Resource description',
timezone: 'Europe/Berlin',
chart_type_default: 'line',
os: 'ubuntu',
metric_types_basic: ['cpu-total-usage'],
metric_types_advanced: ['disk-io-unified'],
metric_types_complex: ['processes-unified'],
interval: 60,
enabled: true,
};
axios.put(url, data, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
service_id
in the path. This endpoint returns metadata for each registered server, allowing teams to see which servers are actively being monitored under a given service.limit
and page
query parameters, making it easier to manage large infrastructures and avoid overloading responses.const axios = require('axios');
const url = 'https://resource-query.api.pinghome.io/v1/service/906a3444-15ce-4410-8041-89a238e9e91f/server-resources?limit=50&page=1';
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
monitor_id
in the path. The response includes metadata such as the server name, description, timezone, and service association, allowing you to review its current configuration.const axios = require('axios');
const url = 'https://resource-query.api.pinghome.io/v1/server-resource/445a5c1f-c0eb-403a-96d7-3976e5dc74ed';
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
monitor_id
in the path. This endpoint allows you to query server resource usage — such as CPU, memory, disk, or network — across a specified time window.type
(e.g., cpu, memory), start_date
, end_date
, interval
(e.g., on-demand, hourly), and limit
to control the resolution and size of the returned dataset.const axios = require('axios');
const url = 'https://statistic-query.api.pinghome.io/v1/server-resource/9bb4505f-6073-4a9b-abd3-cc698f695c7b/metrics?type=cpu-total-usage&start_date=2023-04-03T21:00:00Z&end_date=2023-04-03T22:04:00Z&interval=on-demand&limit=100';
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});