Skip to main content

updateMaintenanceWindow

A Graze API POST request that updates an existing maintenance window.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint updateMaintenanceWindow takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

window_id

String

Yes

ID of the maintenance window you want to update.

name

String

No

Name of the maintenance window.

description

String

No

Description of the maintenance window.

filter

String

No

SQL-like filter that alerts must match to be included in the maintenance window.

See Filter Search Data for more information on creating SQL-like filters.

start_date_time

Unix epoch time in seconds (Number)

No

Start time of the maintenance window. This must be in Unix epoch time in seconds and may be up to 5 years in the future.

duration

Seconds (Number)

No

Duration of the maintenance window in seconds. The minimum duration is 1 second and the maximum is 157784630 seconds (5 years).

forward_alerts

Boolean

No

Determines whether or not alerts should be forwarded to the next Moolet in the processing chain.

recurring_period

Number

No

recurring_period_units

Number

No

timezone

String

No

Time zone that you want the maintenance window to be in. You can only change the time zone if the maintenance window is inactive when you make the request. The time zone must be a valid entry in the IANA Time Zone Database. When scheduling recurring maintenance windows, Moogsoft Enterprise takes into account any daylight savings time changes for the time zone.

Response

Endpoint updateMaintenanceWindow returns the following response:

Successful requests return a JSON object containing the following:

Type

Description

Array

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

Examples

The following examples demonstrate typical use of endpoint updateMaintenanceWindow:

Request examples

Example cURL request to update a number of parameters in the existing maintenance window ID 351:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateMaintenanceWindow" -H "Content-Type: application/json; charset=UTF-8" -d '{"window_id":351, "name":"Updated name", "description":"Updated Description", "filter":"source = \"server1\"", "start_date_time":1546433400, "duration":3600, "forward_alerts":false, "recurring_period":1, "recurring_period_units":3}'

Example cURL request to update the existing maintenance window ID 27 so that it will not occur again:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateMaintenanceWindow" -H "Content-Type: application/json; charset=UTF-8" -d '{"window_id":27, "recurring_period":0, "recurring_period_units":0}'

Example cURL request to update the existing maintenance window ID 144 to be in time zone "Europe/London":

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateMaintenanceWindow" -H "Content-Type: application/json; charset=UTF-8" -d '{"window_id":144, "timezone" : "Europe/London"}'

Response example

Example successful response returning details of the updated maintenance window:

{
  "del_flag": false,
  "forward_alerts": false,
  "last_updated": 1574076632,
  "timezone": "Europe/London",
  "description": "Updated Description",
  "recurring_period_units": 3,
  "filter": "source IN (\"server4\", \"server5\")",
  "duration": 3600,
  "recurring_period": 1,
  "name": "Updated name",
  "updated_by": 4,
  "window_id": 144,
  "start_date_time": 1674076188
}