- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
다운타임을 이용하면 알림에서 제외할 범위를 전역으로 확장할 수 있기 때문에 알림을 모니터링할 때 제어할 수 있는 범위가 더 넓어집니다. 다운타임 설정에서 시작과 종료 시간을 정할 수 있어 Datadog 태그로 지정된 특정 알림을 예방할 수 있습니다.
GET https://api.ap1.datadoghq.com/api/v1/downtimehttps://api.datadoghq.eu/api/v1/downtimehttps://api.ddog-gov.com/api/v1/downtimehttps://api.datadoghq.com/api/v1/downtimehttps://api.us3.datadoghq.com/api/v1/downtimehttps://api.us5.datadoghq.com/api/v1/downtime
Get all scheduled downtimes. Note: This endpoint has been deprecated. Please use v2 endpoints.
This endpoint requires the monitors_read
permission.
OAuth apps require the monitors_read
authorization scope to access this endpoint.
이름
유형
설명
current_only
boolean
Only return downtimes that are active when the request is made.
with_creator
boolean
Return creator information.
OK
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"active": true,
"active_child": {
"active": true,
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1626,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
},
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1625,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Get all downtimes returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
const params: v1.DowntimesApiListDowntimesRequest = {
withCreator: true,
};
apiInstance
.listDowntimes(params)
.then((data: v1.Downtime[]) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/downtimehttps://api.datadoghq.eu/api/v2/downtimehttps://api.ddog-gov.com/api/v2/downtimehttps://api.datadoghq.com/api/v2/downtimehttps://api.us3.datadoghq.com/api/v2/downtimehttps://api.us5.datadoghq.com/api/v2/downtime
Get all scheduled downtimes.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
current_only
boolean
Only return downtimes that are active when the request is made.
include
string
Comma-separated list of resource paths for related resources to include in the response. Supported resource
paths are created_by
and monitor
.
page[offset]
integer
Specific offset to use as the beginning of the returned page.
page[limit]
integer
Maximum number of downtimes in the response.
OK
Response for retrieving all downtimes.
항목
유형
설명
data
[object]
An array of downtimes.
attributes
object
Downtime details.
canceled
date-time
Time that the downtime was canceled.
created
date-time
Creation time of the downtime.
display_timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications. This is not used as an offset for scheduling.
default: UTC
message
string
A message to include with notifications for this downtime. Email notifications can be sent to specific users
by using the same @username
notation as events.
modified
date-time
Time that the downtime was last modified.
monitor_identifier
<oneOf>
Monitor identifier for the downtime.
Option 1
object
Object of the monitor identifier.
monitor_id [required]
int64
ID of the monitor to prevent notifications.
Option 2
object
Object of the monitor tags.
monitor_tags [required]
[string]
A list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags
to [*]
configures the downtime to mute all monitors for the given scope.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States that will trigger a monitor notification when the notify_end_types
action occurs.
notify_end_types
[string]
Actions that will trigger a monitor notification if the downtime is in the notify_end_types
state.
schedule
<oneOf>
The schedule that defines when the monitor starts, stops, and recurs. There are two types of schedules: one-time and recurring. Recurring schedules may have up to five RRULE-based recurrences. If no schedules are provided, the downtime will begin immediately and never end.
Option 1
object
A recurring downtime schedule definition.
current_downtime
object
The most recent actual start and end dates for a recurring downtime. For a canceled downtime, this is the previously occurring downtime. For active downtimes, this is the ongoing downtime, and for scheduled downtimes it is the upcoming downtime.
end
date-time
The end of the current downtime.
start
date-time
The start of the current downtime.
recurrences [required]
[object]
A list of downtime recurrences.
duration
string
The length of the downtime. Must begin with an integer and end with one of 'm', 'h', d', or 'w'.
rrule
string
The RRULE
standard for defining recurring events.
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide.
start
string
ISO-8601 Datetime to start the downtime. Must not include a UTC offset. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to schedule the downtime. This affects recurring start and end dates.
Must match display_timezone
.
default: UTC
Option 2
object
A one-time downtime definition.
end
date-time
ISO-8601 Datetime to end the downtime.
start [required]
date-time
ISO-8601 Datetime to start the downtime.
status
enum
The current status of the downtime.
Allowed enum values: active,canceled,ended,scheduled
id
string
The downtime ID.
relationships
object
All relationships associated with downtime.
created_by
object
The user who created the downtime.
data
object
Data for the user who created the downtime.
id
string
User ID of the downtime creator.
type
enum
Users resource type.
Allowed enum values: users
default: users
monitor
object
The monitor identified by the downtime.
data
object
Data for the monitor.
id
string
Monitor ID of the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
type
enum
Downtime resource type.
Allowed enum values: downtime
default: downtime
included
[ <oneOf>]
Array of objects related to the downtimes.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Information about the monitor identified by the downtime.
attributes
object
Attributes of the monitor identified by the downtime.
name
string
The name of the monitor identified by the downtime.
id
int64
ID of the monitor identified by the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
meta
object
Pagination metadata returned by the API.
page
object
Object containing the total filtered count.
total_filtered_count
int64
Total count of elements matched by the filter.
{
"data": [
{
"attributes": {
"canceled": "2020-01-02T03:04:05.282979+0000",
"created": "2020-01-02T03:04:05.282979+0000",
"display_timezone": "America/New_York",
"message": "Message about the downtime",
"modified": "2020-01-02T03:04:05.282979+0000",
"monitor_identifier": {
"monitor_id": 123
},
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"schedule": {
"current_downtime": {
"end": "2020-01-02T03:04:00.000Z",
"start": "2020-01-02T03:04:00.000Z"
},
"recurrences": [
{
"duration": "123d",
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"start": "2020-01-02T03:04"
}
],
"timezone": "America/New_York"
},
"scope": "env:(staging OR prod) AND datacenter:us-east-1",
"status": "active"
},
"id": "00000000-0000-1234-0000-000000000000",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-1234-0000-000000000000",
"type": "users"
}
},
"monitor": {
"data": {
"id": "12345",
"type": "monitors"
}
}
},
"type": "downtime"
}
],
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
],
"meta": {
"page": {
"total_filtered_count": "integer"
}
}
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
/**
* Get all downtimes returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);
apiInstance
.listDowntimes()
.then((data: v2.ListDowntimesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v1/downtimehttps://api.datadoghq.eu/api/v1/downtimehttps://api.ddog-gov.com/api/v1/downtimehttps://api.datadoghq.com/api/v1/downtimehttps://api.us3.datadoghq.com/api/v1/downtimehttps://api.us5.datadoghq.com/api/v1/downtime
Schedule a downtime. Note: This endpoint has been deprecated. Please use v2 endpoints.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
Schedule a downtime request body.
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"message": "Example-Downtime",
"recurrence": {
"period": 1,
"type": "years"
},
"scope": [
"*"
],
"start": 1636629071,
"end": 1636632671,
"timezone": "Etc/UTC",
"mute_first_recovery_notification": true,
"monitor_tags": [
"tag0"
],
"notify_end_states": [
"alert",
"warn"
],
"notify_end_types": [
"expired"
]
}
{
"message": "Example-Downtime",
"start": 1636629071,
"end": 1636632671,
"timezone": "Etc/UTC",
"scope": [
"test:exampledowntime"
],
"recurrence": {
"type": "weeks",
"period": 1,
"week_days": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"until_date": 1638443471
},
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
]
}
{
"message": "Example-Downtime",
"recurrence": {
"period": 1,
"type": "weeks",
"until_date": 1638443471,
"week_days": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
]
},
"scope": [
"*"
],
"start": 1636629071,
"end": 1636632671,
"timezone": "Etc/UTC",
"mute_first_recovery_notification": true,
"monitor_tags": [
"tag0"
],
"notify_end_states": [
"alert"
],
"notify_end_types": [
"canceled"
]
}
OK
Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"active": true,
"active_child": {
"active": true,
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1626,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
},
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1625,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Schedule a downtime once a year
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
const params: v1.DowntimesApiCreateDowntimeRequest = {
body: {
message: "Example-Downtime",
recurrence: {
period: 1,
type: "years",
},
scope: ["*"],
start: Math.round(new Date().getTime() / 1000),
end: Math.round(
new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000
),
timezone: "Etc/UTC",
muteFirstRecoveryNotification: true,
monitorTags: ["tag0"],
notifyEndStates: ["alert", "warn"],
notifyEndTypes: ["expired"],
},
};
apiInstance
.createDowntime(params)
.then((data: v1.Downtime) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
/**
* Schedule a downtime returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
const params: v1.DowntimesApiCreateDowntimeRequest = {
body: {
message: "Example-Downtime",
start: Math.round(new Date().getTime() / 1000),
end: Math.round(
new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000
),
timezone: "Etc/UTC",
scope: ["test:exampledowntime"],
recurrence: {
type: "weeks",
period: 1,
weekDays: ["Mon", "Tue", "Wed", "Thu", "Fri"],
untilDate: Math.round(
new Date(new Date().getTime() + 21 * 86400 * 1000).getTime() / 1000
),
},
notifyEndStates: ["alert", "no data", "warn"],
notifyEndTypes: ["canceled", "expired"],
},
};
apiInstance
.createDowntime(params)
.then((data: v1.Downtime) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
/**
* Schedule a downtime until date
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
const params: v1.DowntimesApiCreateDowntimeRequest = {
body: {
message: "Example-Downtime",
recurrence: {
period: 1,
type: "weeks",
untilDate: Math.round(
new Date(new Date().getTime() + 21 * 86400 * 1000).getTime() / 1000
),
weekDays: ["Mon", "Tue", "Wed", "Thu", "Fri"],
},
scope: ["*"],
start: Math.round(new Date().getTime() / 1000),
end: Math.round(
new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000
),
timezone: "Etc/UTC",
muteFirstRecoveryNotification: true,
monitorTags: ["tag0"],
notifyEndStates: ["alert"],
notifyEndTypes: ["canceled"],
},
};
apiInstance
.createDowntime(params)
.then((data: v1.Downtime) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v2/downtimehttps://api.datadoghq.eu/api/v2/downtimehttps://api.ddog-gov.com/api/v2/downtimehttps://api.datadoghq.com/api/v2/downtimehttps://api.us3.datadoghq.com/api/v2/downtimehttps://api.us5.datadoghq.com/api/v2/downtime
Schedule a downtime.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
Schedule a downtime request body.
항목
유형
설명
data [required]
object
Object to create a downtime.
attributes [required]
object
Downtime details.
display_timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications. This is not used as an offset for scheduling.
default: UTC
message
string
A message to include with notifications for this downtime. Email notifications can be sent to specific users
by using the same @username
notation as events.
monitor_identifier [required]
<oneOf>
Monitor identifier for the downtime.
Option 1
object
Object of the monitor identifier.
monitor_id [required]
int64
ID of the monitor to prevent notifications.
Option 2
object
Object of the monitor tags.
monitor_tags [required]
[string]
A list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags
to [*]
configures the downtime to mute all monitors for the given scope.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States that will trigger a monitor notification when the notify_end_types
action occurs.
notify_end_types
[string]
Actions that will trigger a monitor notification if the downtime is in the notify_end_types
state.
schedule
<oneOf>
Schedule for the downtime.
Option 1
object
A recurring downtime schedule definition.
recurrences [required]
[object]
A list of downtime recurrences.
duration [required]
string
The length of the downtime. Must begin with an integer and end with one of 'm', 'h', d', or 'w'.
rrule [required]
string
The RRULE
standard for defining recurring events.
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide.
start
string
ISO-8601 Datetime to start the downtime. Must not include a UTC offset. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to schedule the downtime.
default: UTC
Option 2
object
A one-time downtime definition.
end
date-time
ISO-8601 Datetime to end the downtime. Must include a UTC offset of zero. If not provided, the downtime continues forever.
start
date-time
ISO-8601 Datetime to start the downtime. Must include a UTC offset of zero. If not provided, the downtime starts the moment it is created.
scope [required]
string
The scope to which the downtime applies. Must follow the common search syntax.
type [required]
enum
Downtime resource type.
Allowed enum values: downtime
default: downtime
{
"data": {
"attributes": {
"message": "dark forest",
"monitor_identifier": {
"monitor_tags": [
"cat:hat"
]
},
"scope": "test:exampledowntime",
"schedule": {
"start": null
}
},
"type": "downtime"
}
}
OK
Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.
항목
유형
설명
data
object
Downtime data.
attributes
object
Downtime details.
canceled
date-time
Time that the downtime was canceled.
created
date-time
Creation time of the downtime.
display_timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications. This is not used as an offset for scheduling.
default: UTC
message
string
A message to include with notifications for this downtime. Email notifications can be sent to specific users
by using the same @username
notation as events.
modified
date-time
Time that the downtime was last modified.
monitor_identifier
<oneOf>
Monitor identifier for the downtime.
Option 1
object
Object of the monitor identifier.
monitor_id [required]
int64
ID of the monitor to prevent notifications.
Option 2
object
Object of the monitor tags.
monitor_tags [required]
[string]
A list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags
to [*]
configures the downtime to mute all monitors for the given scope.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States that will trigger a monitor notification when the notify_end_types
action occurs.
notify_end_types
[string]
Actions that will trigger a monitor notification if the downtime is in the notify_end_types
state.
schedule
<oneOf>
The schedule that defines when the monitor starts, stops, and recurs. There are two types of schedules: one-time and recurring. Recurring schedules may have up to five RRULE-based recurrences. If no schedules are provided, the downtime will begin immediately and never end.
Option 1
object
A recurring downtime schedule definition.
current_downtime
object
The most recent actual start and end dates for a recurring downtime. For a canceled downtime, this is the previously occurring downtime. For active downtimes, this is the ongoing downtime, and for scheduled downtimes it is the upcoming downtime.
end
date-time
The end of the current downtime.
start
date-time
The start of the current downtime.
recurrences [required]
[object]
A list of downtime recurrences.
duration
string
The length of the downtime. Must begin with an integer and end with one of 'm', 'h', d', or 'w'.
rrule
string
The RRULE
standard for defining recurring events.
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide.
start
string
ISO-8601 Datetime to start the downtime. Must not include a UTC offset. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to schedule the downtime. This affects recurring start and end dates.
Must match display_timezone
.
default: UTC
Option 2
object
A one-time downtime definition.
end
date-time
ISO-8601 Datetime to end the downtime.
start [required]
date-time
ISO-8601 Datetime to start the downtime.
status
enum
The current status of the downtime.
Allowed enum values: active,canceled,ended,scheduled
id
string
The downtime ID.
relationships
object
All relationships associated with downtime.
created_by
object
The user who created the downtime.
data
object
Data for the user who created the downtime.
id
string
User ID of the downtime creator.
type
enum
Users resource type.
Allowed enum values: users
default: users
monitor
object
The monitor identified by the downtime.
data
object
Data for the monitor.
id
string
Monitor ID of the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
type
enum
Downtime resource type.
Allowed enum values: downtime
default: downtime
included
[ <oneOf>]
Array of objects related to the downtime that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Information about the monitor identified by the downtime.
attributes
object
Attributes of the monitor identified by the downtime.
name
string
The name of the monitor identified by the downtime.
id
int64
ID of the monitor identified by the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
{
"data": {
"attributes": {
"canceled": "2020-01-02T03:04:05.282979+0000",
"created": "2020-01-02T03:04:05.282979+0000",
"display_timezone": "America/New_York",
"message": "Message about the downtime",
"modified": "2020-01-02T03:04:05.282979+0000",
"monitor_identifier": {
"monitor_id": 123
},
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"schedule": {
"current_downtime": {
"end": "2020-01-02T03:04:00.000Z",
"start": "2020-01-02T03:04:00.000Z"
},
"recurrences": [
{
"duration": "123d",
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"start": "2020-01-02T03:04"
}
],
"timezone": "America/New_York"
},
"scope": "env:(staging OR prod) AND datacenter:us-east-1",
"status": "active"
},
"id": "00000000-0000-1234-0000-000000000000",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-1234-0000-000000000000",
"type": "users"
}
},
"monitor": {
"data": {
"id": "12345",
"type": "monitors"
}
}
},
"type": "downtime"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
/**
* Schedule a downtime returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);
const params: v2.DowntimesApiCreateDowntimeRequest = {
body: {
data: {
attributes: {
message: "dark forest",
monitorIdentifier: {
monitorTags: ["cat:hat"],
},
scope: "test:exampledowntime",
schedule: {
start: undefined,
},
},
type: "downtime",
},
},
};
apiInstance
.createDowntime(params)
.then((data: v2.DowntimeResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
POST https://api.ap1.datadoghq.com/api/v1/downtime/cancel/by_scopehttps://api.datadoghq.eu/api/v1/downtime/cancel/by_scopehttps://api.ddog-gov.com/api/v1/downtime/cancel/by_scopehttps://api.datadoghq.com/api/v1/downtime/cancel/by_scopehttps://api.us3.datadoghq.com/api/v1/downtime/cancel/by_scopehttps://api.us5.datadoghq.com/api/v1/downtime/cancel/by_scope
Delete all downtimes that match the scope of X
. Note: This only interacts with Downtimes created using v1 endpoints. This endpoint has been deprecated and will not be replaced. Please use v2 endpoints to find and cancel downtimes.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
Scope to cancel downtimes for.
{
"scope": "string"
}
OK
Object containing array of IDs of canceled downtimes.
{
"cancelled_ids": [
123456789,
123456790
]
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Downtimes not found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Cancel downtimes by scope returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
// there is a valid "downtime" in the system
const DOWNTIME_SCOPE_0 = process.env.DOWNTIME_SCOPE_0 as string;
const params: v1.DowntimesApiCancelDowntimesByScopeRequest = {
body: {
scope: DOWNTIME_SCOPE_0,
},
};
apiInstance
.cancelDowntimesByScope(params)
.then((data: v1.CanceledDowntimesIds) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v1/downtime/{downtime_id}https://api.datadoghq.eu/api/v1/downtime/{downtime_id}https://api.ddog-gov.com/api/v1/downtime/{downtime_id}https://api.datadoghq.com/api/v1/downtime/{downtime_id}https://api.us3.datadoghq.com/api/v1/downtime/{downtime_id}https://api.us5.datadoghq.com/api/v1/downtime/{downtime_id}
Cancel a downtime. Note: This endpoint has been deprecated. Please use v2 endpoints.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
downtime_id [required]
integer
ID of the downtime to cancel.
OK
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Downtime not found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Cancel a downtime returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
// there is a valid "downtime" in the system
const DOWNTIME_ID = parseInt(process.env.DOWNTIME_ID as string);
const params: v1.DowntimesApiCancelDowntimeRequest = {
downtimeId: DOWNTIME_ID,
};
apiInstance
.cancelDowntime(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
DELETE https://api.ap1.datadoghq.com/api/v2/downtime/{downtime_id}https://api.datadoghq.eu/api/v2/downtime/{downtime_id}https://api.ddog-gov.com/api/v2/downtime/{downtime_id}https://api.datadoghq.com/api/v2/downtime/{downtime_id}https://api.us3.datadoghq.com/api/v2/downtime/{downtime_id}https://api.us5.datadoghq.com/api/v2/downtime/{downtime_id}
Cancel a downtime.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
downtime_id [required]
string
ID of the downtime to cancel.
OK
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Downtime not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
/**
* Cancel a downtime returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);
// there is a valid "downtime_v2" in the system
const DOWNTIME_V2_DATA_ID = process.env.DOWNTIME_V2_DATA_ID as string;
const params: v2.DowntimesApiCancelDowntimeRequest = {
downtimeId: DOWNTIME_V2_DATA_ID,
};
apiInstance
.cancelDowntime(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v1/downtime/{downtime_id}https://api.datadoghq.eu/api/v1/downtime/{downtime_id}https://api.ddog-gov.com/api/v1/downtime/{downtime_id}https://api.datadoghq.com/api/v1/downtime/{downtime_id}https://api.us3.datadoghq.com/api/v1/downtime/{downtime_id}https://api.us5.datadoghq.com/api/v1/downtime/{downtime_id}
Get downtime detail by downtime_id
. Note: This endpoint has been deprecated. Please use v2 endpoints.
This endpoint requires the monitors_read
permission.
OAuth apps require the monitors_read
authorization scope to access this endpoint.
이름
유형
설명
downtime_id [required]
integer
ID of the downtime to fetch.
OK
Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"active": true,
"active_child": {
"active": true,
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1626,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
},
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1625,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Downtime not found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Get a downtime returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
// there is a valid "downtime" in the system
const DOWNTIME_ID = parseInt(process.env.DOWNTIME_ID as string);
const params: v1.DowntimesApiGetDowntimeRequest = {
downtimeId: DOWNTIME_ID,
};
apiInstance
.getDowntime(params)
.then((data: v1.Downtime) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/downtime/{downtime_id}https://api.datadoghq.eu/api/v2/downtime/{downtime_id}https://api.ddog-gov.com/api/v2/downtime/{downtime_id}https://api.datadoghq.com/api/v2/downtime/{downtime_id}https://api.us3.datadoghq.com/api/v2/downtime/{downtime_id}https://api.us5.datadoghq.com/api/v2/downtime/{downtime_id}
Get downtime detail by downtime_id
.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
downtime_id [required]
string
ID of the downtime to fetch.
이름
유형
설명
include
string
Comma-separated list of resource paths for related resources to include in the response. Supported resource
paths are created_by
and monitor
.
OK
Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.
항목
유형
설명
data
object
Downtime data.
attributes
object
Downtime details.
canceled
date-time
Time that the downtime was canceled.
created
date-time
Creation time of the downtime.
display_timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications. This is not used as an offset for scheduling.
default: UTC
message
string
A message to include with notifications for this downtime. Email notifications can be sent to specific users
by using the same @username
notation as events.
modified
date-time
Time that the downtime was last modified.
monitor_identifier
<oneOf>
Monitor identifier for the downtime.
Option 1
object
Object of the monitor identifier.
monitor_id [required]
int64
ID of the monitor to prevent notifications.
Option 2
object
Object of the monitor tags.
monitor_tags [required]
[string]
A list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags
to [*]
configures the downtime to mute all monitors for the given scope.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States that will trigger a monitor notification when the notify_end_types
action occurs.
notify_end_types
[string]
Actions that will trigger a monitor notification if the downtime is in the notify_end_types
state.
schedule
<oneOf>
The schedule that defines when the monitor starts, stops, and recurs. There are two types of schedules: one-time and recurring. Recurring schedules may have up to five RRULE-based recurrences. If no schedules are provided, the downtime will begin immediately and never end.
Option 1
object
A recurring downtime schedule definition.
current_downtime
object
The most recent actual start and end dates for a recurring downtime. For a canceled downtime, this is the previously occurring downtime. For active downtimes, this is the ongoing downtime, and for scheduled downtimes it is the upcoming downtime.
end
date-time
The end of the current downtime.
start
date-time
The start of the current downtime.
recurrences [required]
[object]
A list of downtime recurrences.
duration
string
The length of the downtime. Must begin with an integer and end with one of 'm', 'h', d', or 'w'.
rrule
string
The RRULE
standard for defining recurring events.
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide.
start
string
ISO-8601 Datetime to start the downtime. Must not include a UTC offset. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to schedule the downtime. This affects recurring start and end dates.
Must match display_timezone
.
default: UTC
Option 2
object
A one-time downtime definition.
end
date-time
ISO-8601 Datetime to end the downtime.
start [required]
date-time
ISO-8601 Datetime to start the downtime.
status
enum
The current status of the downtime.
Allowed enum values: active,canceled,ended,scheduled
id
string
The downtime ID.
relationships
object
All relationships associated with downtime.
created_by
object
The user who created the downtime.
data
object
Data for the user who created the downtime.
id
string
User ID of the downtime creator.
type
enum
Users resource type.
Allowed enum values: users
default: users
monitor
object
The monitor identified by the downtime.
data
object
Data for the monitor.
id
string
Monitor ID of the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
type
enum
Downtime resource type.
Allowed enum values: downtime
default: downtime
included
[ <oneOf>]
Array of objects related to the downtime that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Information about the monitor identified by the downtime.
attributes
object
Attributes of the monitor identified by the downtime.
name
string
The name of the monitor identified by the downtime.
id
int64
ID of the monitor identified by the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
{
"data": {
"attributes": {
"canceled": "2020-01-02T03:04:05.282979+0000",
"created": "2020-01-02T03:04:05.282979+0000",
"display_timezone": "America/New_York",
"message": "Message about the downtime",
"modified": "2020-01-02T03:04:05.282979+0000",
"monitor_identifier": {
"monitor_id": 123
},
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"schedule": {
"current_downtime": {
"end": "2020-01-02T03:04:00.000Z",
"start": "2020-01-02T03:04:00.000Z"
},
"recurrences": [
{
"duration": "123d",
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"start": "2020-01-02T03:04"
}
],
"timezone": "America/New_York"
},
"scope": "env:(staging OR prod) AND datacenter:us-east-1",
"status": "active"
},
"id": "00000000-0000-1234-0000-000000000000",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-1234-0000-000000000000",
"type": "users"
}
},
"monitor": {
"data": {
"id": "12345",
"type": "monitors"
}
}
},
"type": "downtime"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Not Found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
/**
* Get a downtime returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);
// there is a valid "downtime_v2" in the system
const DOWNTIME_V2_DATA_ID = process.env.DOWNTIME_V2_DATA_ID as string;
const params: v2.DowntimesApiGetDowntimeRequest = {
downtimeId: DOWNTIME_V2_DATA_ID,
};
apiInstance
.getDowntime(params)
.then((data: v2.DowntimeResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PUT https://api.ap1.datadoghq.com/api/v1/downtime/{downtime_id}https://api.datadoghq.eu/api/v1/downtime/{downtime_id}https://api.ddog-gov.com/api/v1/downtime/{downtime_id}https://api.datadoghq.com/api/v1/downtime/{downtime_id}https://api.us3.datadoghq.com/api/v1/downtime/{downtime_id}https://api.us5.datadoghq.com/api/v1/downtime/{downtime_id}
Update a single downtime by downtime_id
. Note: This endpoint has been deprecated. Please use v2 endpoints.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
downtime_id [required]
integer
ID of the downtime to update.
Update a downtime request body.
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"message": "Example-Downtime-updated",
"mute_first_recovery_notification": true,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
]
}
OK
Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"active": true,
"active_child": {
"active": true,
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1626,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
},
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1625,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Forbidden
Error response object.
{
"errors": [
"Bad Request"
]
}
Downtime not found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Update a downtime returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
// there is a valid "downtime" in the system
const DOWNTIME_ID = parseInt(process.env.DOWNTIME_ID as string);
const params: v1.DowntimesApiUpdateDowntimeRequest = {
body: {
message: "Example-Downtime-updated",
muteFirstRecoveryNotification: true,
notifyEndStates: ["alert", "no data", "warn"],
notifyEndTypes: ["canceled", "expired"],
},
downtimeId: DOWNTIME_ID,
};
apiInstance
.updateDowntime(params)
.then((data: v1.Downtime) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
PATCH https://api.ap1.datadoghq.com/api/v2/downtime/{downtime_id}https://api.datadoghq.eu/api/v2/downtime/{downtime_id}https://api.ddog-gov.com/api/v2/downtime/{downtime_id}https://api.datadoghq.com/api/v2/downtime/{downtime_id}https://api.us3.datadoghq.com/api/v2/downtime/{downtime_id}https://api.us5.datadoghq.com/api/v2/downtime/{downtime_id}
Update a downtime by downtime_id
.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
downtime_id [required]
string
ID of the downtime to update.
Update a downtime request body.
항목
유형
설명
data [required]
object
Object to update a downtime.
attributes [required]
object
Attributes of the downtime to update.
display_timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications. This is not used as an offset for scheduling.
default: UTC
message
string
A message to include with notifications for this downtime. Email notifications can be sent to specific users
by using the same @username
notation as events.
monitor_identifier
<oneOf>
Monitor identifier for the downtime.
Option 1
object
Object of the monitor identifier.
monitor_id [required]
int64
ID of the monitor to prevent notifications.
Option 2
object
Object of the monitor tags.
monitor_tags [required]
[string]
A list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags
to [*]
configures the downtime to mute all monitors for the given scope.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States that will trigger a monitor notification when the notify_end_types
action occurs.
notify_end_types
[string]
Actions that will trigger a monitor notification if the downtime is in the notify_end_types
state.
schedule
<oneOf>
Schedule for the downtime.
Option 1
object
A recurring downtime schedule definition.
recurrences
[object]
A list of downtime recurrences.
duration [required]
string
The length of the downtime. Must begin with an integer and end with one of 'm', 'h', d', or 'w'.
rrule [required]
string
The RRULE
standard for defining recurring events.
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide.
start
string
ISO-8601 Datetime to start the downtime. Must not include a UTC offset. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to schedule the downtime.
default: UTC
Option 2
object
A one-time downtime definition.
end
date-time
ISO-8601 Datetime to end the downtime. Must include a UTC offset of zero. If not provided, the downtime continues forever.
start
date-time
ISO-8601 Datetime to start the downtime. Must include a UTC offset of zero. If not provided, the downtime starts the moment it is created.
id [required]
string
ID of this downtime.
type [required]
enum
Downtime resource type.
Allowed enum values: downtime
default: downtime
{
"data": {
"attributes": {
"message": "light speed"
},
"id": "00000000-0000-1234-0000-000000000000",
"type": "downtime"
}
}
OK
Downtiming gives you greater control over monitor notifications by allowing you to globally exclude scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags.
항목
유형
설명
data
object
Downtime data.
attributes
object
Downtime details.
canceled
date-time
Time that the downtime was canceled.
created
date-time
Creation time of the downtime.
display_timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications. This is not used as an offset for scheduling.
default: UTC
message
string
A message to include with notifications for this downtime. Email notifications can be sent to specific users
by using the same @username
notation as events.
modified
date-time
Time that the downtime was last modified.
monitor_identifier
<oneOf>
Monitor identifier for the downtime.
Option 1
object
Object of the monitor identifier.
monitor_id [required]
int64
ID of the monitor to prevent notifications.
Option 2
object
Object of the monitor tags.
monitor_tags [required]
[string]
A list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match all provided monitor tags. Setting monitor_tags
to [*]
configures the downtime to mute all monitors for the given scope.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States that will trigger a monitor notification when the notify_end_types
action occurs.
notify_end_types
[string]
Actions that will trigger a monitor notification if the downtime is in the notify_end_types
state.
schedule
<oneOf>
The schedule that defines when the monitor starts, stops, and recurs. There are two types of schedules: one-time and recurring. Recurring schedules may have up to five RRULE-based recurrences. If no schedules are provided, the downtime will begin immediately and never end.
Option 1
object
A recurring downtime schedule definition.
current_downtime
object
The most recent actual start and end dates for a recurring downtime. For a canceled downtime, this is the previously occurring downtime. For active downtimes, this is the ongoing downtime, and for scheduled downtimes it is the upcoming downtime.
end
date-time
The end of the current downtime.
start
date-time
The start of the current downtime.
recurrences [required]
[object]
A list of downtime recurrences.
duration
string
The length of the downtime. Must begin with an integer and end with one of 'm', 'h', d', or 'w'.
rrule
string
The RRULE
standard for defining recurring events.
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide.
start
string
ISO-8601 Datetime to start the downtime. Must not include a UTC offset. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to schedule the downtime. This affects recurring start and end dates.
Must match display_timezone
.
default: UTC
Option 2
object
A one-time downtime definition.
end
date-time
ISO-8601 Datetime to end the downtime.
start [required]
date-time
ISO-8601 Datetime to start the downtime.
status
enum
The current status of the downtime.
Allowed enum values: active,canceled,ended,scheduled
id
string
The downtime ID.
relationships
object
All relationships associated with downtime.
created_by
object
The user who created the downtime.
data
object
Data for the user who created the downtime.
id
string
User ID of the downtime creator.
type
enum
Users resource type.
Allowed enum values: users
default: users
monitor
object
The monitor identified by the downtime.
data
object
Data for the monitor.
id
string
Monitor ID of the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
type
enum
Downtime resource type.
Allowed enum values: downtime
default: downtime
included
[ <oneOf>]
Array of objects related to the downtime that the user requested.
Option 1
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
Option 2
object
Information about the monitor identified by the downtime.
attributes
object
Attributes of the monitor identified by the downtime.
name
string
The name of the monitor identified by the downtime.
id
int64
ID of the monitor identified by the downtime.
type
enum
Monitor resource type.
Allowed enum values: monitors
default: monitors
{
"data": {
"attributes": {
"canceled": "2020-01-02T03:04:05.282979+0000",
"created": "2020-01-02T03:04:05.282979+0000",
"display_timezone": "America/New_York",
"message": "Message about the downtime",
"modified": "2020-01-02T03:04:05.282979+0000",
"monitor_identifier": {
"monitor_id": 123
},
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"schedule": {
"current_downtime": {
"end": "2020-01-02T03:04:00.000Z",
"start": "2020-01-02T03:04:00.000Z"
},
"recurrences": [
{
"duration": "123d",
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"start": "2020-01-02T03:04"
}
],
"timezone": "America/New_York"
},
"scope": "env:(staging OR prod) AND datacenter:us-east-1",
"status": "active"
},
"id": "00000000-0000-1234-0000-000000000000",
"relationships": {
"created_by": {
"data": {
"id": "00000000-0000-1234-0000-000000000000",
"type": "users"
}
},
"monitor": {
"data": {
"id": "12345",
"type": "monitors"
}
}
},
"type": "downtime"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Forbidden
API error response.
{
"errors": [
"Bad Request"
]
}
Downtime not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
/**
* Update a downtime returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);
// there is a valid "downtime_v2" in the system
const DOWNTIME_V2_DATA_ID = process.env.DOWNTIME_V2_DATA_ID as string;
const params: v2.DowntimesApiUpdateDowntimeRequest = {
body: {
data: {
attributes: {
message: "light speed",
},
id: DOWNTIME_V2_DATA_ID,
type: "downtime",
},
},
downtimeId: DOWNTIME_V2_DATA_ID,
};
apiInstance
.updateDowntime(params)
.then((data: v2.DowntimeResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v1/monitor/{monitor_id}/downtimeshttps://api.datadoghq.eu/api/v1/monitor/{monitor_id}/downtimeshttps://api.ddog-gov.com/api/v1/monitor/{monitor_id}/downtimeshttps://api.datadoghq.com/api/v1/monitor/{monitor_id}/downtimeshttps://api.us3.datadoghq.com/api/v1/monitor/{monitor_id}/downtimeshttps://api.us5.datadoghq.com/api/v1/monitor/{monitor_id}/downtimes
Get all active v1 downtimes for the specified monitor. Note: This endpoint has been deprecated. Please use v2 endpoints.
This endpoint requires the monitors_read
permission.
OAuth apps require the monitors_read
authorization scope to access this endpoint.
이름
유형
설명
monitor_id [required]
integer
The id of the monitor
OK
항목
유형
설명
active
boolean
If a scheduled downtime currently exists.
active_child
object
The downtime object definition of the active child for the original parent recurring downtime. This field will only exist on recurring downtimes.
active
boolean
If a scheduled downtime currently exists.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
canceled
int64
If a scheduled downtime is canceled.
creator_id
int32
User ID of the downtime creator.
disabled
boolean
If a downtime has been disabled.
downtime_type
int32
0
for a downtime applied on *
or all,
1
when the downtime is only scoped to hosts,
or 2
when the downtime is scoped to anything but hosts.
end
int64
POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.
id
int64
The downtime ID.
message
string
A message to include with notifications for this downtime.
Email notifications can be sent to specific users by using the same @username
notation as events.
monitor_id
int64
A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.
monitor_tags
[string]
A comma-separated list of monitor tags. For example, tags that are applied directly to monitors,
not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies.
The resulting downtime applies to monitors that match ALL provided monitor tags.
For example, service:postgres
AND team:frontend
.
mute_first_recovery_notification
boolean
If the first recovery notification during a downtime should be muted.
notify_end_states
[string]
States for which notify_end_types
sends out notifications for.
default: alert,no data,warn
notify_end_types
[string]
If set, notifies if a monitor is in an alert-worthy state (ALERT
, WARNING
, or NO DATA
)
when this downtime expires or is canceled. Applied to monitors that change states during
the downtime (such as from OK
to ALERT
, WARNING
, or NO DATA
), and to monitors that
already have an alert-worthy state when downtime begins.
default: expired
parent_id
int64
ID of the parent Downtime.
recurrence
object
An object defining the recurrence of the downtime.
period
int32
How often to repeat as an integer.
For example, to repeat every 3 days, select a type of days
and a period of 3
.
rrule
string
The RRULE
standard for defining recurring events (requires to set "type" to rrule)
For example, to have a recurring event on the first day of each month, set the type to rrule
and set the FREQ
to MONTHLY
and BYMONTHDAY
to 1
.
Most common rrule
options from the iCalendar Spec are supported.
Note: Attributes specifying the duration in RRULE
are not supported (for example, DTSTART
, DTEND
, DURATION
).
More examples available in this downtime guide
type
string
The type of recurrence. Choose from days
, weeks
, months
, years
, rrule
.
until_date
int64
The date at which the recurrence should end as a POSIX timestamp.
until_occurences
and until_date
are mutually exclusive.
until_occurrences
int32
How many times the downtime is rescheduled.
until_occurences
and until_date
are mutually exclusive.
week_days
[string]
A list of week days to repeat on. Choose from Mon
, Tue
, Wed
, Thu
, Fri
, Sat
or Sun
.
Only applicable when type is weeks. First letter must be capitalized.
scope
[string]
The scope(s) to which the downtime applies and must be in key:value
format. For example, host:app2
.
Provide multiple scopes as a comma-separated list like env:dev,env:prod
.
The resulting downtime applies to sources that matches ALL provided scopes (env:dev
AND env:prod
).
start
int64
POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.
timezone
string
The timezone in which to display the downtime's start and end times in Datadog applications.
updater_id
int32
ID of the last user that updated the downtime.
{
"active": true,
"active_child": {
"active": true,
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1626,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
},
"canceled": 1412799983,
"creator_id": 123456,
"disabled": false,
"downtime_type": 2,
"end": 1412793983,
"id": 1625,
"message": "Message on the downtime",
"monitor_id": 123456,
"monitor_tags": [
"*"
],
"mute_first_recovery_notification": false,
"notify_end_states": [
"alert",
"no data",
"warn"
],
"notify_end_types": [
"canceled",
"expired"
],
"parent_id": 123,
"recurrence": {
"period": 1,
"rrule": "FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1",
"type": "weeks",
"until_date": 1447786293,
"until_occurrences": 2,
"week_days": [
"Mon",
"Tue"
]
},
"scope": [
"env:staging"
],
"start": 1412792983,
"timezone": "America/New_York",
"updater_id": 123456
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Monitor Not Found error
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
/**
* Get active downtimes for a monitor returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DowntimesApi(configuration);
const params: v1.DowntimesApiListMonitorDowntimesRequest = {
monitorId: 9223372036854775807,
};
apiInstance
.listMonitorDowntimes(params)
.then((data: v1.Downtime[]) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
GET https://api.ap1.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matcheshttps://api.datadoghq.eu/api/v2/monitor/{monitor_id}/downtime_matcheshttps://api.ddog-gov.com/api/v2/monitor/{monitor_id}/downtime_matcheshttps://api.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matcheshttps://api.us3.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matcheshttps://api.us5.datadoghq.com/api/v2/monitor/{monitor_id}/downtime_matches
Get all active downtimes for the specified monitor.
This endpoint requires the monitors_downtime
permission.
OAuth apps require the monitors_downtime
authorization scope to access this endpoint.
이름
유형
설명
monitor_id [required]
integer
The id of the monitor.
이름
유형
설명
page[offset]
integer
Specific offset to use as the beginning of the returned page.
page[limit]
integer
Maximum number of downtimes in the response.
OK
Response for retrieving all downtime matches for a monitor.
항목
유형
설명
data
[object]
An array of downtime matches.
attributes
object
Downtime match details.
end
date-time
The end of the downtime.
groups
[string]
An array of groups associated with the downtime.
start
date-time
The start of the downtime.
id
string
The downtime ID.
type
enum
Monitor Downtime Match resource type.
Allowed enum values: downtime_match
default: downtime_match
meta
object
Pagination metadata returned by the API.
page
object
Object containing the total filtered count.
total_filtered_count
int64
Total count of elements matched by the filter.
{
"data": [
{
"attributes": {
"end": "2020-01-02T03:04:00.000Z",
"groups": [
"service:postgres",
"team:frontend"
],
"scope": "env:(staging OR prod) AND datacenter:us-east-1",
"start": "2020-01-02T03:04:00.000Z"
},
"id": "00000000-0000-1234-0000-000000000000",
"type": "downtime_match"
}
],
"meta": {
"page": {
"total_filtered_count": "integer"
}
}
}
Monitor Not Found error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
/**
* Get active downtimes for a monitor returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.DowntimesApi(configuration);
const params: v2.DowntimesApiListMonitorDowntimesRequest = {
monitorId: 35534610,
};
apiInstance
.listMonitorDowntimes(params)
.then((data: v2.MonitorDowntimeMatchResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
First install the library and its dependencies and then save the example to example.ts
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"