Summary:
List available maintenance schedules or create a new maintenance schedule.
URL:
http(s)://{server hostname}/api/maintenance
Methods summary
- GET Method - lists available maintenance schedules.
- POST Method - create a new maintenance schedule.
GET Method detail
Lists available maintenance schedules.
Response:
A map of maintenance ids to their names.
Example:
INPUT
curl -u admin:admin https://localhost/api/maintenance
OUTPUT
{
"items" : [ {
"id" : 29,
"name" : "supp"
}, {
"id" : 30,
"name" : "test"
} ],
"count" : 2
}
POST Method detail
Creates a new maintenance schedule.
Request:
A maintenance settings object. This object is used many times in Maintenance API.
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. |
suppressEvents | 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 schedule's 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. |
begins | time in which the schedule starts in seconds. |
ends | time in which the schedule stops in seconds. |
recurs | if false, the schedule will be active throughout the time between "begins" and "ends". If true, follows a recurrence of periods given by the below values, but only between "begins" and "ends". |
daysSecondsFrom |
time of day the maintenance schedule should start being active in seconds. (Hours * 3600 + Minutes * 60 + Seconds) (e.g. 0 = 0000 hours (12 AM), 3600 = 0100 (1 AM), 34200 = 0930 (9:30AM)) If "daysSecondsFrom" = 0 and "daysSecondsTo" = 86400 (24 hours), then it will be active the whole day. |
daysSecondsTo | time of day it should stop being active in seconds. Must be larger than "daysSecondsFrom". |
recurrenceKind | can be "EVERY_DAY", "WEEK_DAYS", "MONTH_DAYS". |
validDays |
string description of valid days. Section of days are separated by a comma ",", and if there are 2 or more consecutive days then the first and last days are given with a hyphen "-" in between (e.g. "1, 5, 6-7, 10-22"). When setting this field, it is valid to contain consecutive days separately. If there are values greater than the maximum, those values will be ignored (e.g. 8 for "WEEK_DAYS"). If "recurrenceKIND" is "WEEK_DAYS", this describes the week days on which the schedule should be active (max 7). (e.g. 1 = Monday, 7 = Sunday). If "recurrenceKind" is "MONTH_DAYS", this describes the days in a month on which the schedule should be active (max 31) (e.g. 3 = 3rd of every month, 31 = 31st of every month that has a 31st day). |
validMonths | string description of valid months (e.g. 1 = January, 6 = June). |
invert | if true, this maintenance will be active when outside of the given schedule. |
Example:
INPUT
curl -u admin:admin https://localhost/api/maintenance -X POST -H "content-type:application/json" -d \
'{
"name" : "ddd",
"devices" : {
"server-id" : [ 12 ]
},
"suppressEvents" : false,
"schedule" : {
"begins" : 1562910269,
"ends" : 0,
"recurs" : true,
"daysSecondsFrom" : 39600,
"daysSecondsTo" : 50400,
"recurrenceKind" : "MONTH_DAYS",
"validDays" : "2-3, 8, 10, 15, 17-18, 22-31",
"validMonths" : "1-4, 6-12",
}
}'
OUTPUT
{
"id" : 5,
"name" : "ddd",
"description" : "",
"devices" : {
"test" : [ 12 ]
},
"suppressEvents" : false,
"schedule" : {
"begins" : 1562910269,
"ends" : 0,
"recurs" : true,
"daysSecondsFrom" : 39600,
"daysSecondsTo : 50400,
"recurrenceKind" : "MONTH_DAYS",
"validDays" : "2-3, 8, 10, 15, 17-18, 22-31",
"validMonths" : "1-4, 6-12",
"invert" : false
},
"serverId" : "c4237d15-de15-4d03-9e07-2a76ddd95018",
"masterId" : 0,
"addDevices" : null,
"removeDevices" : null
}
Comments
0 comments
Please sign in to leave a comment.