forked from DataDog/datadogpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity_monitoring_rules.py
More file actions
93 lines (74 loc) · 2.63 KB
/
Copy pathsecurity_monitoring_rules.py
File metadata and controls
93 lines (74 loc) · 2.63 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 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
"""
Security Monitoring Rule API.
"""
from datadog.api.resources import (
GetableAPIResource,
CreateableAPIResource,
ListableAPIResource,
UpdatableAPIResource,
DeletableAPIResource,
ActionAPIResource,
)
class SecurityMonitoringRule(
GetableAPIResource,
CreateableAPIResource,
ListableAPIResource,
UpdatableAPIResource,
DeletableAPIResource,
ActionAPIResource,
):
"""
A wrapper around Security Monitoring Rule API.
"""
_resource_name = "security_monitoring/rules"
_api_version = "v2"
@classmethod
def get_all(cls, **params):
"""
Get all security monitoring rules.
:param params: additional parameters to filter security monitoring rules
:type params: dict
:returns: Dictionary representing the API's JSON response
"""
return super(SecurityMonitoringRule, cls).get_all(**params)
@classmethod
def get(cls, rule_id, **params):
"""
Get a security monitoring rule's details.
:param rule_id: ID of the security monitoring rule
:type rule_id: str
:returns: Dictionary representing the API's JSON response
"""
return super(SecurityMonitoringRule, cls).get(rule_id, **params)
@classmethod
def create(cls, **params):
"""
Create a security monitoring rule.
:param params: Parameters to create the security monitoring rule with
:type params: dict
:returns: Dictionary representing the API's JSON response
"""
return super(SecurityMonitoringRule, cls).create(**params)
@classmethod
def update(cls, rule_id, **params):
"""
Update a security monitoring rule.
:param rule_id: ID of the security monitoring rule to update
:type rule_id: str
:param params: Parameters to update the security monitoring rule with
:type params: dict
:returns: Dictionary representing the API's JSON response
"""
return super(SecurityMonitoringRule, cls).update(rule_id, **params)
@classmethod
def delete(cls, rule_id, **params):
"""
Delete a security monitoring rule.
:param rule_id: ID of the security monitoring rule to delete
:type rule_id: str
:returns: Dictionary representing the API's JSON response
"""
return super(SecurityMonitoringRule, cls).delete(rule_id, **params)