-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig_check.py
392 lines (297 loc) · 12.4 KB
/
config_check.py
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor account programmatically. <br> <br> Note: <ul> <li> For Python SDKs, the REQUEST parameters can contain camelCase or an underscore. </li> <li> Both underscore and camelCase are supported if parameters are encapsulated within the body. </li> <li> Only camelCase is supported if parameters are encapsulated within the body and also if the user is passing raw JSON as REQUEST parameter. However, the RESPONSE parameters always contain an underscore. For example, you can use testLocation or test_location in the REQUEST parameter. But the RESPONSE parameter will always be test_location. </li> <li> The fields parameter only supports camelCase. </li> </ul> # noqa: E501
OpenAPI spec version: 3.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ConfigCheck(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'ack_clear_alert': 'bool',
'origin_id': 'str',
'name': 'str',
'alert_level': 'int',
'description': 'str',
'config_source_id': 'int',
'id': 'int',
'type': 'str',
'alert_effective_ival': 'int',
'script': 'object',
'alert_transition_interval': 'int'
}
attribute_map = {
'ack_clear_alert': 'ackClearAlert',
'origin_id': 'originId',
'name': 'name',
'alert_level': 'alertLevel',
'description': 'description',
'config_source_id': 'configSourceId',
'id': 'id',
'type': 'type',
'alert_effective_ival': 'alertEffectiveIval',
'script': 'script',
'alert_transition_interval': 'alertTransitionInterval'
}
def __init__(self, ack_clear_alert=None, origin_id=None, name=None, alert_level=None, description=None, config_source_id=None, id=None, type=None, alert_effective_ival=None, script=None, alert_transition_interval=None): # noqa: E501
"""ConfigCheck - a model defined in Swagger""" # noqa: E501
self._ack_clear_alert = None
self._origin_id = None
self._name = None
self._alert_level = None
self._description = None
self._config_source_id = None
self._id = None
self._type = None
self._alert_effective_ival = None
self._script = None
self._alert_transition_interval = None
self.discriminator = None
if ack_clear_alert is not None:
self.ack_clear_alert = ack_clear_alert
if origin_id is not None:
self.origin_id = origin_id
if name is not None:
self.name = name
if alert_level is not None:
self.alert_level = alert_level
if description is not None:
self.description = description
if config_source_id is not None:
self.config_source_id = config_source_id
if id is not None:
self.id = id
if type is not None:
self.type = type
if alert_effective_ival is not None:
self.alert_effective_ival = alert_effective_ival
if script is not None:
self.script = script
if alert_transition_interval is not None:
self.alert_transition_interval = alert_transition_interval
@property
def ack_clear_alert(self):
"""Gets the ack_clear_alert of this ConfigCheck. # noqa: E501
Clear alert after ACKED or not # noqa: E501
:return: The ack_clear_alert of this ConfigCheck. # noqa: E501
:rtype: bool
"""
return self._ack_clear_alert
@ack_clear_alert.setter
def ack_clear_alert(self, ack_clear_alert):
"""Sets the ack_clear_alert of this ConfigCheck.
Clear alert after ACKED or not # noqa: E501
:param ack_clear_alert: The ack_clear_alert of this ConfigCheck. # noqa: E501
:type: bool
"""
self._ack_clear_alert = ack_clear_alert
@property
def origin_id(self):
"""Gets the origin_id of this ConfigCheck. # noqa: E501
Portable id for origin tracking # noqa: E501
:return: The origin_id of this ConfigCheck. # noqa: E501
:rtype: str
"""
return self._origin_id
@origin_id.setter
def origin_id(self, origin_id):
"""Sets the origin_id of this ConfigCheck.
Portable id for origin tracking # noqa: E501
:param origin_id: The origin_id of this ConfigCheck. # noqa: E501
:type: str
"""
self._origin_id = origin_id
@property
def name(self):
"""Gets the name of this ConfigCheck. # noqa: E501
The ConfigCheck name # noqa: E501
:return: The name of this ConfigCheck. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this ConfigCheck.
The ConfigCheck name # noqa: E501
:param name: The name of this ConfigCheck. # noqa: E501
:type: str
"""
self._name = name
@property
def alert_level(self):
"""Gets the alert_level of this ConfigCheck. # noqa: E501
The triggered alert level if config check failure. The values can be 1|2|3|4 where, 1: no alert, 2: warn alert, 3: error alert, 4: critical alert # noqa: E501
:return: The alert_level of this ConfigCheck. # noqa: E501
:rtype: int
"""
return self._alert_level
@alert_level.setter
def alert_level(self, alert_level):
"""Sets the alert_level of this ConfigCheck.
The triggered alert level if config check failure. The values can be 1|2|3|4 where, 1: no alert, 2: warn alert, 3: error alert, 4: critical alert # noqa: E501
:param alert_level: The alert_level of this ConfigCheck. # noqa: E501
:type: int
"""
self._alert_level = alert_level
@property
def description(self):
"""Gets the description of this ConfigCheck. # noqa: E501
The ConfigCheck description # noqa: E501
:return: The description of this ConfigCheck. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this ConfigCheck.
The ConfigCheck description # noqa: E501
:param description: The description of this ConfigCheck. # noqa: E501
:type: str
"""
self._description = description
@property
def config_source_id(self):
"""Gets the config_source_id of this ConfigCheck. # noqa: E501
The ConfigSource id # noqa: E501
:return: The config_source_id of this ConfigCheck. # noqa: E501
:rtype: int
"""
return self._config_source_id
@config_source_id.setter
def config_source_id(self, config_source_id):
"""Sets the config_source_id of this ConfigCheck.
The ConfigSource id # noqa: E501
:param config_source_id: The config_source_id of this ConfigCheck. # noqa: E501
:type: int
"""
self._config_source_id = config_source_id
@property
def id(self):
"""Gets the id of this ConfigCheck. # noqa: E501
The ConfigCheck id # noqa: E501
:return: The id of this ConfigCheck. # noqa: E501
:rtype: int
"""
return self._id
@id.setter
def id(self, id):
"""Sets the id of this ConfigCheck.
The ConfigCheck id # noqa: E501
:param id: The id of this ConfigCheck. # noqa: E501
:type: int
"""
self._id = id
@property
def type(self):
"""Gets the type of this ConfigCheck. # noqa: E501
The ConfigCheck type. The values can be fetch|ignore|missing|value|groovy # noqa: E501
:return: The type of this ConfigCheck. # noqa: E501
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this ConfigCheck.
The ConfigCheck type. The values can be fetch|ignore|missing|value|groovy # noqa: E501
:param type: The type of this ConfigCheck. # noqa: E501
:type: str
"""
self._type = type
@property
def alert_effective_ival(self):
"""Gets the alert_effective_ival of this ConfigCheck. # noqa: E501
Alert effective interval # noqa: E501
:return: The alert_effective_ival of this ConfigCheck. # noqa: E501
:rtype: int
"""
return self._alert_effective_ival
@alert_effective_ival.setter
def alert_effective_ival(self, alert_effective_ival):
"""Sets the alert_effective_ival of this ConfigCheck.
Alert effective interval # noqa: E501
:param alert_effective_ival: The alert_effective_ival of this ConfigCheck. # noqa: E501
:type: int
"""
self._alert_effective_ival = alert_effective_ival
@property
def script(self):
"""Gets the script of this ConfigCheck. # noqa: E501
The ConfigCheck script # noqa: E501
:return: The script of this ConfigCheck. # noqa: E501
:rtype: object
"""
return self._script
@script.setter
def script(self, script):
"""Sets the script of this ConfigCheck.
The ConfigCheck script # noqa: E501
:param script: The script of this ConfigCheck. # noqa: E501
:type: object
"""
self._script = script
@property
def alert_transition_interval(self):
"""Gets the alert_transition_interval of this ConfigCheck. # noqa: E501
The count that the alert must exist for these many poll cycles before it will be triggered # noqa: E501
:return: The alert_transition_interval of this ConfigCheck. # noqa: E501
:rtype: int
"""
return self._alert_transition_interval
@alert_transition_interval.setter
def alert_transition_interval(self, alert_transition_interval):
"""Sets the alert_transition_interval of this ConfigCheck.
The count that the alert must exist for these many poll cycles before it will be triggered # noqa: E501
:param alert_transition_interval: The alert_transition_interval of this ConfigCheck. # noqa: E501
:type: int
"""
self._alert_transition_interval = alert_transition_interval
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(ConfigCheck, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ConfigCheck):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other