Skip to content

Commit

Permalink
Merge pull request #6595 from DataDog/pb/mon-del-force
Browse files Browse the repository at this point in the history
[api] [monitors] Add option for force delete.
  • Loading branch information
Pierre Guceski authored Feb 7, 2020
2 parents 3328b64 + ad2b6bd commit 9f9c4c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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}"
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).

0 comments on commit 9f9c4c2

Please sign in to comment.