-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathmonitor_update_request.py
More file actions
201 lines (173 loc) · 7.95 KB
/
monitor_update_request.py
File metadata and controls
201 lines (173 loc) · 7.95 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations
from typing import List, Union, TYPE_CHECKING
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
datetime,
none_type,
unset,
UnsetType,
)
if TYPE_CHECKING:
from datadog_api_client.v1.model.creator import Creator
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
from datadog_api_client.v1.model.monitor_options import MonitorOptions
from datadog_api_client.v1.model.monitor_overall_states import MonitorOverallStates
from datadog_api_client.v1.model.monitor_state import MonitorState
from datadog_api_client.v1.model.monitor_type import MonitorType
class MonitorUpdateRequest(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.creator import Creator
from datadog_api_client.v1.model.monitor_draft_status import MonitorDraftStatus
from datadog_api_client.v1.model.monitor_options import MonitorOptions
from datadog_api_client.v1.model.monitor_overall_states import MonitorOverallStates
from datadog_api_client.v1.model.monitor_state import MonitorState
from datadog_api_client.v1.model.monitor_type import MonitorType
return {
"created": (datetime,),
"creator": (Creator,),
"deleted": (datetime, none_type),
"draft_status": (MonitorDraftStatus,),
"id": (int,),
"message": (str,),
"modified": (datetime,),
"multi": (bool,),
"name": (str,),
"options": (MonitorOptions,),
"overall_state": (MonitorOverallStates,),
"priority": (int, none_type),
"query": (str,),
"restricted_roles": ([str], none_type),
"state": (MonitorState,),
"tags": ([str],),
"type": (MonitorType,),
}
attribute_map = {
"created": "created",
"creator": "creator",
"deleted": "deleted",
"draft_status": "draft_status",
"id": "id",
"message": "message",
"modified": "modified",
"multi": "multi",
"name": "name",
"options": "options",
"overall_state": "overall_state",
"priority": "priority",
"query": "query",
"restricted_roles": "restricted_roles",
"state": "state",
"tags": "tags",
"type": "type",
}
read_only_vars = {
"created",
"creator",
"deleted",
"id",
"modified",
"multi",
"overall_state",
"state",
}
def __init__(
self_,
created: Union[datetime, UnsetType] = unset,
creator: Union[Creator, UnsetType] = unset,
deleted: Union[datetime, none_type, UnsetType] = unset,
draft_status: Union[MonitorDraftStatus, UnsetType] = unset,
id: Union[int, UnsetType] = unset,
message: Union[str, UnsetType] = unset,
modified: Union[datetime, UnsetType] = unset,
multi: Union[bool, UnsetType] = unset,
name: Union[str, UnsetType] = unset,
options: Union[MonitorOptions, UnsetType] = unset,
overall_state: Union[MonitorOverallStates, UnsetType] = unset,
priority: Union[int, none_type, UnsetType] = unset,
query: Union[str, UnsetType] = unset,
restricted_roles: Union[List[str], none_type, UnsetType] = unset,
state: Union[MonitorState, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
type: Union[MonitorType, UnsetType] = unset,
**kwargs,
):
"""
Object describing a monitor update request.
:param created: Timestamp of the monitor creation.
:type created: datetime, optional
:param creator: Object describing the creator of the shared element.
:type creator: Creator, optional
:param deleted: Whether or not the monitor is deleted. (Always ``null`` )
:type deleted: datetime, none_type, optional
:param draft_status: Indicates whether the monitor is in a draft or published state.
``draft`` : The monitor appears as Draft and does not send notifications.
``published`` : The monitor is active and evaluates conditions and notify as configured.
This field is in preview. The draft value is only available to customers with the feature enabled.
:type draft_status: MonitorDraftStatus, optional
:param id: ID of this monitor.
:type id: int, optional
:param message: A message to include with notifications for this monitor.
:type message: str, optional
:param modified: Last timestamp when the monitor was edited.
:type modified: datetime, optional
:param multi: Whether or not the monitor is broken down on different groups.
:type multi: bool, optional
:param name: The monitor name.
:type name: str, optional
:param options: List of options associated with your monitor.
:type options: MonitorOptions, optional
:param overall_state: The different states your monitor can be in.
:type overall_state: MonitorOverallStates, optional
:param priority: Integer from 1 (high) to 5 (low) indicating alert severity.
:type priority: int, none_type, optional
:param query: The monitor query.
:type query: str, optional
:param restricted_roles: A list of unique role identifiers to define which roles are allowed to edit the monitor. The unique identifiers for all roles can be pulled from the `Roles API <https://docs.datadoghq.com/api/latest/roles/#list-roles>`_ and are located in the ``data.id`` field. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. You can use the `Restriction Policies API <https://docs.datadoghq.com/api/latest/restriction-policies/>`_ to manage write authorization for individual monitors by teams and users, in addition to roles.
:type restricted_roles: [str], none_type, optional
:param state: Wrapper object with the different monitor states.
:type state: MonitorState, optional
:param tags: Tags associated to your monitor.
:type tags: [str], optional
:param type: The type of the monitor. For more information about ``type`` , see the `monitor options <https://docs.datadoghq.com/monitors/guide/monitor_api_options/>`_ docs.
:type type: MonitorType, optional
"""
if created is not unset:
kwargs["created"] = created
if creator is not unset:
kwargs["creator"] = creator
if deleted is not unset:
kwargs["deleted"] = deleted
if draft_status is not unset:
kwargs["draft_status"] = draft_status
if id is not unset:
kwargs["id"] = id
if message is not unset:
kwargs["message"] = message
if modified is not unset:
kwargs["modified"] = modified
if multi is not unset:
kwargs["multi"] = multi
if name is not unset:
kwargs["name"] = name
if options is not unset:
kwargs["options"] = options
if overall_state is not unset:
kwargs["overall_state"] = overall_state
if priority is not unset:
kwargs["priority"] = priority
if query is not unset:
kwargs["query"] = query
if restricted_roles is not unset:
kwargs["restricted_roles"] = restricted_roles
if state is not unset:
kwargs["state"] = state
if tags is not unset:
kwargs["tags"] = tags
if type is not unset:
kwargs["type"] = type
super().__init__(kwargs)