Maintenance windows API - GET a maintenance window

Gets the parameters of the specified maintenance window.

The request produces an application/json payload.

GET
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/maintenanceWindows/{id}
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/maintenanceWindows/{id}

Parameters

Parameter Type Description In Required
id string

The ID of the required maintenance window.

path required

Response format

The MaintenanceWindow object

Configuration of a maintenance window.

Element Type Description
metadata ConfigurationMetadata

Metadata useful for debugging.

id string

The ID of the maintenance window.

name string

The name of the maintenance window, displayed in the UI.

description string

A short description of the maintenance purpose.

type string

The type of the maintenance: planned or unplanned.

suppression string

The type of suppression of the alerting and problem detection during the maintenance.

scope Scope

The scope of the maintenance window.

The scope restrict the alert/problem detection suppression to certain Dynatrace entities. It can contain a list of entities and/or matching rules for dynamic formation of the scope.

If no scope is specified, the alert/problem detection suppression applies to the entire environment.

schedule Schedule

The date, time, and recurrence of the maintenance window.

The Schedule object

The schedule of the maintenance window.

Element Type Description
recurrenceType string

The type of the schedule recurrence.

recurrence Recurrence

The recurrence of the schedule.

Not applicable if the recurrenceType is Once.

start string

The start date and time of the maintenance window validity period in the yyyy-mm-dd HH:mm format.

end string

The end date and time of the maintenance window validity period in the yyyy-mm-dd HH:mm format.

zoneId string

The time zone of the start and end time. Default time zone is UTC.

You can user either UTC offset UTC+01:00 format or the IANA Time Zone Database format (for example, Europe/Vienna).

The Recurrence object

The recurrence of the maintenance window.

Element Type Description
dayOfWeek string

The day of the week for weekly maintenance.

The format is the full name of the day in upper case, for example THURSDAY.

dayOfMonth integer

The day of the month for monthly maintenance.

The value of 31 is treated as last day of month for months that don't have the 31st day. The value of 30 is also treated as last day of month for February.

startTime string

The start time of the maintenance window in the HH:mm format.

durationMinutes integer

The duration of the maintenance window in minutes.

The Scope object

The scope of the maintenance window.

The scope restrict the alert/problem detection suppression to certain Dynatrace entities. It can contain a list of entities and/or matching rules for dynamic formation of the scope.

If no scope is specified, the alert/problem detection suppression applies to the entire environment.

Element Type Description
entities string[]

A list of Dynatrace entities, for example hosts or services, to be included in scope.

Allowed values are Dynatrace entity IDs.

matches MonitoredEntityFilter[]

A list of matching rules for dynamic scope formation.

If several rules are set, then the OR logic applies.

The MonitoredEntityFilter object

A matching rule for Dynatrace entities.

Element Type Description
type string

The type of the Dynatrace entities, for example hosts or services, you want to pick up by matching.

managementZoneId integer

The ID of a management zone to which the matched entities must belong.

tags TagInfo[]

The tag you want to use for matching.

You can use custom tags from the UI, AWS tags, Cloud Foundry tags, OpenShift/Kubernetes, and tags based on environment variables.

tagCombination string

The logic that applies when several tags are specified: AND/OR.

If not set then the OR logic is used.

The TagInfo object

Tag of a Dynatrace entity.

Element Type Description
context string

The origin of the tag, such as AWS or Cloud Foundry.

Custom tags use the CONTEXTLESS value.

key string

The key of the tag.

Custom tags have the tag value here.

value string

The value of the tag.

Not applicable to custom tags.

The ConfigurationMetadata object

Metadata useful for debugging

Element Type Description
configurationVersions integer[]

A Sorted list of the version numbers of the configuration.

clusterVersion string

Dynatrace server version.

Example

In this example, the request inquires about the properties of the infrastructure maintenance maintenance window, which has the ID 0b989446-e56f-4837-a521-96f4d39a9b76.

The configuration has the following settings:

GET example

The API token is passed in the Authorization header.

Curl

curl -X GET \
https://mySampleEnv.live.dynatrace.com/api/config/v1/maintenanceWindows/0b989446-e56f-4837-a521-96f4d39a9b76 \
  -H 'Authorization: Api-token abcdefjhij1234567890'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/maintenanceWindows/0b989446-e56f-4837-a521-96f4d39a9b76

Response body

{
  "metadata": {
    "configurationVersions": [
      0
    ],
    "clusterVersion": "1.175.0.20190731-075319"
  },
  "id": "0b989446-e56f-4837-a521-96f4d39a9b76",
  "name": "infrastructure maintenance",
  "description": "Monthly check-up of infrastructure",
  "type": "PLANNED",
  "suppression": "DETECT_PROBLEMS_DONT_ALERT",
  "scope": {
    "entities": [],
    "matches": [
      {
        "type": "HOST",
        "managementZoneId": null,
        "tags": [
          {
            "context": "CONTEXTLESS",
            "key": "InfWindows"
          },
          {
            "context": "CONTEXTLESS",
            "key": "InfLinux"
          }
        ],
        "tagCombination": "OR"
      }
    ]
  },
  "schedule": {
    "recurrenceType": "MONTHLY",
    "recurrence": {
      "dayOfWeek": null,
      "dayOfMonth": 31,
      "startTime": "19:00",
      "durationMinutes": 60
    },
    "start": "2019-07-01 00:00",
    "end": "2020-07-31 23:59",
    "zoneId": "Europe/Vienna"
  }
}

Response code

200