Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api] [monitors] Add option for force delete. #6595

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions content/en/api/monitors/code_snippets/api-monitor-delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

# Delete a monitor
api.Monitor.delete(2081)

# Force delete a monitor to override warnings
api.Monitor.delete(2081, force=True)
3 changes: 3 additions & 0 deletions content/en/api/monitors/code_snippets/api-monitor-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ monitor_id=<YOUR_MONITOR_ID>

# Delete a monitor
curl -X DELETE "https://api.datadoghq.com/api/v1/monitor/${monitor_id}?api_key=${api_key}&application_key=${app_key}"

# Force delete a monitor
curl -X DELETE "https://api.datadoghq.com/api/v1/monitor/${monitor_id}?force=true&api_key=${api_key}&application_key=${app_key}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missing new line

6 changes: 5 additions & 1 deletion content/en/api/monitors/monitors_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ external_redirect: /api/#delete-a-monitor

**ARGUMENTS**:

This endpoint takes no JSON arguments.
If a monitor is used elsewhere, this endpoint returns an error because the monitor is referenced.

* **`force`** [*optional*, *default*=**False**]:

Boolean: Force delete the monitor. The monitor is deleted even if it's referenced by other resources (e.g. SLO, composite monitor).