Summary:
List details of, modify, or delete a specified maintenance schedule.
URL:
http(s)://{server hostname}/api/maintenance
Methods summary
- GET Method - inspect a maintenance schedule.
- PUT Method - update a maintenance schedule.
- DELETE Method - delete a maintenance schedule.
GET Method detail
Return all details of this maintenance schedule with the given maintenance id.
Response:
Returns a Maintenance Settings object. See Maintenance Settings.
Name | Description |
---|---|
id | maintId of this maintenance schedule. |
name | specified name of this maintenance schedule. Must not be empty or null, and must be unique for this server. Maximum of 255 characters. |
description | specified description of this maintenance schedule. Maximum of 255 characters. |
devices | map of serverIds (string) to a List of deviceIds (integer). Contains the devices that will be affected by this schedule. Devices are identified by their deviceId on the server from the serverId. This value will be ignored if it is not used in a POST call to create a new schedule. |
suppessEvents | if true, then the devices will have their events suppressed during the times that they would be under maintenance. |
serverId | serverId of the server that created this schedule. |
masterId | if 0, this schedule was created locally. Otherwise, the serverId is the master of this schedule, and the original ID is this value. |
addDevices | map of serverIds to list of deviceIds to add to the existing list of devices. Only applicable to modifying existing schedules, otherwise will be null. |
removeDevices | map of serverIds to list of deviceIds to remove from the existing list of devices. Only applicable to modifying existing schedules, otherwise will be null. |
schedule | an object that describes a schedule. |
Example:
INPUT
curl -u admin:admin https://localhost/api/maintenance/2?media=json
OUTPUT
{
"id" : 2,
"name" : "test",
"description" : "ate",
"devices" : { },
"suppressEvents" : true,
"schedule" : {
"begins" : 1571838648,
"ends" : 1572965448,
"recurs" : true,
"daysSecondsFrom" : 0,
"daysSecondsTo : 86400,
"recurrenceKind" : "WEEK_DAYS",
"validDays" : "5-6",
"validMonths" : "1-4, 6, 8-9, 11-12",
"invert" : false
},
"serverId" : "46e4aed7-3804-494a-90f8-3867481a3d39",
"masterId" : 0,
"addDevices" : null,
"removeDevices" : null
}
PUT Method detail
Modify this maintenance schedule with given values to the schedule with the given maintenance id, and return the modified maintenance schedule.
Request:
Same as 'GET Method - Response' above.
Response:
Returns a Maintenance Settings object, same as 'GET Method - Response' above.
The devices list cannot be set with this method, and any changes must be made using "addDevices" and "removeDevices".
Any value that does not exist in the request will keep its original value. However, schedule is an object, so any changes to schedule will require all values in the schedule to be present.
Example:
INPUT
curl -u admin:admin https://localhost/api/maintenance/2 -X PUT -H "content-type:application/json" -d \
'{
"addDevices" : {
"server-id" : [ 12 ]
}
}'
OUTPUT
{
"id" : 2,
"name" : "test",
"description" : "ate",
"devices" : {
"server-id" : [ 12 ]
},
"suppressEvents" : true,
"schedule" : {
"begins" : 1571838648,
"ends" : 1572965448,
"recurs" : true,
"daysSecondsFrom" : 0,
"daysSecondsTo : 86400,
"recurrenceKind" : "WEEK_DAYS",
"validDays" : "5-6",
"validMonths" : "1-4, 6, 8-9, 11-12",
"invert" : false
},
"serverId" : "46e4aed7-3804-494a-90f8-3867481a3d39",
"masterId" : 0,
"addDevices" : null,
"removeDevices" : null
}
DELETE Method detail
Remove this maintenance schedule. Returns OK if successful.
Response:
Returns OK status if successful.
Example:
INPUT
curl -X DELETE -u admin:admin https://localhost/api/maintenance/2?media=json
OUTPUT
{
"message" : "OK"
}
Comments
0 comments
Please sign in to leave a comment.