The data object for a Synthetics downtime create or update request.
attributes [required]
object
Attributes for creating or updating a Synthetics downtime.
description
string
An optional description of the downtime.
isEnabled [required]
boolean
Whether the downtime is enabled.
name [required]
string
The name of the downtime.
tags
[string]
List of tags associated with a Synthetics downtime.
testIds [required]
[string]
List of Synthetics test public IDs associated with a downtime.
timeSlots [required]
[object]
List of time slots for a Synthetics downtime create or update request.
duration [required]
int64
The duration of the time slot in seconds, between 60 and 604800.
name
string
An optional label for the time slot.
recurrence
object
Recurrence settings for a Synthetics downtime time slot.
end
object
A specific date and time used to define the start or end of a Synthetics downtime time slot.
day [required]
int64
The day component of the date (1-31).
hour [required]
int64
The hour component of the time (0-23).
minute [required]
int64
The minute component of the time (0-59).
month [required]
int64
The month component of the date (1-12).
year [required]
int64
The year component of the date.
frequency [required]
enum
The recurrence frequency of a Synthetics downtime time slot.
Allowed enum values: DAILY,WEEKLY,MONTHLY,YEARLY
interval
int64
The interval between recurrences, relative to the frequency.
weekdayPositions
[integer]
Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with weekdays to schedule occurrences such as "the first Monday of the month".
weekdays
[string]
Days of the week for a Synthetics downtime recurrence schedule.
start [required]
object
A specific date and time used to define the start or end of a Synthetics downtime time slot.
day [required]
int64
The day component of the date (1-31).
hour [required]
int64
The hour component of the time (0-23).
minute [required]
int64
The minute component of the time (0-59).
month [required]
int64
The month component of the date (1-12).
year [required]
int64
The year component of the date.
timezone [required]
string
The IANA timezone name for the time slot.
type [required]
enum
The resource type for a Synthetics downtime.
Allowed enum values: downtime
Attributes of a Synthetics downtime response object.
createdAt [required]
date-time
The timestamp when the downtime was created.
createdBy [required]
string
The UUID of the user who created the downtime.
createdByName [required]
string
The display name of the user who created the downtime.
description [required]
string
The description of the downtime.
isEnabled [required]
boolean
Whether the downtime is enabled.
name [required]
string
The name of the downtime.
tags [required]
[string]
List of tags associated with a Synthetics downtime.
testIds [required]
[string]
List of Synthetics test public IDs associated with a downtime.
timeSlots [required]
[object]
List of time slots in a Synthetics downtime response.
duration [required]
int64
The duration of the time slot in seconds.
id [required]
string
The unique identifier of the time slot.
name
string
The label for the time slot.
recurrence
object
Recurrence settings returned in a Synthetics downtime time slot response.
frequency [required]
enum
The recurrence frequency of a Synthetics downtime time slot.
Allowed enum values: DAILY,WEEKLY,MONTHLY,YEARLY
interval [required]
int64
The interval between recurrences, relative to the frequency.
until
object
A specific date and time used to define the start or end of a Synthetics downtime time slot.
day [required]
int64
The day component of the date (1-31).
hour [required]
int64
The hour component of the time (0-23).
minute [required]
int64
The minute component of the time (0-59).
month [required]
int64
The month component of the date (1-12).
year [required]
int64
The year component of the date.
weekdayPositions
[integer]
Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with weekdays to schedule occurrences such as "the first Monday of the month".
weekdays [required]
[string]
Days of the week for a Synthetics downtime recurrence schedule.
start [required]
object
A specific date and time used to define the start or end of a Synthetics downtime time slot.
day [required]
int64
The day component of the date (1-31).
hour [required]
int64
The hour component of the time (0-23).
minute [required]
int64
The minute component of the time (0-59).
month [required]
int64
The month component of the date (1-12).
year [required]
int64
The year component of the date.
timezone [required]
string
The IANA timezone name for the time slot.
updatedAt [required]
date-time
The timestamp when the downtime was last updated.
updatedBy [required]
string
The UUID of the user who last updated the downtime.
updatedByName [required]
string
The display name of the user who last updated the downtime.
id [required]
string
The unique identifier of the downtime.
type [required]
enum
The resource type for a Synthetics downtime.
Allowed enum values: downtime
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a Synthetics downtime returns "Created" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.SyntheticsApi(configuration);constparams: v2.SyntheticsApiCreateSyntheticsDowntimeRequest={body:{data:{attributes:{isEnabled: true,name:"Weekly maintenance",testIds:["abc-def-123"],timeSlots:[{duration: 3600,start:{day: 15,hour: 10,minute: 30,month: 1,year: 2024,},timezone:"Europe/Paris",},],},type:"downtime",},},};apiInstance.createSyntheticsDowntime(params).then((data: v2.SyntheticsDowntimeResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));