Skip to main content

updateMaintenanceWindow

A MoogDb v2 method that updates an existing maintenance window object, by passing an object containing the maintenance window information.

Back to MoogDb V2 API Method Reference.

Request arguments

Method updateMaintenanceWindow takes the following request arguments:

Name

Type

Required

Description

updatedWindow

JSON Object

Yes

Maintenance window object containing the updated details.

The maintenance window object updatedWindow contains the following information:

Name

Type

Required

Description

id

Number

Yes

ID of the maintenance window you want to update.

user_id

Number

Yes

ID of the user who is updating the maintenance window.

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

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

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

Response

Method updateMaintenanceWindow returns the following response:

Type

Description

Object

A JSON object containing details of the updated maintenance window.

Examples

The following examples demonstrate typical use of method updateMaintenanceWindow:

Request example

Example request to update the description in maintenance window ID 2 by user ID 3:

var response = moogdb.updateMaintenanceWindow({ "id" : 2, "description" : "Updated name", "user_id": 3 });

Response example

Example response returning details of the updated maintenance window ID 2:

{
  "del_flag": false,
  "forward_alerts": false,
  "last_updated": 1574164759,
  "timezone": "Europe/London",
  "description": "Updated name",
  "recurring_period_units": 0,
  "filter": "(severity IN (0, 1, 2, 3, 4, 5)) AND (owner IN (3))",
  "duration": 3600,
  "recurring_period": 0,
  "name": "Test",
  "updated_by": 3,
  "id": 2,
  "start_date_time": 1574164339
}