Navigation

Maintenance Windows

Overview

The maintenanceWindows resource turns off alert notifications for specified alert types for a period of time, to allow maintenance to occur.

Endpoints

Get All Maintenance Windows

Get all maintenance windows with end dates in the future.

GET /api/public/v1.0/groups/GROUP-ID/maintenanceWindows

Get a Single Maintenance Window by its ID

GET /api/public/v1.0/groups/GROUP-ID/maintenanceWindows/WINDOW-ID

Create a Maintenance Window

POST /api/public/v1.0/groups/GROUP-ID/maintenanceWindows

The resource requires the following fields:

  • alertTypeNames
  • startDate
  • endDate

Update a Maintenance Window

PATCH /api/public/v1.0/groups/GROUP-ID/maintenanceWindows/WINDOW-ID

Delete a Maintenance Window

DELETE /api/public/v1.0/groups/GROUP-ID/maintenanceWindows/WINDOW-ID

Sample Entity

The following is a sample return document.

{
  "id" : "5628faffd4c606594adaa3b2",
  "groupId" : "541ed2009436399a1f54e01b",
  "created" : "2015-10-22T15:04:31Z",
  "updated" : "2015-10-22T15:04:31Z",
  "startDate" :"2015-10-23T22:00:00Z",
  "endDate" : "2015-10-23T23:30:00Z",
  "alertTypeNames" : [ "REPLICA_SET" ],
  "description" : "new description",
  "links" : [ ... ]
}

Entity Fields

Name Type Description
id string unique identifier
groupId string ID of the group that owns this maintenance window config
created date When this maintenance window config was created.
updated date When this maintenance window config was last updated.
startDate date Start date for the maintenance window.
endDate date The end date for the maintenance window. It must be after startDate.
alertTypeNames string array Alert types to silence during maintenance window. For example: HOST, REPLICA_SET, CLUSTER, AGENT, BACKUP
description string Description of the maintenance window. This field might not exist.

Examples

Get All Maintenance Windows

Get all maintenance windows for a group with start dates in the future.

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/groups/541ed2009436399a1f54e01b/maintenanceWindows"

Response

HTTP/1.1 200 OK

{
  "results" : [ {
    "alertTypeNames" : [ "BACKUP" ],
    "created" : "2015-10-22T15:04:31Z",
    "description" : "new description",
    "endDate" : "2015-10-23T23:30:00Z",
    "groupId" : "541ed2009436399a1f54e01b",
    "id" : "5628faffd4c606594adaa3b2",
    "startDate" : "2015-10-23T22:00:00Z",
    "updated" : "2015-10-22T15:04:31Z",
    "links": [ ... ]
  }, {
    "alertTypeNames" : [ "AGENT", "BACKUP" ],
    "created" : "2015-10-22T15:40:09Z",
    "endDate" : "2015-10-23T23:30:00Z",
    "groupId" : "541ed2009436399a1f54e01b",
    "id" : "56290359d4c606594adaafe8",
    "startDate" : "2015-10-23T22:00:00Z",
    "updated" : "2015-10-22T15:40:09Z",
    "links": [ ... ]
  } ],
  "links" : [ ... ],
  "totalCount" : 2
}

Get a Single Maintenance Window by its ID

Request

curl -i -u "username:apiKey" --digest "https://<ops-manager-host>/api/public/v1.0/groups/541ed2009436399a1f54e01b/maintenanceWindows/5628faffd4c606594adaa3b2"

Response

HTTP/1.1 200 OK

{
  "alertTypeNames" : [ "AGENT", "BACKUP" ],
  "created" : "2015-10-22T15:04:31Z",
  "description" : "new description",
  "endDate" : "2015-10-23T23:30:00Z",
  "groupId" : "541ed2009436399a1f54e01b",
  "id" : "5628faffd4c606594adaa3b2",
  "startDate" : "2015-10-23T22:00:00Z",
  "updated" : "2015-10-22T15:04:31Z",
  "links" : [ ... ]
}

Create a Maintenance Window

Request

curl -i -u "username:apiKey" --digest -X POST -H "Content-Type: application/json" "https://<ops-manager-host>/api/public/v1.0/groups/541ed2009436399a1f54e01b/maintenanceWindows" --data '
{
  "startDate" :"2015-10-23T22:00:00Z",
  "endDate" : "2015-10-23T23:30:00Z",
  "alertTypeNames" : [ "REPLICA_SET" ],
  "description" : "new description"
}'

Response

HTTP/1.1 200 Created

{
  "alertTypeNames" : [ "REPLICA_SET" ],
  "created" : "2015-10-22T20:49:35Z",
  "description" : "my description",
  "endDate" : "2015-10-23T23:30:00Z",
  "groupId" : "541ed2009436399a1f54e01b",
  "id" : "56294bdfd4c643eef5176b73",
  "startDate" : "2015-10-23T22:00:00Z",
  "updated" : "2015-10-22T20:49:35Z",
  "links" : [ ... ]
}

Update a Maintenance Window

Request

curl -i -u "username:apiKey" --digest -X PATCH -H "Content-Type: application/json" "https://<ops-manager-host>/api/public/v1.0/groups/541ed2009436399a1f54e01b/maintenanceWindows/562909fcd4c606594adab8de" --data '
{
  "alertTypeNames" : [ "HOST", "REPLICA_SET" ]
}'

Response

HTTP/1.1 201 OK

{
  "alertTypeNames" : [ "HOST", "REPLICA_SET" ],
  "created" : "2015-10-22T20:49:35Z",
  "description" : "my description",
  "endDate" : "2015-10-23T23:30:00Z",
  "groupId" : "541ed2009436399a1f54e01b",
  "id" : "56294bdfd4c643eef5176b73",
  "startDate" : "2015-10-23T22:00:00Z",
  "updated" : "2015-10-23T16:11:49Z",
  "links" : [ ... ]
}

Delete a Maintenance Window

Request

curl -i --digest -u "username:apiKey" -X DELETE "https://<ops-manager-host>/api/public/v1.0/groups/541ed2009436399a1f54e01b/maintenanceWindows/562909fcd4c606594adab8de"

Response

HTTP/1.1 200 OK

{}