Maintenance Windows

Attributes

id (read-only) Unique maintenance window ID.
start Start date/time for maintenance window (UTC).
end End date/time for maintenance window (UTC).
started (read-only) Has this maintenance window started yet?
ended (read-only) Has this maintenance window ended yet?
reason The reason for this maintenance window.
servers IDs of servers belonging to this maintenance window.
url (read-only) URL information about the requested item.

Available APIs

/api/maintenance_windows/

List all available maintenance windows or create a new maintenance window.

GET

List all available maintenance windows.

Arguments

  • limit (optional, default:2500, max:2500) – Sets the page size to a limit set by the user.
  • page (optional, default:0) – Retrieve the specific page of data of size limit.

Argument Examples

  • limit=10 – will get the first page of the first 10 items.
  • limit=25&page=3 – will get the 4th page of size 25 items.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/maintenance_windows/
{
    "pagination": {
        "count": 118, 
        "next": null, 
        "previous": null
    }, 
    "data": [
        {
            "id": 61, 
            "reason": "", 
            "start": 1297821600, 
            "end": 1297824300, 
            "started": true, 
            "ended": true, 
            "servers": [], 
            "url": "/api/v5/maintenance_windows/61/"
        }, 
        {
            "id": 39, 
            "reason": "", 
            "start": 1296688500, 
            "end": 1296689400, 
            "started": true, 
            "ended": true, 
            "servers": [], 
            "url": "/api/v5/maintenance_windows/39/"
        }, 
    ]
}

POST

Create a new maintenance window.

Arguments

  • start (required) – start time in UTC time zone (ex: yyyy-mm-dd 24hr:mm).
  • end (required) – end time in UTC time zone (ex: yyyy-mm-dd 24hr:mm).
  • reason (optional)- reason for maintenance window.
  • servers (required) – a list of server IDs.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/maintenance_windows/ -d "start=2012-10-20 14:00&end=2012-10-20 15:00&reason=server updates&servers=[1,2,3]"
{
    "id": 123,
    "url": "/api/v5/maintenance_windows/123/",
    "start": "2012-10-20 19:00:00",
    "end": "2012-10-20 20:00:00",
    "reason": "server updates",
    "servers": [
        1,
        2,
        3
    ]
}

/api/maintenance_windows/{maintenance_window_id}/

View, update and delete a maintenance window.

GET

Get info about a maintenance window, given by the maintenance window id in the URL. It takes no additional parameters.

PUT

Update a maintenance window.

Arguments

  • start (required) – start time in UTC time zone (ex: yyyy-mm-dd 24hr:mm).
  • end (required) – end time in UTC time zone (ex: yyyy-mm-dd 24hr:mm).
  • reason (optional)- reason for maintenance window.
  • servers (required) – a list of server IDs.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/maintenance_windows/123/ -X PUT -d "start=2012-10-20 14:00&end=2012-10-20 15:00&reason=server updates&servers=[1,2,3]"
{
    "id": 123,
    "url": "/api/v5/maintenance_windows/123/",
    "start": "2012-10-20 19:00:00",
    "end": "2012-10-20 20:00:00",
    "servers": [
        1,
        2,
        3
    ]
}

DELETE

Delete a maintenance window if it exists.

curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/maintenance_windows/123/ -X DELETE