forked from DataDog/datadogpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdowntimes.py
More file actions
38 lines (32 loc) · 1.05 KB
/
downtimes.py
File metadata and controls
38 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2015-Present Datadog, Inc
from datadog.api.resources import (
GetableAPIResource,
CreateableAPIResource,
UpdatableAPIResource,
ListableAPIResource,
DeletableAPIResource,
ActionAPIResource,
)
class Downtime(
GetableAPIResource,
CreateableAPIResource,
UpdatableAPIResource,
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)