View Server Performance Metrics
This API endpoint retrieves server metrics for a specific server over a specified time range. Query parameters such as type, start_date, end_date, interval, and limit can be used to control the time range and quantity of metrics retrieved.

Authorization: Bearer YOUR_TOKEN


Path Parameters
  • id string
    The unique ID of the server resource for which metrics are being retrieved. Example: '9bb4505f-6073-4a9b-abd3-cc698f695c7b'
Query Parameters
  • type string
    The type of metric being retrieved. The accepted values are: 'cpu-total-usage', 'memory-usage', 'disk-io-unified', 'disk-usage-unified', 'system-load-unified', 'swap-usage', and 'network-usage-unified'.
    Example: 'cpu-total-usage'
  • start_date (optional) string
  • end_date (optional) string
  • interval (optional) string
  • limit (optional) positive integer
JavaScript
Response codes
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);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).