A MoogDb v2 method that finds maintenance windows based on a filter and a limit.
Back to MoogDb V2 API Method Reference.
Method findMaintenanceWindows
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | SQL-like filter to match maintenance windows that you want to find. For example: See Filter Search Data for more information on creating SQL-like filters. |
| Number | No | Maximum number of windows to return. Default is 100. |
Method findMaintenanceWindows
returns the following response:
Type | Description |
---|---|
Object | A JSON object containing maintenance windows that match the filter. |
The following examples demonstrate typical use of method findMaintenanceWindows
:
Example request to return maintenance windows where the description matches "maintenance":
var response = moogdb.findMaintenanceWindows("description matches maintenance");
Example response returning two maintenance windows where the description matches "maintenance":
[
{
"del_flag": false,
"forward_alerts": false,
"last_updated": 1573833276,
"timezone": "Europe/London",
"description": "This is my first maintenance window",
"recurring_period_units": 0,
"filter": "description MATCHES \"Test\"",
"duration": 3600,
"recurring_period": 0,
"name": "My Maintenance Window 1",
"updated_by": 3,
"id": 1,
"start_date_time": 1573833229
},
{
"del_flag": false,
"forward_alerts": false,
"last_updated": 1574164385,
"timezone": "Europe/London",
"description": "This is my second maintenance window",
"recurring_period_units": 0,
"filter": "(severity IN (0, 1, 2, 3, 4, 5)) AND (owner IN (3))",
"duration": 3600,
"recurring_period": 0,
"name": "My Maintenance Window 2",
"updated_by": 3,
"id": 2,
"start_date_time": 1574164339
}
]