Moogsoft Docs

getMaintenanceWindows

A Graze API GET request that returns maintenance windows based on how many should be returned. Only returns active recurring windows and scheduled maintenance windows, not expired or deleted maintenance windows.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getMaintenanceWindows takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

start

Number

Yes

Number of the first maintenance window to return, 0 to start at the first, 10 to start at the 11th.

limit

Number

Yes

Maximum number of maintenance windows to return.

Response

Endpoint getMaintenanceWindows returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

windows

Array

An array of objects containing the details of the returned maintenance windows.

Examples

The following examples demonstrate typical use of endpoint getMaintenanceWindows:

Request example

Example cURL request to return the first 20 maintenance windows:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getMaintenanceWindows" --data-urlencode 'start=0' --data-urlencode 'limit=20'

Response example

Example successful response returning details of two maintenance windows:

{
    "windows": [
        {
            "filter":"{ \"column\": \"type\", \"op\": 10, \"value\": \"FireInServerRoom\", \"type\": \"LEAF\" }",
            "duration":3600,
            "recurring_period":1,
            "del_flag":false,
            "forward_alerts":false,
            "last_updated":1499425460,
            "timezone":"Europe/London",
            "name":"My window 1",
            "updated_by":5,
            "description":"Fire in server room",
            "id":1,
            "recurring_period_units":3,
            "start_date_time":1499425427,
            "timezone": "America/New_York"
        },
        {
            "filter":"{ \"column\": \"description\", \"op\": 10, \"value\": \"SVR_LON_3451\", \"type\": \"LEAF\" }",
            "duration":3600,
            "recurring_period":0,
            "del_flag":false,
            "forward_alerts":false,
            "last_updated":1499425489,
            "timezone":"Europe/London",
            "name":"Hostname; SVR_LON_3451",
            "updated_by":5,
            "description":"Downtime on host SVR_LON_3451",
            "id":2,
            "recurring_period_units":0,
            "start_date_time":1499425462,
            "timezone" : "Europe/London"
        }
    ]
}