Maintenance windows environment API
This API is deprecated. Use the Settings API with the Maintenance windows (builtin:alerting.maintenance-window
) schema instead.
Dynatrace uses maintenance windows to ensure accurate monitoring data during planned maintenance of your systems.
The Maintenance windows API enables you to use 3rd party tools to manage maintenance windows and downtimes within a monitored environment. You can:
- Get all the maintenance windows in your environment with the GET all maintenance windows call.
- Create or update a maintenance window with the POST a maintenance window call.
- List the details of a specific maintenance window with the GET a maintenance window call.
- Delete a specific maintenance window with the DELETE a maintenance window call.
GET all maintenance windows
Lists all maintenance windows (and their parameters) available in your Dynatrace environment.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/maintenance |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v1/maintenance | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/maintenance |
Authentication
To execute this request, you need an access token with MaintenanceWindows
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
from | integer | The start timestamp of the inquiry timeframe, in UTC milliseconds. If not set, the current time is used. | query | optional |
to | integer | The end timestamp of the inquiry timeframe, in UTC milliseconds. If not set, all maintenance windows beginning after the | query | optional |
type | string | The type of the maintenance window to return. If
| query | optional |
The returns an array of such objects, each representing a maintenance window.
Response codes
Code | Type | Description |
---|---|---|
200 | MaintenanceWindow[] | Success |
Response body objects
The ResponseBody
object
The MaintenanceWindow
object
Parameters of the maintenance window.
Element | Type | Description |
---|---|---|
description | string | A short description of the maintenance purpose. |
id | string | The ID of the maintenance window. |
schedule | MaintenanceWindowSchedule | An object defining date, time, and recurrence of the maintenance window. |
scope | MaintenanceWindowScope | An object defining the scope of your maintenance window. You can specify particular Dynatrace entities or matching rules for dynamic formation of the scope. If no scope is specified, the maintenance applies to the entire environment. To specify the scope at least one entity or matching rule must be specified. |
suppressAlerts | boolean | Alerting during maintenance is enabled ( |
suppressProblems | boolean | Problem detection during maintenance is enabled ( |
type | string | The type of the maintenance: planned or unplanned.
|
The MaintenanceWindowSchedule
object
An object defining date, time, and recurrence of the maintenance window.
Element | Type | Description |
---|---|---|
maintenanceEnd | string | The end date and time of the maintenance window in the |
maintenanceStart | string | The start date and time of the maintenance window in the |
recurrence | MaintenanceWindowRecurrence | The recurrence of the maintenance window. |
timezoneId | string | The time zone of the start and end time. Default time zone is UTC. You can user either UTC offset |
type | string | Recurrence of the schedule.
|
The MaintenanceWindowRecurrence
object
The recurrence of the maintenance window.
Element | Type | Description |
---|---|---|
day | string | The day of the week for weekly maintenance. The format is the full name of the day in upper case, for example
|
dayOfMonth | integer | The day of the month for monthly maintenance. |
duration | integer | The duration of the maintenance window in minutes. |
start | string | The start time of the maintenance window. The format is |
The MaintenanceWindowScope
object
An object defining the scope of your maintenance window.
You can specify particular Dynatrace entities or matching rules for dynamic formation of the scope.
If no scope is specified, the maintenance applies to the entire environment.
To specify the scope at least one entity or matching rule must be specified.
Element | Type | Description |
---|---|---|
entities | string[] | Defines Dynatrace entities to be included in scope, for example hosts, services, process groups. Allowed values are Dynatrace entity IDs. |
matches | MonitoredEntityFilter[] | An object defining a matching rule for dynamic scope formation. An empty rule matches for all entities. |
The MonitoredEntityFilter
object
Filters monitored entities by their type/tags.
Element | Type | Description |
---|---|---|
tags | UniversalTag[] | 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. |
type | string | The type of the Dynatrace entities (for example, hosts or services) you want to pick up by matching.
|
The UniversalTag
object
Element | Type | Description |
---|---|---|
context | string | The origin of the tag, such as AWS or Cloud Foundry. For custom tags use the The context is set for tags that are automatically imported by OneAgent (for example, from the AWS console or environment variables). It’s useful for determining the origin of tags when not manually defined, and it also helps to prevent clashes with other existing tags. If the tag is not automatically imported,
|
key | string | The key of the tag. For custom tags, put the tag value here. The key allows categorization of multiple tags. It is possible that there are multiple values for a single key which will all be represented as standalone tags. Therefore, the key does not have the semantic of a map key but is more like a key of a key-value tuple. In some cases, for example custom tags, the key represents the actual tag value and the value field is not set – those are called valueless tags. |
tagKey | UniversalTagKey | - |
value | string | The value of the tag. Not applicable to custom tags. If a tag does have a separate key and value (in the textual representation they are split by the colon ‘:’), this field is set with the actual value. Key-value pairs can occur for automatically imported tags and tags set by rules if extractors are used. |
The UniversalTagKey
object
Element | Type | Description |
---|---|---|
context | string | -
|
key | string | - |
Response body JSON model
1[2 {3 "description": "string",4 "id": "string",5 "schedule": {6 "maintenanceEnd": "string",7 "maintenanceStart": "string",8 "recurrence": {9 "day": "FRIDAY",10 "dayOfMonth": 1,11 "duration": 1,12 "start": "string"13 },14 "timezoneId": "string",15 "type": "Day"16 },17 "scope": {18 "entities": [19 "string"20 ],21 "matches": [22 {23 "tags": [24 {25 "context": "AWS",26 "key": "string",27 "tagKey": {28 "context": "AWS",29 "key": "string"30 },31 "value": "string"32 }33 ],34 "type": "APM_SECURITY_GATEWAY"35 }36 ]37 },38 "suppressAlerts": true,39 "suppressProblems": true,40 "type": "Planned"41 }42]
In this example, the request queries all maintenance windows of the mySampleEnv
environment.
Curl
1curl -L -H "Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890" \2"https://mySampleEnv.live.dynatrace.com/api/v1/maintenance"
Request URL
1GET https://mySampleEnv.live.dynatrace.com/api/v1/maintenance?api-token=abcdefjhij1234567890
Response content
1[2 {3 "id": "easyTravelDeployment",4 "type": "Planned",5 "description": "Monthly deployment of easyTravel update",6 "suppressAlerts": true,7 "suppressProblems": false,8 "scope": {9 "entities": [10 "HOST-8CA800CE840E20E8"11 ],12 "matches": [13 {14 "type": "PROCESS_GROUP",15 "tags": [16 {17 "context": "CONTEXTLESS",18 "key": "easyTravel"19 }20 ]21 }22 ]23 },24 "schedule": {25 "type": "Month",26 "timezoneId": "Europe/Vienna",27 "maintenanceStart": "2018-05-01 00:00",28 "maintenanceEnd": "2018-10-01 00:00",29 "recurrence": {30 "dayOfMonth": 8,31 "start": "01:00",32 "duration": 9033 }34 }35 },36 {37 "id": "Planned maintenance works",38 "type": "Planned",39 "description": "",40 "suppressAlerts": true,41 "suppressProblems": true,42 "scope": null,43 "schedule": {44 "type": "Once",45 "timezoneId": "UTC",46 "maintenanceStart": "2018-05-13 10:00",47 "maintenanceEnd": "2018-10-01 12:00"48 }49 }50]
Response code
200
POST a maintenance window
Creates or updates a maintenance window.
The request consumes an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/maintenance |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v1/maintenance | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/maintenance |
Authentication
To execute this request, you need an access token with MaintenanceWindows
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | MaintenanceWindow | Parameters of the maintenance window. | body | optional |
Request body objects
The MaintenanceWindow
object
Parameters of the maintenance window.
Element | Type | Description | Required |
---|---|---|---|
description | string | A short description of the maintenance purpose. | optional |
id | string | The ID of the maintenance window. | optional |
schedule | MaintenanceWindowSchedule | An object defining date, time, and recurrence of the maintenance window. | required |
scope | MaintenanceWindowScope | An object defining the scope of your maintenance window. You can specify particular Dynatrace entities or matching rules for dynamic formation of the scope. If no scope is specified, the maintenance applies to the entire environment. To specify the scope at least one entity or matching rule must be specified. | optional |
suppressAlerts | boolean | Alerting during maintenance is enabled ( | optional |
suppressProblems | boolean | Problem detection during maintenance is enabled ( | optional |
type | string | The type of the maintenance: planned or unplanned.
| required |
The MaintenanceWindowSchedule
object
An object defining date, time, and recurrence of the maintenance window.
Element | Type | Description | Required |
---|---|---|---|
maintenanceEnd | string | The end date and time of the maintenance window in the | required |
maintenanceStart | string | The start date and time of the maintenance window in the | required |
recurrence | MaintenanceWindowRecurrence | The recurrence of the maintenance window. | optional |
timezoneId | string | The time zone of the start and end time. Default time zone is UTC. You can user either UTC offset | optional |
type | string | Recurrence of the schedule.
| required |
The MaintenanceWindowRecurrence
object
The recurrence of the maintenance window.
Element | Type | Description | Required |
---|---|---|---|
day | string | The day of the week for weekly maintenance. The format is the full name of the day in upper case, for example
| optional |
dayOfMonth | integer | The day of the month for monthly maintenance. | optional |
duration | integer | The duration of the maintenance window in minutes. | required |
start | string | The start time of the maintenance window. The format is | required |
The MaintenanceWindowScope
object
An object defining the scope of your maintenance window.
You can specify particular Dynatrace entities or matching rules for dynamic formation of the scope.
If no scope is specified, the maintenance applies to the entire environment.
To specify the scope at least one entity or matching rule must be specified.
Element | Type | Description | Required |
---|---|---|---|
entities | string[] | Defines Dynatrace entities to be included in scope, for example hosts, services, process groups. Allowed values are Dynatrace entity IDs. | optional |
matches | MonitoredEntityFilter[] | An object defining a matching rule for dynamic scope formation. An empty rule matches for all entities. | optional |
The MonitoredEntityFilter
object
Filters monitored entities by their type/tags.
Element | Type | Description | Required |
---|---|---|---|
tags | UniversalTag[] | 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. | optional |
type | string | The type of the Dynatrace entities (for example, hosts or services) you want to pick up by matching.
| optional |
The UniversalTag
object
Element | Type | Description | Required |
---|---|---|---|
context | string | The origin of the tag, such as AWS or Cloud Foundry. For custom tags use the The context is set for tags that are automatically imported by OneAgent (for example, from the AWS console or environment variables). It’s useful for determining the origin of tags when not manually defined, and it also helps to prevent clashes with other existing tags. If the tag is not automatically imported,
| optional |
key | string | The key of the tag. For custom tags, put the tag value here. The key allows categorization of multiple tags. It is possible that there are multiple values for a single key which will all be represented as standalone tags. Therefore, the key does not have the semantic of a map key but is more like a key of a key-value tuple. In some cases, for example custom tags, the key represents the actual tag value and the value field is not set – those are called valueless tags. | required |
tagKey | UniversalTagKey | - | optional |
value | string | The value of the tag. Not applicable to custom tags. If a tag does have a separate key and value (in the textual representation they are split by the colon ‘:’), this field is set with the actual value. Key-value pairs can occur for automatically imported tags and tags set by rules if extractors are used. | optional |
The UniversalTagKey
object
Element | Type | Description | Required |
---|---|---|---|
context | string | -
| optional |
key | string | - | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
1{2 "description": "string",3 "id": "string",4 "schedule": {5 "maintenanceEnd": "string",6 "maintenanceStart": "string",7 "recurrence": {8 "day": "FRIDAY",9 "dayOfMonth": 1,10 "duration": 1,11 "start": "string"12 },13 "timezoneId": "string",14 "type": "Day"15 },16 "scope": {17 "entities": [18 "string"19 ],20 "matches": [21 {22 "tags": [23 {24 "context": "AWS",25 "key": "string",26 "tagKey": {27 "context": "AWS",28 "key": "string"29 },30 "value": "string"31 }32 ],33 "type": "APM_SECURITY_GATEWAY"34 }35 ]36 },37 "suppressAlerts": true,38 "suppressProblems": true,39 "type": "Planned"40}
A successful request doesn't return any content.
In this example, the request creates the planned easyTravelDeployment
maintenance window, which happens every 8th day of month between 01:00 and 02:30 am. It applies to host entity HOST-1A2B3C4E5F6G7H8I
and all process groups that have the easyTravel
tag. During the maintenance window, problems are detected but alerts are not triggered.
Curl
1curl -L -H "Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890" \2-H "Content-Type: application/json" \3"https://mySampleEnv.live.dynatrace.com/api/v1/maintenance" \4-d "{\"id\":\"easyTravelDeployment\",\"type\":\"Planned\",\"description\":\"Monthly deployment of easyTravel update\",\"suppressAlerts\":true,\"suppressProblems\":false,\"scope\":{\"entities\":[\"HOST-1A2B3C4E5F6G7H8I\"],\"matches\":[{\"type\":\"PROCESS_GROUP\",\"tags\":[{\"context\":\"CONTEXTLESS\",\"key\":\"easyTravel\"}]}]},\"schedule\":{\"type\":\"Month\",\"timezoneId\":\"Europe/Vienna\",\"maintenanceStart\":\"2018-05-0100:00\",\"maintenanceEnd\":\"2018-10-0100:00\",\"recurrence\":{\"dayOfMonth\":8,\"start\":\"01:00\",\"duration\":90}}}";
Request URL
1POST https://mySampleEnv.live.dynatrace.com/api/v1/maintenance
Request body
1{2 "id": "easyTravelDeployment",3 "type": "Planned",4 "description": "Monthly deployment of easyTravel update",5 "suppressAlerts": true,6 "suppressProblems": false,7 "scope": {8 "entities": [9 "HOST-1A2B3C4E5F6G7H8I"10 ],11 "matches": [12 {13 "type": "PROCESS_GROUP",14 "tags": [15 {16 "context": "CONTEXTLESS",17 "key": "easyTravel"18 }19 ]20 }21 ]22 },23 "schedule": {24 "type": "Month",25 "timezoneId": "Europe/Vienna",26 "maintenanceStart": "2018-05-01 00:00",27 "maintenanceEnd": "2018-10-01 00:00",28 "recurrence": {29 "dayOfMonth": 8,30 "start": "01:00",31 "duration": 9032 }33 }34}
Response code
204
GET a maintenance window
Lists all parameters of a maintenance window. You can also get the list of all maintenance windows (and their parameters) available in your Dynatrace environment.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/maintenance/{uid} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v1/maintenance/{uid} | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/maintenance/{uid} |
Authentication
To execute this request, you need an access token with MaintenanceWindows
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
uid | string | The ID of the required maintenance window. | path | required |
The request for a particular maintenance window returns a JSON object containing all parameters of the maintenance window.
The request for all available maintenance windows returns an array of such objects.
Response codes
Code | Type | Description |
---|---|---|
200 | MaintenanceWindow | Success |
Response body objects
The MaintenanceWindow
object
Parameters of the maintenance window.
Element | Type | Description |
---|---|---|
description | string | A short description of the maintenance purpose. |
id | string | The ID of the maintenance window. |
schedule | MaintenanceWindowSchedule | An object defining date, time, and recurrence of the maintenance window. |
scope | MaintenanceWindowScope | An object defining the scope of your maintenance window. You can specify particular Dynatrace entities or matching rules for dynamic formation of the scope. If no scope is specified, the maintenance applies to the entire environment. To specify the scope at least one entity or matching rule must be specified. |
suppressAlerts | boolean | Alerting during maintenance is enabled ( |
suppressProblems | boolean | Problem detection during maintenance is enabled ( |
type | string | The type of the maintenance: planned or unplanned.
|
The MaintenanceWindowSchedule
object
An object defining date, time, and recurrence of the maintenance window.
Element | Type | Description |
---|---|---|
maintenanceEnd | string | The end date and time of the maintenance window in the |
maintenanceStart | string | The start date and time of the maintenance window in the |
recurrence | MaintenanceWindowRecurrence | The recurrence of the maintenance window. |
timezoneId | string | The time zone of the start and end time. Default time zone is UTC. You can user either UTC offset |
type | string | Recurrence of the schedule.
|
The MaintenanceWindowRecurrence
object
The recurrence of the maintenance window.
Element | Type | Description |
---|---|---|
day | string | The day of the week for weekly maintenance. The format is the full name of the day in upper case, for example
|
dayOfMonth | integer | The day of the month for monthly maintenance. |
duration | integer | The duration of the maintenance window in minutes. |
start | string | The start time of the maintenance window. The format is |
The MaintenanceWindowScope
object
An object defining the scope of your maintenance window.
You can specify particular Dynatrace entities or matching rules for dynamic formation of the scope.
If no scope is specified, the maintenance applies to the entire environment.
To specify the scope at least one entity or matching rule must be specified.
Element | Type | Description |
---|---|---|
entities | string[] | Defines Dynatrace entities to be included in scope, for example hosts, services, process groups. Allowed values are Dynatrace entity IDs. |
matches | MonitoredEntityFilter[] | An object defining a matching rule for dynamic scope formation. An empty rule matches for all entities. |
The MonitoredEntityFilter
object
Filters monitored entities by their type/tags.
Element | Type | Description |
---|---|---|
tags | UniversalTag[] | 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. |
type | string | The type of the Dynatrace entities (for example, hosts or services) you want to pick up by matching.
|
The UniversalTag
object
Element | Type | Description |
---|---|---|
context | string | The origin of the tag, such as AWS or Cloud Foundry. For custom tags use the The context is set for tags that are automatically imported by OneAgent (for example, from the AWS console or environment variables). It’s useful for determining the origin of tags when not manually defined, and it also helps to prevent clashes with other existing tags. If the tag is not automatically imported,
|
key | string | The key of the tag. For custom tags, put the tag value here. The key allows categorization of multiple tags. It is possible that there are multiple values for a single key which will all be represented as standalone tags. Therefore, the key does not have the semantic of a map key but is more like a key of a key-value tuple. In some cases, for example custom tags, the key represents the actual tag value and the value field is not set – those are called valueless tags. |
tagKey | UniversalTagKey | - |
value | string | The value of the tag. Not applicable to custom tags. If a tag does have a separate key and value (in the textual representation they are split by the colon ‘:’), this field is set with the actual value. Key-value pairs can occur for automatically imported tags and tags set by rules if extractors are used. |
The UniversalTagKey
object
Element | Type | Description |
---|---|---|
context | string | -
|
key | string | - |
Response body JSON model
1{2 "description": "string",3 "id": "string",4 "schedule": {5 "maintenanceEnd": "string",6 "maintenanceStart": "string",7 "recurrence": {8 "day": "FRIDAY",9 "dayOfMonth": 1,10 "duration": 1,11 "start": "string"12 },13 "timezoneId": "string",14 "type": "Day"15 },16 "scope": {17 "entities": [18 "string"19 ],20 "matches": [21 {22 "tags": [23 {24 "context": "AWS",25 "key": "string",26 "tagKey": {27 "context": "AWS",28 "key": "string"29 },30 "value": "string"31 }32 ],33 "type": "APM_SECURITY_GATEWAY"34 }35 ]36 },37 "suppressAlerts": true,38 "suppressProblems": true,39 "type": "Planned"40}
In this example, the request queries
Curl
Request URL
Response content
Response code
DELETE a maintenance window
Deletes the specified maintenance window. Deletion can't be undone.
DELETE | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v1/maintenance/{uid} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v1/maintenance/{uid} | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/maintenance/{uid} |
Authentication
To execute this request, you need an access token with MaintenanceWindows
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
uid | string | The ID of the maintenance window to delete. | path | required |
A successful request doesn't return any content.
In this example, the request deletes the easyTravelDeployment
maintenance window.
Curl
1curl -X DELETE "Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890" \2"https://mySampleEnv.live.dynatrace.com/api/v1/maintenance/easyTravelDeployment" \
Request URL
1DELETE https://mySampleEnv.live.dynatrace.com/api/v1/maintenance/easyTravelDeployment?api-token=abcdefjhij1234567890
Response code
204