-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MA-669] Add support for
/v1/downtime/cancel/by_scope
. (#488)
* [MA-669] Add support for `/v1/downtime/cancel/by_scope`. * Add back the `show_all_parser` for `datadog/dogshell/downtime.py`. * [MA-669] Add tests for the `cancel_downtime_by_scope` functionality. * [MA-669] Verify downtime is still `disabled=False` if not canceled.
- Loading branch information
1 parent
3d2df7d
commit 9da1e45
Showing
4 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
from datadog.api.resources import GetableAPIResource, CreateableAPIResource,\ | ||
UpdatableAPIResource, ListableAPIResource, DeletableAPIResource | ||
UpdatableAPIResource, ListableAPIResource, DeletableAPIResource, \ | ||
ActionAPIResource | ||
|
||
|
||
class Downtime(GetableAPIResource, CreateableAPIResource, UpdatableAPIResource, | ||
ListableAPIResource, DeletableAPIResource): | ||
ListableAPIResource, DeletableAPIResource, ActionAPIResource): | ||
""" | ||
A wrapper around Monitor Downtiming HTTP API. | ||
""" | ||
_resource_name = 'downtime' | ||
|
||
@classmethod | ||
def cancel_downtime_by_scope(cls, **body): | ||
""" | ||
Cancels all downtimes matching the scope. | ||
:param scope: scope to cancel downtimes by | ||
:type scope: string | ||
:returns: Dictionary representing the API's JSON response | ||
""" | ||
return super(Downtime, cls)._trigger_class_action('POST', 'cancel/by_scope', **body) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters