Moogsoft Docs

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. See the authenticate endpoint for more information.

window_id

String

Yes

ID of the maintenance window that you want to update.

name

String

No

Name of the maintenance window.

description

String

No

Description of the maintenance window.

filter

String

No

JSON or SQL-like filter for alerts to match. The filter must be in JSON format, that is, the same format used in alert and Situation filters in the database.

start_date_time

Unix epoch time in seconds (Number)

No

Start time of the maintenance window. This must be in Unix epoch time 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

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 AIOps takes into account any daylight savings time changes for the time zone.

Response

Endpoint updateMaintenanceWindow returns the following response:

Examples

The following examples demonstrate typical use of endpoint updateMaintenanceWindow:

Request examples

Example cURL request to update all the 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