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 maintenance information for a specific maintenance entry or all entries on the account.
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": "[email protected]" } } }
In the returned data is the 'history' element that includes information about the last 10 runs of this maintenance.
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.
Create a scheduled or ad-hoc maintenance. A maintenance id will be generated on successful creation.
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." }
Update a scheduled or ad-hoc 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." }
Remove a maintenance
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."}