An execution module that interacts with the Datadog API
datadog Python module
Note
The following parameters are required for all functions:
The datadog API key
The datadog application key
Full argument reference is available on the Datadog API reference page https://docs.datadoghq.com/api/
Cancel a downtime by id or by scope.
CLI Example:
salt-call datadog.cancel_downtime scope='host:app01' \
api_key='0123456789' \
app_key='9876543210'`
Arguments - Either scope or id is required.
id -- The downtime ID
scope -- The downtime scope
Post an event to the Datadog stream.
CLI Example
salt-call datadog.post_event api_key='0123456789' \
app_key='9876543210' \
title='Salt Highstate' \
text="Salt highstate was run on $(salt-call grains.get id)" \
tags='["service:salt", "event:highstate"]'
Required arguments
title -- The event title. Limited to 100 characters.
text -- The body of the event. Limited to 4000 characters. The text supports markdown.
Optional arguments
date_happened -- POSIX timestamp of the event.
priority -- The priority of the event ('normal' or 'low').
host -- Host name to associate with the event.
tags -- A list of tags to apply to the event.
alert_type -- "error", "warning", "info" or "success".
aggregation_key -- An arbitrary string to use for aggregation, max length of 100 characters.
source_type_name -- The type of event being posted.
Schedule downtime for a scope of monitors.
CLI Example:
salt-call datadog.schedule_downtime 'host:app2' \
stop=$(date --date='30 minutes' +%s) \
app_key='0123456789' \
api_key='9876543210'
Optional arguments
monitor_id -- The ID of the monitor
start -- Start time in seconds since the epoch
end -- End time in seconds since the epoch
message -- A message to send in a notification for this downtime
recurrence -- Repeat this downtime periodically
timezone -- Specify the timezone