Documentation

API Reference :: maintenance

Maintenance schedules are used for automating the disabling and re-enabling of checks on a schedule or for one-time use (ad-hoc). In the web site they are under Account Settings -> Maintenance.

GET

Get maintenance information for a specific maintenance entry or all entries on the account.

  • customerid - optional string - customerid of the subaccount to which the maintenance belongs.
  • id - optional string of the maintenance id (scheduled or ad-hoc), if omitted a list of all configured maintenance is returned.

Request example: ("NZT101" is the id passed)

curl -X GET 'https://api.nodeping.com/api/1/maintenance/NZT101'

Response example:

{
    "NZT101": {
        "name": "Daily at 12:01",
        "enabled": true,
        "processing": false,
        "cron": "1 12 * * *",
        "duration": 25,
        "history": {
            "1580558468566": {
                "disabledchecklist": ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"],
                "skippedchecklist": []
            }
        },
        "nextrun": 1580644860000,
        "checklist": ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"],
        "update": {
            "timestamp": 1562013143000,
            "user": "youremail@example.com"
        }
    }
}

In the returned data is the 'history' element that includes information about the last 10 runs of this maintenance.

  • disabledchecklist - the list of check ids that were disabled during this maintenance run.
  • skippedchecklist - the list of check ids that were already disabled before this maintenance was run so were left disabled during and after this maintenance run.

The returned 'update' element shows the user email address and timestamp of the creation or latest edit of this maintenance instance.

Ad-hoc maintenance information will be automatically removed when the maintenance run is completed.


POST

Create a scheduled or ad-hoc maintenance. A maintenance id will be generated on successful creation.

  • customerid - optional string - customerid of the subaccount to which the maintenance belongs.
  • id - For ad-hoc maintenance set this to 'ad-hoc'. Ignored for scheduled maintenance.
  • name - A friendly name you want to call this maintenance
  • enabled - optional boolean - set to true to enable and false to disable this maintenance
  • cron - optional string for the cron line for scheduled maintenance (ignored for ad-hoc maintenance)
  • duration - required integer - the number of minutes to keep the checks disabled.
  • checklist - required array - list of check ids you want to disabled for this maintenance.

Request example: creating an ad-hoc maintenance

curl -X POST -H "Content-Type: application/json" -d'{"name": "Ad-hoc created via API","enabled":false,"duration": 85,"checklist": ["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"]}' 'https://api.nodeping.com/api/1/maintenance/ad-hoc'

Response example: The generated id returned is '9VKOB'

{
    "9VKOB":{
        "name":"Ad-hoc created via API",
        "enabled":false,
        "processing":false,
        "duration":85,
        "history":{},
        "nextrun":1579631487122,
        "checklist":["201911191441YC6SJ-4S9OJ78G","201911191441YC6SJ-XB5HUTG6"]
    },
    "ok":true,
    "message":"Maintenance settings were successfully saved."
}

PUT

Update a scheduled or ad-hoc maintenance.

  • customerid - optional string - customerid of the subaccount to which the maintenance belongs.
  • id - required string (example from the response above - id is '9VKOB') - can be put in the URL path or in the JSON.
  • name - optional string - A friendly name you want to call this maintenance
  • enabled - optional boolean - set to true to enable and false to disable this maintenance
  • cron - optional string for the cron line for scheduled maintenance (ignored for ad-hoc maintenance)
  • duration - required integer - the number of minutes to keep the checks disabled.
  • checklist - required array - list of check ids you want to disabled for this maintenance.

Request example: updating maintenance with id 9VKOB

curl -X PUT -H "Content-Type: application/json" -d'{"name": "Updated via API","enabled":true,"duration": 24,"checklist": ["201911191441YC6SJ-4S9OJ78G"]}' 'https://api.nodeping.com/api/1/maintenance/9VKOB'

Response example:

{
    "9VKOB":{
        "name":"Updated via API",
        "enabled":true,
        "processing":false,
        "duration":24,
        "history":{},
        "nextrun":1579631487122,
        "checklist":["201911191441YC6SJ-4S9OJ78G"]
    },
    "ok":true,
    "message":"Maintenance settings were successfully saved."
}

DELETE

Remove a maintenance

  • customerid - optional string - customerid of the subaccount to which the maintenance belongs.
  • id - required string - can be passed in the URL id position

Request example: ("9VKOB" is the id passed in the URL)

curl -X DELETE 'https://api.nodeping.com/api/1/maintenance/9VKOB'

Response example:

{"ok":true,"message":"Maintenance removed successfully."}

If you have any questions, get in touch at support@nodeping.com, or use our Contact form.