Update Server Monitor
This API endpoint allows you to update a server resource by providing its unique ID in the path and specifying the updated details in the request body.

Authorization: Bearer YOUR_TOKEN



Expected Behavior:

  • On success, the server resource will be updated, and a confirmation message along with the updated resource ID will be returned.
  • If the request is unauthorized or the provided ID is invalid, an error message will be returned, specifying the issue.
Path Parameters
  • id string
    The unique ID of the server resource to be updated. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • service_id string
    The unique service ID associated with the server resource.
    Example: 'ed45b14d-e3ea-4f40-9a4e-16c175afad98'
  • name string
  • description string
  • timezone string
  • chart_type_default string
  • os string
  • metric_types_basic array
  • metric_types_advanced array
  • metric_types_complex array
  • interval integer
  • enabled boolean
JavaScript
Response codes
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);
});
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).