Skip to content

datadog schedule-downtime

Schedule a downtime

Description

Schedule a downtime

Synopsis

datadog schedule-downtime
    [--site <site>]
    [--disabled]
    [--end <end>]
    [--message <message>]
    [--id <id>]
    [--tags <tags>]
    [--mute_first_recovery_notification]
    [--parent <parent>]
    [--period <period>]
    [--rrule <rrule>]
    [--type <type>]
    [--until <until>]
    [--occurrences <occurrences>]
    [--days <days>]
    [--scope <scope>]
    [--start <start>]
    [--timezone <timezone>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

disabled - (bool)

     If a downtime has been disabled
     Example: --disabled
     Default: _None_      Attributes: optional

end - (time)

     time to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it
     Example: --end "2019-10-12T07:20:50.52Z"
     Default: _None_      Attributes: optional

message - (string)

     A message to include with notifications for this downtime
     Example: --message "message-1"
     Default: _None_      Attributes: optional

id - (int)

     A single monitor to which the downtime applies. defaults to all monitors
     Example: --id 1
     Default: _None_      Attributes: optional

tags - (string)

     Monitor tags. The resulting downtime applies to monitors that match ALL provided monitor tags
     Example: --tags "tags-1"
     Default: _None_      Attributes: optional, multiple allowed

mute_first_recovery_notification - (bool)

     If the first recovery notification during a downtime should be muted
     Example: --mute_first_recovery_notification
     Default: _None_      Attributes: optional

parent - (int)

     ID of the parent Downtime
     Example: --parent 1
     Default: _None_      Attributes: optional

period - (int)

     How often to repeat(days) as an integer
     Example: --period 1
     Default: _None_      Attributes: optional

rrule - (string)

     The RRULE standard for defining recurring events (requires to set "type" to rrule) Most common rrule options from the iCalendar Spec are supported
     Example: --rrule "rrule-1"
     Default: _None_      Attributes: optional

type - (string)

     The type of recurrence
     Example: --type "type-1"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: days, weeks, months, years, rrule

until - (time)

     The date at which the recurrence should end as a POSIX timestamp. occurences and until are mutually exclusive
     Example: --until "2019-10-12T07:20:50.52Z"
     Default: _None_      Attributes: optional

occurrences - (int)

     How many times the downtime is rescheduled. occurences and until are mutually exclusive
     Example: --occurrences 1
     Default: _None_      Attributes: optional

days - (string)

     A list of week days to repeat on
     Example: --days "days-1"
     Default: _None_      Attributes: optional, multiple allowed

     Validation:
         allowed values: Mon, Tue, Wed, Thu, Fri, Sat, Sun

scope - (string)

     The scope(s) to which the downtime applies
     Example: --scope "scope-1"
     Default: _None_      Attributes: optional, multiple allowed

     Validation:
         allowed values: dev, prod

start - (time)

     time to start the downtime. If not provided, the downtime starts the moment it is created
     Example: --start "2019-10-12T07:20:50.52Z"
     Default: _None_      Attributes: optional

timezone - (string)

     The timezone in which to display the downtime's start and end times in Datadog applications
     Example: --timezone "timezone-1"
     Default: _None_      Attributes: optional

Examples

Input:

!datadog schedule-downtime --message "downtime" --period 1 --type "months" --scope "dev" --start 1673449200 --end 1673452800 --mute_first_recovery_notification 
Output:
{"id":4051477,"monitor_id":null,"org_id":1300017267,"scope":["env:dev"],"start":1673449200,"end":1673452800,"canceled":null,"created":1673427210,"modified":1673427210,"message":"downtime","active":false,"disabled":false,"recurrence":{"type":"months","period":1,"week_days":null,"until_occurrences":null,"until_date":null},"timezone":"UTC","parent_id":null,"child_id":null,"creator_id":58810,"updater_id":null,"downtime_type":2,"monitor_tags":["*"],"mute_first_recovery_notification":true}

Access Control

To use this command, you need access to the following:

Field Value
Action "create"
Service Type "datadog"
Service Instance
Namespace
Object Type "downtime"
Object ID

Please see Access Control for details.