gsctl 0.29.0a20250114__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. graphscope/flex/rest/__init__.py +106 -0
  2. graphscope/flex/rest/api/__init__.py +12 -0
  3. graphscope/flex/rest/api/alert_api.py +2790 -0
  4. graphscope/flex/rest/api/data_source_api.py +1177 -0
  5. graphscope/flex/rest/api/deployment_api.py +1323 -0
  6. graphscope/flex/rest/api/graph_api.py +2813 -0
  7. graphscope/flex/rest/api/job_api.py +1408 -0
  8. graphscope/flex/rest/api/service_api.py +1316 -0
  9. graphscope/flex/rest/api/stored_procedure_api.py +1454 -0
  10. graphscope/flex/rest/api/utils_api.py +310 -0
  11. graphscope/flex/rest/api_client.py +789 -0
  12. graphscope/flex/rest/api_response.py +21 -0
  13. graphscope/flex/rest/configuration.py +451 -0
  14. graphscope/flex/rest/exceptions.py +200 -0
  15. graphscope/flex/rest/models/__init__.py +82 -0
  16. graphscope/flex/rest/models/base_edge_type.py +102 -0
  17. graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py +108 -0
  18. graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py +98 -0
  19. graphscope/flex/rest/models/base_property_meta.py +105 -0
  20. graphscope/flex/rest/models/base_vertex_type.py +96 -0
  21. graphscope/flex/rest/models/base_vertex_type_x_csr_params.py +88 -0
  22. graphscope/flex/rest/models/column_mapping.py +94 -0
  23. graphscope/flex/rest/models/column_mapping_column.py +90 -0
  24. graphscope/flex/rest/models/create_alert_receiver_request.py +103 -0
  25. graphscope/flex/rest/models/create_alert_rule_request.py +112 -0
  26. graphscope/flex/rest/models/create_dataloading_job_response.py +88 -0
  27. graphscope/flex/rest/models/create_edge_type.py +114 -0
  28. graphscope/flex/rest/models/create_graph_request.py +106 -0
  29. graphscope/flex/rest/models/create_graph_response.py +88 -0
  30. graphscope/flex/rest/models/create_graph_schema_request.py +106 -0
  31. graphscope/flex/rest/models/create_property_meta.py +105 -0
  32. graphscope/flex/rest/models/create_stored_proc_request.py +101 -0
  33. graphscope/flex/rest/models/create_stored_proc_response.py +88 -0
  34. graphscope/flex/rest/models/create_vertex_type.py +108 -0
  35. graphscope/flex/rest/models/dataloading_job_config.py +136 -0
  36. graphscope/flex/rest/models/dataloading_job_config_edges_inner.py +92 -0
  37. graphscope/flex/rest/models/dataloading_job_config_loading_config.py +104 -0
  38. graphscope/flex/rest/models/dataloading_job_config_loading_config_format.py +90 -0
  39. graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py +88 -0
  40. graphscope/flex/rest/models/dataloading_mr_job_config.py +88 -0
  41. graphscope/flex/rest/models/date_type.py +88 -0
  42. graphscope/flex/rest/models/edge_mapping.py +122 -0
  43. graphscope/flex/rest/models/edge_mapping_type_triplet.py +92 -0
  44. graphscope/flex/rest/models/error.py +90 -0
  45. graphscope/flex/rest/models/get_alert_message_response.py +123 -0
  46. graphscope/flex/rest/models/get_alert_receiver_response.py +107 -0
  47. graphscope/flex/rest/models/get_alert_rule_response.py +114 -0
  48. graphscope/flex/rest/models/get_edge_type.py +116 -0
  49. graphscope/flex/rest/models/get_graph_response.py +139 -0
  50. graphscope/flex/rest/models/get_graph_schema_response.py +106 -0
  51. graphscope/flex/rest/models/get_pod_log_response.py +88 -0
  52. graphscope/flex/rest/models/get_property_meta.py +107 -0
  53. graphscope/flex/rest/models/get_resource_usage_response.py +105 -0
  54. graphscope/flex/rest/models/get_storage_usage_response.py +88 -0
  55. graphscope/flex/rest/models/get_stored_proc_response.py +130 -0
  56. graphscope/flex/rest/models/get_vertex_type.py +110 -0
  57. graphscope/flex/rest/models/gs_data_type.py +152 -0
  58. graphscope/flex/rest/models/job_status.py +107 -0
  59. graphscope/flex/rest/models/long_text.py +93 -0
  60. graphscope/flex/rest/models/node_status.py +94 -0
  61. graphscope/flex/rest/models/parameter.py +96 -0
  62. graphscope/flex/rest/models/pod_status.py +108 -0
  63. graphscope/flex/rest/models/primitive_type.py +95 -0
  64. graphscope/flex/rest/models/resource_usage.py +92 -0
  65. graphscope/flex/rest/models/running_deployment_info.py +128 -0
  66. graphscope/flex/rest/models/running_deployment_status.py +124 -0
  67. graphscope/flex/rest/models/schema_mapping.py +106 -0
  68. graphscope/flex/rest/models/service_status.py +112 -0
  69. graphscope/flex/rest/models/service_status_sdk_endpoints.py +94 -0
  70. graphscope/flex/rest/models/start_service_request.py +88 -0
  71. graphscope/flex/rest/models/stored_procedure_meta.py +126 -0
  72. graphscope/flex/rest/models/string_type.py +92 -0
  73. graphscope/flex/rest/models/string_type_string.py +124 -0
  74. graphscope/flex/rest/models/temporal_type.py +92 -0
  75. graphscope/flex/rest/models/temporal_type_temporal.py +138 -0
  76. graphscope/flex/rest/models/time_stamp_type.py +88 -0
  77. graphscope/flex/rest/models/update_alert_message_status_request.py +97 -0
  78. graphscope/flex/rest/models/update_stored_proc_request.py +88 -0
  79. graphscope/flex/rest/models/upload_file_response.py +90 -0
  80. graphscope/flex/rest/models/vertex_mapping.py +100 -0
  81. graphscope/flex/rest/py.typed +0 -0
  82. graphscope/flex/rest/rest.py +258 -0
  83. graphscope/gsctl/V6D_VERSION +1 -0
  84. graphscope/gsctl/VERSION +1 -0
  85. graphscope/gsctl/__init__.py +22 -0
  86. graphscope/gsctl/commands/__init__.py +148 -0
  87. graphscope/gsctl/commands/common.py +200 -0
  88. graphscope/gsctl/commands/dev.py +448 -0
  89. graphscope/gsctl/commands/insight/__init__.py +17 -0
  90. graphscope/gsctl/commands/insight/glob.py +234 -0
  91. graphscope/gsctl/commands/insight/graph.py +205 -0
  92. graphscope/gsctl/commands/interactive/__init__.py +17 -0
  93. graphscope/gsctl/commands/interactive/glob.py +280 -0
  94. graphscope/gsctl/commands/interactive/graph.py +259 -0
  95. graphscope/gsctl/config.py +221 -0
  96. graphscope/gsctl/gsctl.py +51 -0
  97. graphscope/gsctl/impl/__init__.py +64 -0
  98. graphscope/gsctl/impl/alert.py +135 -0
  99. graphscope/gsctl/impl/common.py +53 -0
  100. graphscope/gsctl/impl/datasource.py +80 -0
  101. graphscope/gsctl/impl/deployment.py +62 -0
  102. graphscope/gsctl/impl/graph.py +150 -0
  103. graphscope/gsctl/impl/job.py +63 -0
  104. graphscope/gsctl/impl/service.py +62 -0
  105. graphscope/gsctl/impl/stored_procedure.py +92 -0
  106. graphscope/gsctl/impl/utils.py +38 -0
  107. graphscope/gsctl/scripts/install_deps.sh +969 -0
  108. graphscope/gsctl/tests/__init__.py +17 -0
  109. graphscope/gsctl/tests/test_graphscope_insight.py +401 -0
  110. graphscope/gsctl/tests/test_interactive.py +516 -0
  111. graphscope/gsctl/utils.py +337 -0
  112. graphscope/gsctl/version.py +31 -0
  113. gsctl-0.29.0a20250114.dist-info/METADATA +20 -0
  114. gsctl-0.29.0a20250114.dist-info/RECORD +117 -0
  115. gsctl-0.29.0a20250114.dist-info/WHEEL +6 -0
  116. gsctl-0.29.0a20250114.dist-info/entry_points.txt +3 -0
  117. gsctl-0.29.0a20250114.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2790 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ GraphScope FLEX HTTP SERVICE API
5
+
6
+ This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: graphscope@alibaba-inc.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictInt, StrictStr, field_validator
21
+ from typing import List, Optional
22
+ from typing_extensions import Annotated
23
+ from graphscope.flex.rest.models.create_alert_receiver_request import CreateAlertReceiverRequest
24
+ from graphscope.flex.rest.models.create_alert_rule_request import CreateAlertRuleRequest
25
+ from graphscope.flex.rest.models.get_alert_message_response import GetAlertMessageResponse
26
+ from graphscope.flex.rest.models.get_alert_receiver_response import GetAlertReceiverResponse
27
+ from graphscope.flex.rest.models.get_alert_rule_response import GetAlertRuleResponse
28
+ from graphscope.flex.rest.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest
29
+
30
+ from graphscope.flex.rest.api_client import ApiClient, RequestSerialized
31
+ from graphscope.flex.rest.api_response import ApiResponse
32
+ from graphscope.flex.rest.rest import RESTResponseType
33
+
34
+
35
+ class AlertApi:
36
+ """NOTE: This class is auto generated by OpenAPI Generator
37
+ Ref: https://openapi-generator.tech
38
+
39
+ Do not edit the class manually.
40
+ """
41
+
42
+ def __init__(self, api_client=None) -> None:
43
+ if api_client is None:
44
+ api_client = ApiClient.get_default()
45
+ self.api_client = api_client
46
+
47
+
48
+ @validate_call
49
+ def create_alert_receiver(
50
+ self,
51
+ create_alert_receiver_request: CreateAlertReceiverRequest,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> str:
65
+ """create_alert_receiver
66
+
67
+ Create a new alert receiver
68
+
69
+ :param create_alert_receiver_request: (required)
70
+ :type create_alert_receiver_request: CreateAlertReceiverRequest
71
+ :param _request_timeout: timeout setting for this request. If one
72
+ number provided, it will be total request
73
+ timeout. It can also be a pair (tuple) of
74
+ (connection, read) timeouts.
75
+ :type _request_timeout: int, tuple(int, int), optional
76
+ :param _request_auth: set to override the auth_settings for an a single
77
+ request; this effectively ignores the
78
+ authentication in the spec for a single request.
79
+ :type _request_auth: dict, optional
80
+ :param _content_type: force content-type for the request.
81
+ :type _content_type: str, Optional
82
+ :param _headers: set to override the headers for a single
83
+ request; this effectively ignores the headers
84
+ in the spec for a single request.
85
+ :type _headers: dict, optional
86
+ :param _host_index: set to override the host_index for a single
87
+ request; this effectively ignores the host_index
88
+ in the spec for a single request.
89
+ :type _host_index: int, optional
90
+ :return: Returns the result object.
91
+ """ # noqa: E501
92
+
93
+ _param = self._create_alert_receiver_serialize(
94
+ create_alert_receiver_request=create_alert_receiver_request,
95
+ _request_auth=_request_auth,
96
+ _content_type=_content_type,
97
+ _headers=_headers,
98
+ _host_index=_host_index
99
+ )
100
+
101
+ _response_types_map: Dict[str, Optional[str]] = {
102
+ '200': "str",
103
+ '500': "Error",
104
+ }
105
+ response_data = self.api_client.call_api(
106
+ *_param,
107
+ _request_timeout=_request_timeout
108
+ )
109
+ response_data.read()
110
+ return self.api_client.response_deserialize(
111
+ response_data=response_data,
112
+ response_types_map=_response_types_map,
113
+ ).data
114
+
115
+
116
+ @validate_call
117
+ def create_alert_receiver_with_http_info(
118
+ self,
119
+ create_alert_receiver_request: CreateAlertReceiverRequest,
120
+ _request_timeout: Union[
121
+ None,
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Tuple[
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Annotated[StrictFloat, Field(gt=0)]
126
+ ]
127
+ ] = None,
128
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
129
+ _content_type: Optional[StrictStr] = None,
130
+ _headers: Optional[Dict[StrictStr, Any]] = None,
131
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
132
+ ) -> ApiResponse[str]:
133
+ """create_alert_receiver
134
+
135
+ Create a new alert receiver
136
+
137
+ :param create_alert_receiver_request: (required)
138
+ :type create_alert_receiver_request: CreateAlertReceiverRequest
139
+ :param _request_timeout: timeout setting for this request. If one
140
+ number provided, it will be total request
141
+ timeout. It can also be a pair (tuple) of
142
+ (connection, read) timeouts.
143
+ :type _request_timeout: int, tuple(int, int), optional
144
+ :param _request_auth: set to override the auth_settings for an a single
145
+ request; this effectively ignores the
146
+ authentication in the spec for a single request.
147
+ :type _request_auth: dict, optional
148
+ :param _content_type: force content-type for the request.
149
+ :type _content_type: str, Optional
150
+ :param _headers: set to override the headers for a single
151
+ request; this effectively ignores the headers
152
+ in the spec for a single request.
153
+ :type _headers: dict, optional
154
+ :param _host_index: set to override the host_index for a single
155
+ request; this effectively ignores the host_index
156
+ in the spec for a single request.
157
+ :type _host_index: int, optional
158
+ :return: Returns the result object.
159
+ """ # noqa: E501
160
+
161
+ _param = self._create_alert_receiver_serialize(
162
+ create_alert_receiver_request=create_alert_receiver_request,
163
+ _request_auth=_request_auth,
164
+ _content_type=_content_type,
165
+ _headers=_headers,
166
+ _host_index=_host_index
167
+ )
168
+
169
+ _response_types_map: Dict[str, Optional[str]] = {
170
+ '200': "str",
171
+ '500': "Error",
172
+ }
173
+ response_data = self.api_client.call_api(
174
+ *_param,
175
+ _request_timeout=_request_timeout
176
+ )
177
+ response_data.read()
178
+ return self.api_client.response_deserialize(
179
+ response_data=response_data,
180
+ response_types_map=_response_types_map,
181
+ )
182
+
183
+
184
+ @validate_call
185
+ def create_alert_receiver_without_preload_content(
186
+ self,
187
+ create_alert_receiver_request: CreateAlertReceiverRequest,
188
+ _request_timeout: Union[
189
+ None,
190
+ Annotated[StrictFloat, Field(gt=0)],
191
+ Tuple[
192
+ Annotated[StrictFloat, Field(gt=0)],
193
+ Annotated[StrictFloat, Field(gt=0)]
194
+ ]
195
+ ] = None,
196
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
197
+ _content_type: Optional[StrictStr] = None,
198
+ _headers: Optional[Dict[StrictStr, Any]] = None,
199
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
200
+ ) -> RESTResponseType:
201
+ """create_alert_receiver
202
+
203
+ Create a new alert receiver
204
+
205
+ :param create_alert_receiver_request: (required)
206
+ :type create_alert_receiver_request: CreateAlertReceiverRequest
207
+ :param _request_timeout: timeout setting for this request. If one
208
+ number provided, it will be total request
209
+ timeout. It can also be a pair (tuple) of
210
+ (connection, read) timeouts.
211
+ :type _request_timeout: int, tuple(int, int), optional
212
+ :param _request_auth: set to override the auth_settings for an a single
213
+ request; this effectively ignores the
214
+ authentication in the spec for a single request.
215
+ :type _request_auth: dict, optional
216
+ :param _content_type: force content-type for the request.
217
+ :type _content_type: str, Optional
218
+ :param _headers: set to override the headers for a single
219
+ request; this effectively ignores the headers
220
+ in the spec for a single request.
221
+ :type _headers: dict, optional
222
+ :param _host_index: set to override the host_index for a single
223
+ request; this effectively ignores the host_index
224
+ in the spec for a single request.
225
+ :type _host_index: int, optional
226
+ :return: Returns the result object.
227
+ """ # noqa: E501
228
+
229
+ _param = self._create_alert_receiver_serialize(
230
+ create_alert_receiver_request=create_alert_receiver_request,
231
+ _request_auth=_request_auth,
232
+ _content_type=_content_type,
233
+ _headers=_headers,
234
+ _host_index=_host_index
235
+ )
236
+
237
+ _response_types_map: Dict[str, Optional[str]] = {
238
+ '200': "str",
239
+ '500': "Error",
240
+ }
241
+ response_data = self.api_client.call_api(
242
+ *_param,
243
+ _request_timeout=_request_timeout
244
+ )
245
+ return response_data.response
246
+
247
+
248
+ def _create_alert_receiver_serialize(
249
+ self,
250
+ create_alert_receiver_request,
251
+ _request_auth,
252
+ _content_type,
253
+ _headers,
254
+ _host_index,
255
+ ) -> RequestSerialized:
256
+
257
+ _host = None
258
+
259
+ _collection_formats: Dict[str, str] = {
260
+ }
261
+
262
+ _path_params: Dict[str, str] = {}
263
+ _query_params: List[Tuple[str, str]] = []
264
+ _header_params: Dict[str, Optional[str]] = _headers or {}
265
+ _form_params: List[Tuple[str, str]] = []
266
+ _files: Dict[str, Union[str, bytes]] = {}
267
+ _body_params: Optional[bytes] = None
268
+
269
+ # process the path parameters
270
+ # process the query parameters
271
+ # process the header parameters
272
+ # process the form parameters
273
+ # process the body parameter
274
+ if create_alert_receiver_request is not None:
275
+ _body_params = create_alert_receiver_request
276
+
277
+
278
+ # set the HTTP header `Accept`
279
+ if 'Accept' not in _header_params:
280
+ _header_params['Accept'] = self.api_client.select_header_accept(
281
+ [
282
+ 'application/json'
283
+ ]
284
+ )
285
+
286
+ # set the HTTP header `Content-Type`
287
+ if _content_type:
288
+ _header_params['Content-Type'] = _content_type
289
+ else:
290
+ _default_content_type = (
291
+ self.api_client.select_header_content_type(
292
+ [
293
+ 'application/json'
294
+ ]
295
+ )
296
+ )
297
+ if _default_content_type is not None:
298
+ _header_params['Content-Type'] = _default_content_type
299
+
300
+ # authentication setting
301
+ _auth_settings: List[str] = [
302
+ ]
303
+
304
+ return self.api_client.param_serialize(
305
+ method='POST',
306
+ resource_path='/api/v1/alert/receiver',
307
+ path_params=_path_params,
308
+ query_params=_query_params,
309
+ header_params=_header_params,
310
+ body=_body_params,
311
+ post_params=_form_params,
312
+ files=_files,
313
+ auth_settings=_auth_settings,
314
+ collection_formats=_collection_formats,
315
+ _host=_host,
316
+ _request_auth=_request_auth
317
+ )
318
+
319
+
320
+
321
+
322
+ @validate_call
323
+ def delete_alert_message_in_batch(
324
+ self,
325
+ message_ids: Annotated[StrictStr, Field(description="A list of message id separated by comma, e.g. id1,id2,id3")],
326
+ _request_timeout: Union[
327
+ None,
328
+ Annotated[StrictFloat, Field(gt=0)],
329
+ Tuple[
330
+ Annotated[StrictFloat, Field(gt=0)],
331
+ Annotated[StrictFloat, Field(gt=0)]
332
+ ]
333
+ ] = None,
334
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
335
+ _content_type: Optional[StrictStr] = None,
336
+ _headers: Optional[Dict[StrictStr, Any]] = None,
337
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
338
+ ) -> str:
339
+ """delete_alert_message_in_batch
340
+
341
+ Delete alert message in batch
342
+
343
+ :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 (required)
344
+ :type message_ids: str
345
+ :param _request_timeout: timeout setting for this request. If one
346
+ number provided, it will be total request
347
+ timeout. It can also be a pair (tuple) of
348
+ (connection, read) timeouts.
349
+ :type _request_timeout: int, tuple(int, int), optional
350
+ :param _request_auth: set to override the auth_settings for an a single
351
+ request; this effectively ignores the
352
+ authentication in the spec for a single request.
353
+ :type _request_auth: dict, optional
354
+ :param _content_type: force content-type for the request.
355
+ :type _content_type: str, Optional
356
+ :param _headers: set to override the headers for a single
357
+ request; this effectively ignores the headers
358
+ in the spec for a single request.
359
+ :type _headers: dict, optional
360
+ :param _host_index: set to override the host_index for a single
361
+ request; this effectively ignores the host_index
362
+ in the spec for a single request.
363
+ :type _host_index: int, optional
364
+ :return: Returns the result object.
365
+ """ # noqa: E501
366
+
367
+ _param = self._delete_alert_message_in_batch_serialize(
368
+ message_ids=message_ids,
369
+ _request_auth=_request_auth,
370
+ _content_type=_content_type,
371
+ _headers=_headers,
372
+ _host_index=_host_index
373
+ )
374
+
375
+ _response_types_map: Dict[str, Optional[str]] = {
376
+ '200': "str",
377
+ '500': "Error",
378
+ }
379
+ response_data = self.api_client.call_api(
380
+ *_param,
381
+ _request_timeout=_request_timeout
382
+ )
383
+ response_data.read()
384
+ return self.api_client.response_deserialize(
385
+ response_data=response_data,
386
+ response_types_map=_response_types_map,
387
+ ).data
388
+
389
+
390
+ @validate_call
391
+ def delete_alert_message_in_batch_with_http_info(
392
+ self,
393
+ message_ids: Annotated[StrictStr, Field(description="A list of message id separated by comma, e.g. id1,id2,id3")],
394
+ _request_timeout: Union[
395
+ None,
396
+ Annotated[StrictFloat, Field(gt=0)],
397
+ Tuple[
398
+ Annotated[StrictFloat, Field(gt=0)],
399
+ Annotated[StrictFloat, Field(gt=0)]
400
+ ]
401
+ ] = None,
402
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
403
+ _content_type: Optional[StrictStr] = None,
404
+ _headers: Optional[Dict[StrictStr, Any]] = None,
405
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
406
+ ) -> ApiResponse[str]:
407
+ """delete_alert_message_in_batch
408
+
409
+ Delete alert message in batch
410
+
411
+ :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 (required)
412
+ :type message_ids: str
413
+ :param _request_timeout: timeout setting for this request. If one
414
+ number provided, it will be total request
415
+ timeout. It can also be a pair (tuple) of
416
+ (connection, read) timeouts.
417
+ :type _request_timeout: int, tuple(int, int), optional
418
+ :param _request_auth: set to override the auth_settings for an a single
419
+ request; this effectively ignores the
420
+ authentication in the spec for a single request.
421
+ :type _request_auth: dict, optional
422
+ :param _content_type: force content-type for the request.
423
+ :type _content_type: str, Optional
424
+ :param _headers: set to override the headers for a single
425
+ request; this effectively ignores the headers
426
+ in the spec for a single request.
427
+ :type _headers: dict, optional
428
+ :param _host_index: set to override the host_index for a single
429
+ request; this effectively ignores the host_index
430
+ in the spec for a single request.
431
+ :type _host_index: int, optional
432
+ :return: Returns the result object.
433
+ """ # noqa: E501
434
+
435
+ _param = self._delete_alert_message_in_batch_serialize(
436
+ message_ids=message_ids,
437
+ _request_auth=_request_auth,
438
+ _content_type=_content_type,
439
+ _headers=_headers,
440
+ _host_index=_host_index
441
+ )
442
+
443
+ _response_types_map: Dict[str, Optional[str]] = {
444
+ '200': "str",
445
+ '500': "Error",
446
+ }
447
+ response_data = self.api_client.call_api(
448
+ *_param,
449
+ _request_timeout=_request_timeout
450
+ )
451
+ response_data.read()
452
+ return self.api_client.response_deserialize(
453
+ response_data=response_data,
454
+ response_types_map=_response_types_map,
455
+ )
456
+
457
+
458
+ @validate_call
459
+ def delete_alert_message_in_batch_without_preload_content(
460
+ self,
461
+ message_ids: Annotated[StrictStr, Field(description="A list of message id separated by comma, e.g. id1,id2,id3")],
462
+ _request_timeout: Union[
463
+ None,
464
+ Annotated[StrictFloat, Field(gt=0)],
465
+ Tuple[
466
+ Annotated[StrictFloat, Field(gt=0)],
467
+ Annotated[StrictFloat, Field(gt=0)]
468
+ ]
469
+ ] = None,
470
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
471
+ _content_type: Optional[StrictStr] = None,
472
+ _headers: Optional[Dict[StrictStr, Any]] = None,
473
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
474
+ ) -> RESTResponseType:
475
+ """delete_alert_message_in_batch
476
+
477
+ Delete alert message in batch
478
+
479
+ :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 (required)
480
+ :type message_ids: str
481
+ :param _request_timeout: timeout setting for this request. If one
482
+ number provided, it will be total request
483
+ timeout. It can also be a pair (tuple) of
484
+ (connection, read) timeouts.
485
+ :type _request_timeout: int, tuple(int, int), optional
486
+ :param _request_auth: set to override the auth_settings for an a single
487
+ request; this effectively ignores the
488
+ authentication in the spec for a single request.
489
+ :type _request_auth: dict, optional
490
+ :param _content_type: force content-type for the request.
491
+ :type _content_type: str, Optional
492
+ :param _headers: set to override the headers for a single
493
+ request; this effectively ignores the headers
494
+ in the spec for a single request.
495
+ :type _headers: dict, optional
496
+ :param _host_index: set to override the host_index for a single
497
+ request; this effectively ignores the host_index
498
+ in the spec for a single request.
499
+ :type _host_index: int, optional
500
+ :return: Returns the result object.
501
+ """ # noqa: E501
502
+
503
+ _param = self._delete_alert_message_in_batch_serialize(
504
+ message_ids=message_ids,
505
+ _request_auth=_request_auth,
506
+ _content_type=_content_type,
507
+ _headers=_headers,
508
+ _host_index=_host_index
509
+ )
510
+
511
+ _response_types_map: Dict[str, Optional[str]] = {
512
+ '200': "str",
513
+ '500': "Error",
514
+ }
515
+ response_data = self.api_client.call_api(
516
+ *_param,
517
+ _request_timeout=_request_timeout
518
+ )
519
+ return response_data.response
520
+
521
+
522
+ def _delete_alert_message_in_batch_serialize(
523
+ self,
524
+ message_ids,
525
+ _request_auth,
526
+ _content_type,
527
+ _headers,
528
+ _host_index,
529
+ ) -> RequestSerialized:
530
+
531
+ _host = None
532
+
533
+ _collection_formats: Dict[str, str] = {
534
+ }
535
+
536
+ _path_params: Dict[str, str] = {}
537
+ _query_params: List[Tuple[str, str]] = []
538
+ _header_params: Dict[str, Optional[str]] = _headers or {}
539
+ _form_params: List[Tuple[str, str]] = []
540
+ _files: Dict[str, Union[str, bytes]] = {}
541
+ _body_params: Optional[bytes] = None
542
+
543
+ # process the path parameters
544
+ # process the query parameters
545
+ if message_ids is not None:
546
+
547
+ _query_params.append(('message_ids', message_ids))
548
+
549
+ # process the header parameters
550
+ # process the form parameters
551
+ # process the body parameter
552
+
553
+
554
+ # set the HTTP header `Accept`
555
+ if 'Accept' not in _header_params:
556
+ _header_params['Accept'] = self.api_client.select_header_accept(
557
+ [
558
+ 'application/json'
559
+ ]
560
+ )
561
+
562
+
563
+ # authentication setting
564
+ _auth_settings: List[str] = [
565
+ ]
566
+
567
+ return self.api_client.param_serialize(
568
+ method='DELETE',
569
+ resource_path='/api/v1/alert/message-collection',
570
+ path_params=_path_params,
571
+ query_params=_query_params,
572
+ header_params=_header_params,
573
+ body=_body_params,
574
+ post_params=_form_params,
575
+ files=_files,
576
+ auth_settings=_auth_settings,
577
+ collection_formats=_collection_formats,
578
+ _host=_host,
579
+ _request_auth=_request_auth
580
+ )
581
+
582
+
583
+
584
+
585
+ @validate_call
586
+ def delete_alert_receiver_by_id(
587
+ self,
588
+ receiver_id: StrictStr,
589
+ _request_timeout: Union[
590
+ None,
591
+ Annotated[StrictFloat, Field(gt=0)],
592
+ Tuple[
593
+ Annotated[StrictFloat, Field(gt=0)],
594
+ Annotated[StrictFloat, Field(gt=0)]
595
+ ]
596
+ ] = None,
597
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
598
+ _content_type: Optional[StrictStr] = None,
599
+ _headers: Optional[Dict[StrictStr, Any]] = None,
600
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
601
+ ) -> str:
602
+ """delete_alert_receiver_by_id
603
+
604
+ Delete the alert receiver by ID
605
+
606
+ :param receiver_id: (required)
607
+ :type receiver_id: str
608
+ :param _request_timeout: timeout setting for this request. If one
609
+ number provided, it will be total request
610
+ timeout. It can also be a pair (tuple) of
611
+ (connection, read) timeouts.
612
+ :type _request_timeout: int, tuple(int, int), optional
613
+ :param _request_auth: set to override the auth_settings for an a single
614
+ request; this effectively ignores the
615
+ authentication in the spec for a single request.
616
+ :type _request_auth: dict, optional
617
+ :param _content_type: force content-type for the request.
618
+ :type _content_type: str, Optional
619
+ :param _headers: set to override the headers for a single
620
+ request; this effectively ignores the headers
621
+ in the spec for a single request.
622
+ :type _headers: dict, optional
623
+ :param _host_index: set to override the host_index for a single
624
+ request; this effectively ignores the host_index
625
+ in the spec for a single request.
626
+ :type _host_index: int, optional
627
+ :return: Returns the result object.
628
+ """ # noqa: E501
629
+
630
+ _param = self._delete_alert_receiver_by_id_serialize(
631
+ receiver_id=receiver_id,
632
+ _request_auth=_request_auth,
633
+ _content_type=_content_type,
634
+ _headers=_headers,
635
+ _host_index=_host_index
636
+ )
637
+
638
+ _response_types_map: Dict[str, Optional[str]] = {
639
+ '200': "str",
640
+ '500': "Error",
641
+ }
642
+ response_data = self.api_client.call_api(
643
+ *_param,
644
+ _request_timeout=_request_timeout
645
+ )
646
+ response_data.read()
647
+ return self.api_client.response_deserialize(
648
+ response_data=response_data,
649
+ response_types_map=_response_types_map,
650
+ ).data
651
+
652
+
653
+ @validate_call
654
+ def delete_alert_receiver_by_id_with_http_info(
655
+ self,
656
+ receiver_id: StrictStr,
657
+ _request_timeout: Union[
658
+ None,
659
+ Annotated[StrictFloat, Field(gt=0)],
660
+ Tuple[
661
+ Annotated[StrictFloat, Field(gt=0)],
662
+ Annotated[StrictFloat, Field(gt=0)]
663
+ ]
664
+ ] = None,
665
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
666
+ _content_type: Optional[StrictStr] = None,
667
+ _headers: Optional[Dict[StrictStr, Any]] = None,
668
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
669
+ ) -> ApiResponse[str]:
670
+ """delete_alert_receiver_by_id
671
+
672
+ Delete the alert receiver by ID
673
+
674
+ :param receiver_id: (required)
675
+ :type receiver_id: str
676
+ :param _request_timeout: timeout setting for this request. If one
677
+ number provided, it will be total request
678
+ timeout. It can also be a pair (tuple) of
679
+ (connection, read) timeouts.
680
+ :type _request_timeout: int, tuple(int, int), optional
681
+ :param _request_auth: set to override the auth_settings for an a single
682
+ request; this effectively ignores the
683
+ authentication in the spec for a single request.
684
+ :type _request_auth: dict, optional
685
+ :param _content_type: force content-type for the request.
686
+ :type _content_type: str, Optional
687
+ :param _headers: set to override the headers for a single
688
+ request; this effectively ignores the headers
689
+ in the spec for a single request.
690
+ :type _headers: dict, optional
691
+ :param _host_index: set to override the host_index for a single
692
+ request; this effectively ignores the host_index
693
+ in the spec for a single request.
694
+ :type _host_index: int, optional
695
+ :return: Returns the result object.
696
+ """ # noqa: E501
697
+
698
+ _param = self._delete_alert_receiver_by_id_serialize(
699
+ receiver_id=receiver_id,
700
+ _request_auth=_request_auth,
701
+ _content_type=_content_type,
702
+ _headers=_headers,
703
+ _host_index=_host_index
704
+ )
705
+
706
+ _response_types_map: Dict[str, Optional[str]] = {
707
+ '200': "str",
708
+ '500': "Error",
709
+ }
710
+ response_data = self.api_client.call_api(
711
+ *_param,
712
+ _request_timeout=_request_timeout
713
+ )
714
+ response_data.read()
715
+ return self.api_client.response_deserialize(
716
+ response_data=response_data,
717
+ response_types_map=_response_types_map,
718
+ )
719
+
720
+
721
+ @validate_call
722
+ def delete_alert_receiver_by_id_without_preload_content(
723
+ self,
724
+ receiver_id: StrictStr,
725
+ _request_timeout: Union[
726
+ None,
727
+ Annotated[StrictFloat, Field(gt=0)],
728
+ Tuple[
729
+ Annotated[StrictFloat, Field(gt=0)],
730
+ Annotated[StrictFloat, Field(gt=0)]
731
+ ]
732
+ ] = None,
733
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
734
+ _content_type: Optional[StrictStr] = None,
735
+ _headers: Optional[Dict[StrictStr, Any]] = None,
736
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
737
+ ) -> RESTResponseType:
738
+ """delete_alert_receiver_by_id
739
+
740
+ Delete the alert receiver by ID
741
+
742
+ :param receiver_id: (required)
743
+ :type receiver_id: str
744
+ :param _request_timeout: timeout setting for this request. If one
745
+ number provided, it will be total request
746
+ timeout. It can also be a pair (tuple) of
747
+ (connection, read) timeouts.
748
+ :type _request_timeout: int, tuple(int, int), optional
749
+ :param _request_auth: set to override the auth_settings for an a single
750
+ request; this effectively ignores the
751
+ authentication in the spec for a single request.
752
+ :type _request_auth: dict, optional
753
+ :param _content_type: force content-type for the request.
754
+ :type _content_type: str, Optional
755
+ :param _headers: set to override the headers for a single
756
+ request; this effectively ignores the headers
757
+ in the spec for a single request.
758
+ :type _headers: dict, optional
759
+ :param _host_index: set to override the host_index for a single
760
+ request; this effectively ignores the host_index
761
+ in the spec for a single request.
762
+ :type _host_index: int, optional
763
+ :return: Returns the result object.
764
+ """ # noqa: E501
765
+
766
+ _param = self._delete_alert_receiver_by_id_serialize(
767
+ receiver_id=receiver_id,
768
+ _request_auth=_request_auth,
769
+ _content_type=_content_type,
770
+ _headers=_headers,
771
+ _host_index=_host_index
772
+ )
773
+
774
+ _response_types_map: Dict[str, Optional[str]] = {
775
+ '200': "str",
776
+ '500': "Error",
777
+ }
778
+ response_data = self.api_client.call_api(
779
+ *_param,
780
+ _request_timeout=_request_timeout
781
+ )
782
+ return response_data.response
783
+
784
+
785
+ def _delete_alert_receiver_by_id_serialize(
786
+ self,
787
+ receiver_id,
788
+ _request_auth,
789
+ _content_type,
790
+ _headers,
791
+ _host_index,
792
+ ) -> RequestSerialized:
793
+
794
+ _host = None
795
+
796
+ _collection_formats: Dict[str, str] = {
797
+ }
798
+
799
+ _path_params: Dict[str, str] = {}
800
+ _query_params: List[Tuple[str, str]] = []
801
+ _header_params: Dict[str, Optional[str]] = _headers or {}
802
+ _form_params: List[Tuple[str, str]] = []
803
+ _files: Dict[str, Union[str, bytes]] = {}
804
+ _body_params: Optional[bytes] = None
805
+
806
+ # process the path parameters
807
+ if receiver_id is not None:
808
+ _path_params['receiver_id'] = receiver_id
809
+ # process the query parameters
810
+ # process the header parameters
811
+ # process the form parameters
812
+ # process the body parameter
813
+
814
+
815
+ # set the HTTP header `Accept`
816
+ if 'Accept' not in _header_params:
817
+ _header_params['Accept'] = self.api_client.select_header_accept(
818
+ [
819
+ 'application/json'
820
+ ]
821
+ )
822
+
823
+
824
+ # authentication setting
825
+ _auth_settings: List[str] = [
826
+ ]
827
+
828
+ return self.api_client.param_serialize(
829
+ method='DELETE',
830
+ resource_path='/api/v1/alert/receiver/{receiver_id}',
831
+ path_params=_path_params,
832
+ query_params=_query_params,
833
+ header_params=_header_params,
834
+ body=_body_params,
835
+ post_params=_form_params,
836
+ files=_files,
837
+ auth_settings=_auth_settings,
838
+ collection_formats=_collection_formats,
839
+ _host=_host,
840
+ _request_auth=_request_auth
841
+ )
842
+
843
+
844
+
845
+
846
+ @validate_call
847
+ def delete_alert_rule_by_id(
848
+ self,
849
+ rule_id: StrictStr,
850
+ _request_timeout: Union[
851
+ None,
852
+ Annotated[StrictFloat, Field(gt=0)],
853
+ Tuple[
854
+ Annotated[StrictFloat, Field(gt=0)],
855
+ Annotated[StrictFloat, Field(gt=0)]
856
+ ]
857
+ ] = None,
858
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
859
+ _content_type: Optional[StrictStr] = None,
860
+ _headers: Optional[Dict[StrictStr, Any]] = None,
861
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
862
+ ) -> str:
863
+ """delete_alert_rule_by_id
864
+
865
+
866
+ :param rule_id: (required)
867
+ :type rule_id: str
868
+ :param _request_timeout: timeout setting for this request. If one
869
+ number provided, it will be total request
870
+ timeout. It can also be a pair (tuple) of
871
+ (connection, read) timeouts.
872
+ :type _request_timeout: int, tuple(int, int), optional
873
+ :param _request_auth: set to override the auth_settings for an a single
874
+ request; this effectively ignores the
875
+ authentication in the spec for a single request.
876
+ :type _request_auth: dict, optional
877
+ :param _content_type: force content-type for the request.
878
+ :type _content_type: str, Optional
879
+ :param _headers: set to override the headers for a single
880
+ request; this effectively ignores the headers
881
+ in the spec for a single request.
882
+ :type _headers: dict, optional
883
+ :param _host_index: set to override the host_index for a single
884
+ request; this effectively ignores the host_index
885
+ in the spec for a single request.
886
+ :type _host_index: int, optional
887
+ :return: Returns the result object.
888
+ """ # noqa: E501
889
+
890
+ _param = self._delete_alert_rule_by_id_serialize(
891
+ rule_id=rule_id,
892
+ _request_auth=_request_auth,
893
+ _content_type=_content_type,
894
+ _headers=_headers,
895
+ _host_index=_host_index
896
+ )
897
+
898
+ _response_types_map: Dict[str, Optional[str]] = {
899
+ '200': "str",
900
+ '500': "Error",
901
+ }
902
+ response_data = self.api_client.call_api(
903
+ *_param,
904
+ _request_timeout=_request_timeout
905
+ )
906
+ response_data.read()
907
+ return self.api_client.response_deserialize(
908
+ response_data=response_data,
909
+ response_types_map=_response_types_map,
910
+ ).data
911
+
912
+
913
+ @validate_call
914
+ def delete_alert_rule_by_id_with_http_info(
915
+ self,
916
+ rule_id: StrictStr,
917
+ _request_timeout: Union[
918
+ None,
919
+ Annotated[StrictFloat, Field(gt=0)],
920
+ Tuple[
921
+ Annotated[StrictFloat, Field(gt=0)],
922
+ Annotated[StrictFloat, Field(gt=0)]
923
+ ]
924
+ ] = None,
925
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
926
+ _content_type: Optional[StrictStr] = None,
927
+ _headers: Optional[Dict[StrictStr, Any]] = None,
928
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
929
+ ) -> ApiResponse[str]:
930
+ """delete_alert_rule_by_id
931
+
932
+
933
+ :param rule_id: (required)
934
+ :type rule_id: str
935
+ :param _request_timeout: timeout setting for this request. If one
936
+ number provided, it will be total request
937
+ timeout. It can also be a pair (tuple) of
938
+ (connection, read) timeouts.
939
+ :type _request_timeout: int, tuple(int, int), optional
940
+ :param _request_auth: set to override the auth_settings for an a single
941
+ request; this effectively ignores the
942
+ authentication in the spec for a single request.
943
+ :type _request_auth: dict, optional
944
+ :param _content_type: force content-type for the request.
945
+ :type _content_type: str, Optional
946
+ :param _headers: set to override the headers for a single
947
+ request; this effectively ignores the headers
948
+ in the spec for a single request.
949
+ :type _headers: dict, optional
950
+ :param _host_index: set to override the host_index for a single
951
+ request; this effectively ignores the host_index
952
+ in the spec for a single request.
953
+ :type _host_index: int, optional
954
+ :return: Returns the result object.
955
+ """ # noqa: E501
956
+
957
+ _param = self._delete_alert_rule_by_id_serialize(
958
+ rule_id=rule_id,
959
+ _request_auth=_request_auth,
960
+ _content_type=_content_type,
961
+ _headers=_headers,
962
+ _host_index=_host_index
963
+ )
964
+
965
+ _response_types_map: Dict[str, Optional[str]] = {
966
+ '200': "str",
967
+ '500': "Error",
968
+ }
969
+ response_data = self.api_client.call_api(
970
+ *_param,
971
+ _request_timeout=_request_timeout
972
+ )
973
+ response_data.read()
974
+ return self.api_client.response_deserialize(
975
+ response_data=response_data,
976
+ response_types_map=_response_types_map,
977
+ )
978
+
979
+
980
+ @validate_call
981
+ def delete_alert_rule_by_id_without_preload_content(
982
+ self,
983
+ rule_id: StrictStr,
984
+ _request_timeout: Union[
985
+ None,
986
+ Annotated[StrictFloat, Field(gt=0)],
987
+ Tuple[
988
+ Annotated[StrictFloat, Field(gt=0)],
989
+ Annotated[StrictFloat, Field(gt=0)]
990
+ ]
991
+ ] = None,
992
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
993
+ _content_type: Optional[StrictStr] = None,
994
+ _headers: Optional[Dict[StrictStr, Any]] = None,
995
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
996
+ ) -> RESTResponseType:
997
+ """delete_alert_rule_by_id
998
+
999
+
1000
+ :param rule_id: (required)
1001
+ :type rule_id: str
1002
+ :param _request_timeout: timeout setting for this request. If one
1003
+ number provided, it will be total request
1004
+ timeout. It can also be a pair (tuple) of
1005
+ (connection, read) timeouts.
1006
+ :type _request_timeout: int, tuple(int, int), optional
1007
+ :param _request_auth: set to override the auth_settings for an a single
1008
+ request; this effectively ignores the
1009
+ authentication in the spec for a single request.
1010
+ :type _request_auth: dict, optional
1011
+ :param _content_type: force content-type for the request.
1012
+ :type _content_type: str, Optional
1013
+ :param _headers: set to override the headers for a single
1014
+ request; this effectively ignores the headers
1015
+ in the spec for a single request.
1016
+ :type _headers: dict, optional
1017
+ :param _host_index: set to override the host_index for a single
1018
+ request; this effectively ignores the host_index
1019
+ in the spec for a single request.
1020
+ :type _host_index: int, optional
1021
+ :return: Returns the result object.
1022
+ """ # noqa: E501
1023
+
1024
+ _param = self._delete_alert_rule_by_id_serialize(
1025
+ rule_id=rule_id,
1026
+ _request_auth=_request_auth,
1027
+ _content_type=_content_type,
1028
+ _headers=_headers,
1029
+ _host_index=_host_index
1030
+ )
1031
+
1032
+ _response_types_map: Dict[str, Optional[str]] = {
1033
+ '200': "str",
1034
+ '500': "Error",
1035
+ }
1036
+ response_data = self.api_client.call_api(
1037
+ *_param,
1038
+ _request_timeout=_request_timeout
1039
+ )
1040
+ return response_data.response
1041
+
1042
+
1043
+ def _delete_alert_rule_by_id_serialize(
1044
+ self,
1045
+ rule_id,
1046
+ _request_auth,
1047
+ _content_type,
1048
+ _headers,
1049
+ _host_index,
1050
+ ) -> RequestSerialized:
1051
+
1052
+ _host = None
1053
+
1054
+ _collection_formats: Dict[str, str] = {
1055
+ }
1056
+
1057
+ _path_params: Dict[str, str] = {}
1058
+ _query_params: List[Tuple[str, str]] = []
1059
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1060
+ _form_params: List[Tuple[str, str]] = []
1061
+ _files: Dict[str, Union[str, bytes]] = {}
1062
+ _body_params: Optional[bytes] = None
1063
+
1064
+ # process the path parameters
1065
+ if rule_id is not None:
1066
+ _path_params['rule_id'] = rule_id
1067
+ # process the query parameters
1068
+ # process the header parameters
1069
+ # process the form parameters
1070
+ # process the body parameter
1071
+
1072
+
1073
+ # set the HTTP header `Accept`
1074
+ if 'Accept' not in _header_params:
1075
+ _header_params['Accept'] = self.api_client.select_header_accept(
1076
+ [
1077
+ 'application/json'
1078
+ ]
1079
+ )
1080
+
1081
+
1082
+ # authentication setting
1083
+ _auth_settings: List[str] = [
1084
+ ]
1085
+
1086
+ return self.api_client.param_serialize(
1087
+ method='DELETE',
1088
+ resource_path='/api/v1/alert/rule/{rule_id}',
1089
+ path_params=_path_params,
1090
+ query_params=_query_params,
1091
+ header_params=_header_params,
1092
+ body=_body_params,
1093
+ post_params=_form_params,
1094
+ files=_files,
1095
+ auth_settings=_auth_settings,
1096
+ collection_formats=_collection_formats,
1097
+ _host=_host,
1098
+ _request_auth=_request_auth
1099
+ )
1100
+
1101
+
1102
+
1103
+
1104
+ @validate_call
1105
+ def list_alert_messages(
1106
+ self,
1107
+ alert_type: Optional[StrictStr] = None,
1108
+ status: Optional[StrictStr] = None,
1109
+ severity: Optional[StrictStr] = None,
1110
+ start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None,
1111
+ end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None,
1112
+ limit: Optional[StrictInt] = None,
1113
+ _request_timeout: Union[
1114
+ None,
1115
+ Annotated[StrictFloat, Field(gt=0)],
1116
+ Tuple[
1117
+ Annotated[StrictFloat, Field(gt=0)],
1118
+ Annotated[StrictFloat, Field(gt=0)]
1119
+ ]
1120
+ ] = None,
1121
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1122
+ _content_type: Optional[StrictStr] = None,
1123
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1124
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1125
+ ) -> List[GetAlertMessageResponse]:
1126
+ """list_alert_messages
1127
+
1128
+ List all alert messages
1129
+
1130
+ :param alert_type:
1131
+ :type alert_type: str
1132
+ :param status:
1133
+ :type status: str
1134
+ :param severity:
1135
+ :type severity: str
1136
+ :param start_time: format with \"2023-02-21-11-56-30\"
1137
+ :type start_time: str
1138
+ :param end_time: format with \"2023-02-21-11-56-30\"
1139
+ :type end_time: str
1140
+ :param limit:
1141
+ :type limit: int
1142
+ :param _request_timeout: timeout setting for this request. If one
1143
+ number provided, it will be total request
1144
+ timeout. It can also be a pair (tuple) of
1145
+ (connection, read) timeouts.
1146
+ :type _request_timeout: int, tuple(int, int), optional
1147
+ :param _request_auth: set to override the auth_settings for an a single
1148
+ request; this effectively ignores the
1149
+ authentication in the spec for a single request.
1150
+ :type _request_auth: dict, optional
1151
+ :param _content_type: force content-type for the request.
1152
+ :type _content_type: str, Optional
1153
+ :param _headers: set to override the headers for a single
1154
+ request; this effectively ignores the headers
1155
+ in the spec for a single request.
1156
+ :type _headers: dict, optional
1157
+ :param _host_index: set to override the host_index for a single
1158
+ request; this effectively ignores the host_index
1159
+ in the spec for a single request.
1160
+ :type _host_index: int, optional
1161
+ :return: Returns the result object.
1162
+ """ # noqa: E501
1163
+
1164
+ _param = self._list_alert_messages_serialize(
1165
+ alert_type=alert_type,
1166
+ status=status,
1167
+ severity=severity,
1168
+ start_time=start_time,
1169
+ end_time=end_time,
1170
+ limit=limit,
1171
+ _request_auth=_request_auth,
1172
+ _content_type=_content_type,
1173
+ _headers=_headers,
1174
+ _host_index=_host_index
1175
+ )
1176
+
1177
+ _response_types_map: Dict[str, Optional[str]] = {
1178
+ '200': "List[GetAlertMessageResponse]",
1179
+ '500': "Error",
1180
+ }
1181
+ response_data = self.api_client.call_api(
1182
+ *_param,
1183
+ _request_timeout=_request_timeout
1184
+ )
1185
+ response_data.read()
1186
+ return self.api_client.response_deserialize(
1187
+ response_data=response_data,
1188
+ response_types_map=_response_types_map,
1189
+ ).data
1190
+
1191
+
1192
+ @validate_call
1193
+ def list_alert_messages_with_http_info(
1194
+ self,
1195
+ alert_type: Optional[StrictStr] = None,
1196
+ status: Optional[StrictStr] = None,
1197
+ severity: Optional[StrictStr] = None,
1198
+ start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None,
1199
+ end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None,
1200
+ limit: Optional[StrictInt] = None,
1201
+ _request_timeout: Union[
1202
+ None,
1203
+ Annotated[StrictFloat, Field(gt=0)],
1204
+ Tuple[
1205
+ Annotated[StrictFloat, Field(gt=0)],
1206
+ Annotated[StrictFloat, Field(gt=0)]
1207
+ ]
1208
+ ] = None,
1209
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1210
+ _content_type: Optional[StrictStr] = None,
1211
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1212
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1213
+ ) -> ApiResponse[List[GetAlertMessageResponse]]:
1214
+ """list_alert_messages
1215
+
1216
+ List all alert messages
1217
+
1218
+ :param alert_type:
1219
+ :type alert_type: str
1220
+ :param status:
1221
+ :type status: str
1222
+ :param severity:
1223
+ :type severity: str
1224
+ :param start_time: format with \"2023-02-21-11-56-30\"
1225
+ :type start_time: str
1226
+ :param end_time: format with \"2023-02-21-11-56-30\"
1227
+ :type end_time: str
1228
+ :param limit:
1229
+ :type limit: int
1230
+ :param _request_timeout: timeout setting for this request. If one
1231
+ number provided, it will be total request
1232
+ timeout. It can also be a pair (tuple) of
1233
+ (connection, read) timeouts.
1234
+ :type _request_timeout: int, tuple(int, int), optional
1235
+ :param _request_auth: set to override the auth_settings for an a single
1236
+ request; this effectively ignores the
1237
+ authentication in the spec for a single request.
1238
+ :type _request_auth: dict, optional
1239
+ :param _content_type: force content-type for the request.
1240
+ :type _content_type: str, Optional
1241
+ :param _headers: set to override the headers for a single
1242
+ request; this effectively ignores the headers
1243
+ in the spec for a single request.
1244
+ :type _headers: dict, optional
1245
+ :param _host_index: set to override the host_index for a single
1246
+ request; this effectively ignores the host_index
1247
+ in the spec for a single request.
1248
+ :type _host_index: int, optional
1249
+ :return: Returns the result object.
1250
+ """ # noqa: E501
1251
+
1252
+ _param = self._list_alert_messages_serialize(
1253
+ alert_type=alert_type,
1254
+ status=status,
1255
+ severity=severity,
1256
+ start_time=start_time,
1257
+ end_time=end_time,
1258
+ limit=limit,
1259
+ _request_auth=_request_auth,
1260
+ _content_type=_content_type,
1261
+ _headers=_headers,
1262
+ _host_index=_host_index
1263
+ )
1264
+
1265
+ _response_types_map: Dict[str, Optional[str]] = {
1266
+ '200': "List[GetAlertMessageResponse]",
1267
+ '500': "Error",
1268
+ }
1269
+ response_data = self.api_client.call_api(
1270
+ *_param,
1271
+ _request_timeout=_request_timeout
1272
+ )
1273
+ response_data.read()
1274
+ return self.api_client.response_deserialize(
1275
+ response_data=response_data,
1276
+ response_types_map=_response_types_map,
1277
+ )
1278
+
1279
+
1280
+ @validate_call
1281
+ def list_alert_messages_without_preload_content(
1282
+ self,
1283
+ alert_type: Optional[StrictStr] = None,
1284
+ status: Optional[StrictStr] = None,
1285
+ severity: Optional[StrictStr] = None,
1286
+ start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None,
1287
+ end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None,
1288
+ limit: Optional[StrictInt] = None,
1289
+ _request_timeout: Union[
1290
+ None,
1291
+ Annotated[StrictFloat, Field(gt=0)],
1292
+ Tuple[
1293
+ Annotated[StrictFloat, Field(gt=0)],
1294
+ Annotated[StrictFloat, Field(gt=0)]
1295
+ ]
1296
+ ] = None,
1297
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1298
+ _content_type: Optional[StrictStr] = None,
1299
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1300
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1301
+ ) -> RESTResponseType:
1302
+ """list_alert_messages
1303
+
1304
+ List all alert messages
1305
+
1306
+ :param alert_type:
1307
+ :type alert_type: str
1308
+ :param status:
1309
+ :type status: str
1310
+ :param severity:
1311
+ :type severity: str
1312
+ :param start_time: format with \"2023-02-21-11-56-30\"
1313
+ :type start_time: str
1314
+ :param end_time: format with \"2023-02-21-11-56-30\"
1315
+ :type end_time: str
1316
+ :param limit:
1317
+ :type limit: int
1318
+ :param _request_timeout: timeout setting for this request. If one
1319
+ number provided, it will be total request
1320
+ timeout. It can also be a pair (tuple) of
1321
+ (connection, read) timeouts.
1322
+ :type _request_timeout: int, tuple(int, int), optional
1323
+ :param _request_auth: set to override the auth_settings for an a single
1324
+ request; this effectively ignores the
1325
+ authentication in the spec for a single request.
1326
+ :type _request_auth: dict, optional
1327
+ :param _content_type: force content-type for the request.
1328
+ :type _content_type: str, Optional
1329
+ :param _headers: set to override the headers for a single
1330
+ request; this effectively ignores the headers
1331
+ in the spec for a single request.
1332
+ :type _headers: dict, optional
1333
+ :param _host_index: set to override the host_index for a single
1334
+ request; this effectively ignores the host_index
1335
+ in the spec for a single request.
1336
+ :type _host_index: int, optional
1337
+ :return: Returns the result object.
1338
+ """ # noqa: E501
1339
+
1340
+ _param = self._list_alert_messages_serialize(
1341
+ alert_type=alert_type,
1342
+ status=status,
1343
+ severity=severity,
1344
+ start_time=start_time,
1345
+ end_time=end_time,
1346
+ limit=limit,
1347
+ _request_auth=_request_auth,
1348
+ _content_type=_content_type,
1349
+ _headers=_headers,
1350
+ _host_index=_host_index
1351
+ )
1352
+
1353
+ _response_types_map: Dict[str, Optional[str]] = {
1354
+ '200': "List[GetAlertMessageResponse]",
1355
+ '500': "Error",
1356
+ }
1357
+ response_data = self.api_client.call_api(
1358
+ *_param,
1359
+ _request_timeout=_request_timeout
1360
+ )
1361
+ return response_data.response
1362
+
1363
+
1364
+ def _list_alert_messages_serialize(
1365
+ self,
1366
+ alert_type,
1367
+ status,
1368
+ severity,
1369
+ start_time,
1370
+ end_time,
1371
+ limit,
1372
+ _request_auth,
1373
+ _content_type,
1374
+ _headers,
1375
+ _host_index,
1376
+ ) -> RequestSerialized:
1377
+
1378
+ _host = None
1379
+
1380
+ _collection_formats: Dict[str, str] = {
1381
+ }
1382
+
1383
+ _path_params: Dict[str, str] = {}
1384
+ _query_params: List[Tuple[str, str]] = []
1385
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1386
+ _form_params: List[Tuple[str, str]] = []
1387
+ _files: Dict[str, Union[str, bytes]] = {}
1388
+ _body_params: Optional[bytes] = None
1389
+
1390
+ # process the path parameters
1391
+ # process the query parameters
1392
+ if alert_type is not None:
1393
+
1394
+ _query_params.append(('alert_type', alert_type))
1395
+
1396
+ if status is not None:
1397
+
1398
+ _query_params.append(('status', status))
1399
+
1400
+ if severity is not None:
1401
+
1402
+ _query_params.append(('severity', severity))
1403
+
1404
+ if start_time is not None:
1405
+
1406
+ _query_params.append(('start_time', start_time))
1407
+
1408
+ if end_time is not None:
1409
+
1410
+ _query_params.append(('end_time', end_time))
1411
+
1412
+ if limit is not None:
1413
+
1414
+ _query_params.append(('limit', limit))
1415
+
1416
+ # process the header parameters
1417
+ # process the form parameters
1418
+ # process the body parameter
1419
+
1420
+
1421
+ # set the HTTP header `Accept`
1422
+ if 'Accept' not in _header_params:
1423
+ _header_params['Accept'] = self.api_client.select_header_accept(
1424
+ [
1425
+ 'application/json'
1426
+ ]
1427
+ )
1428
+
1429
+
1430
+ # authentication setting
1431
+ _auth_settings: List[str] = [
1432
+ ]
1433
+
1434
+ return self.api_client.param_serialize(
1435
+ method='GET',
1436
+ resource_path='/api/v1/alert/message',
1437
+ path_params=_path_params,
1438
+ query_params=_query_params,
1439
+ header_params=_header_params,
1440
+ body=_body_params,
1441
+ post_params=_form_params,
1442
+ files=_files,
1443
+ auth_settings=_auth_settings,
1444
+ collection_formats=_collection_formats,
1445
+ _host=_host,
1446
+ _request_auth=_request_auth
1447
+ )
1448
+
1449
+
1450
+
1451
+
1452
+ @validate_call
1453
+ def list_alert_receivers(
1454
+ self,
1455
+ _request_timeout: Union[
1456
+ None,
1457
+ Annotated[StrictFloat, Field(gt=0)],
1458
+ Tuple[
1459
+ Annotated[StrictFloat, Field(gt=0)],
1460
+ Annotated[StrictFloat, Field(gt=0)]
1461
+ ]
1462
+ ] = None,
1463
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1464
+ _content_type: Optional[StrictStr] = None,
1465
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1466
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1467
+ ) -> List[GetAlertReceiverResponse]:
1468
+ """list_alert_receivers
1469
+
1470
+ List all alert receivers
1471
+
1472
+ :param _request_timeout: timeout setting for this request. If one
1473
+ number provided, it will be total request
1474
+ timeout. It can also be a pair (tuple) of
1475
+ (connection, read) timeouts.
1476
+ :type _request_timeout: int, tuple(int, int), optional
1477
+ :param _request_auth: set to override the auth_settings for an a single
1478
+ request; this effectively ignores the
1479
+ authentication in the spec for a single request.
1480
+ :type _request_auth: dict, optional
1481
+ :param _content_type: force content-type for the request.
1482
+ :type _content_type: str, Optional
1483
+ :param _headers: set to override the headers for a single
1484
+ request; this effectively ignores the headers
1485
+ in the spec for a single request.
1486
+ :type _headers: dict, optional
1487
+ :param _host_index: set to override the host_index for a single
1488
+ request; this effectively ignores the host_index
1489
+ in the spec for a single request.
1490
+ :type _host_index: int, optional
1491
+ :return: Returns the result object.
1492
+ """ # noqa: E501
1493
+
1494
+ _param = self._list_alert_receivers_serialize(
1495
+ _request_auth=_request_auth,
1496
+ _content_type=_content_type,
1497
+ _headers=_headers,
1498
+ _host_index=_host_index
1499
+ )
1500
+
1501
+ _response_types_map: Dict[str, Optional[str]] = {
1502
+ '200': "List[GetAlertReceiverResponse]",
1503
+ '500': "Error",
1504
+ }
1505
+ response_data = self.api_client.call_api(
1506
+ *_param,
1507
+ _request_timeout=_request_timeout
1508
+ )
1509
+ response_data.read()
1510
+ return self.api_client.response_deserialize(
1511
+ response_data=response_data,
1512
+ response_types_map=_response_types_map,
1513
+ ).data
1514
+
1515
+
1516
+ @validate_call
1517
+ def list_alert_receivers_with_http_info(
1518
+ self,
1519
+ _request_timeout: Union[
1520
+ None,
1521
+ Annotated[StrictFloat, Field(gt=0)],
1522
+ Tuple[
1523
+ Annotated[StrictFloat, Field(gt=0)],
1524
+ Annotated[StrictFloat, Field(gt=0)]
1525
+ ]
1526
+ ] = None,
1527
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1528
+ _content_type: Optional[StrictStr] = None,
1529
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1530
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1531
+ ) -> ApiResponse[List[GetAlertReceiverResponse]]:
1532
+ """list_alert_receivers
1533
+
1534
+ List all alert receivers
1535
+
1536
+ :param _request_timeout: timeout setting for this request. If one
1537
+ number provided, it will be total request
1538
+ timeout. It can also be a pair (tuple) of
1539
+ (connection, read) timeouts.
1540
+ :type _request_timeout: int, tuple(int, int), optional
1541
+ :param _request_auth: set to override the auth_settings for an a single
1542
+ request; this effectively ignores the
1543
+ authentication in the spec for a single request.
1544
+ :type _request_auth: dict, optional
1545
+ :param _content_type: force content-type for the request.
1546
+ :type _content_type: str, Optional
1547
+ :param _headers: set to override the headers for a single
1548
+ request; this effectively ignores the headers
1549
+ in the spec for a single request.
1550
+ :type _headers: dict, optional
1551
+ :param _host_index: set to override the host_index for a single
1552
+ request; this effectively ignores the host_index
1553
+ in the spec for a single request.
1554
+ :type _host_index: int, optional
1555
+ :return: Returns the result object.
1556
+ """ # noqa: E501
1557
+
1558
+ _param = self._list_alert_receivers_serialize(
1559
+ _request_auth=_request_auth,
1560
+ _content_type=_content_type,
1561
+ _headers=_headers,
1562
+ _host_index=_host_index
1563
+ )
1564
+
1565
+ _response_types_map: Dict[str, Optional[str]] = {
1566
+ '200': "List[GetAlertReceiverResponse]",
1567
+ '500': "Error",
1568
+ }
1569
+ response_data = self.api_client.call_api(
1570
+ *_param,
1571
+ _request_timeout=_request_timeout
1572
+ )
1573
+ response_data.read()
1574
+ return self.api_client.response_deserialize(
1575
+ response_data=response_data,
1576
+ response_types_map=_response_types_map,
1577
+ )
1578
+
1579
+
1580
+ @validate_call
1581
+ def list_alert_receivers_without_preload_content(
1582
+ self,
1583
+ _request_timeout: Union[
1584
+ None,
1585
+ Annotated[StrictFloat, Field(gt=0)],
1586
+ Tuple[
1587
+ Annotated[StrictFloat, Field(gt=0)],
1588
+ Annotated[StrictFloat, Field(gt=0)]
1589
+ ]
1590
+ ] = None,
1591
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1592
+ _content_type: Optional[StrictStr] = None,
1593
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1594
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1595
+ ) -> RESTResponseType:
1596
+ """list_alert_receivers
1597
+
1598
+ List all alert receivers
1599
+
1600
+ :param _request_timeout: timeout setting for this request. If one
1601
+ number provided, it will be total request
1602
+ timeout. It can also be a pair (tuple) of
1603
+ (connection, read) timeouts.
1604
+ :type _request_timeout: int, tuple(int, int), optional
1605
+ :param _request_auth: set to override the auth_settings for an a single
1606
+ request; this effectively ignores the
1607
+ authentication in the spec for a single request.
1608
+ :type _request_auth: dict, optional
1609
+ :param _content_type: force content-type for the request.
1610
+ :type _content_type: str, Optional
1611
+ :param _headers: set to override the headers for a single
1612
+ request; this effectively ignores the headers
1613
+ in the spec for a single request.
1614
+ :type _headers: dict, optional
1615
+ :param _host_index: set to override the host_index for a single
1616
+ request; this effectively ignores the host_index
1617
+ in the spec for a single request.
1618
+ :type _host_index: int, optional
1619
+ :return: Returns the result object.
1620
+ """ # noqa: E501
1621
+
1622
+ _param = self._list_alert_receivers_serialize(
1623
+ _request_auth=_request_auth,
1624
+ _content_type=_content_type,
1625
+ _headers=_headers,
1626
+ _host_index=_host_index
1627
+ )
1628
+
1629
+ _response_types_map: Dict[str, Optional[str]] = {
1630
+ '200': "List[GetAlertReceiverResponse]",
1631
+ '500': "Error",
1632
+ }
1633
+ response_data = self.api_client.call_api(
1634
+ *_param,
1635
+ _request_timeout=_request_timeout
1636
+ )
1637
+ return response_data.response
1638
+
1639
+
1640
+ def _list_alert_receivers_serialize(
1641
+ self,
1642
+ _request_auth,
1643
+ _content_type,
1644
+ _headers,
1645
+ _host_index,
1646
+ ) -> RequestSerialized:
1647
+
1648
+ _host = None
1649
+
1650
+ _collection_formats: Dict[str, str] = {
1651
+ }
1652
+
1653
+ _path_params: Dict[str, str] = {}
1654
+ _query_params: List[Tuple[str, str]] = []
1655
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1656
+ _form_params: List[Tuple[str, str]] = []
1657
+ _files: Dict[str, Union[str, bytes]] = {}
1658
+ _body_params: Optional[bytes] = None
1659
+
1660
+ # process the path parameters
1661
+ # process the query parameters
1662
+ # process the header parameters
1663
+ # process the form parameters
1664
+ # process the body parameter
1665
+
1666
+
1667
+ # set the HTTP header `Accept`
1668
+ if 'Accept' not in _header_params:
1669
+ _header_params['Accept'] = self.api_client.select_header_accept(
1670
+ [
1671
+ 'application/json'
1672
+ ]
1673
+ )
1674
+
1675
+
1676
+ # authentication setting
1677
+ _auth_settings: List[str] = [
1678
+ ]
1679
+
1680
+ return self.api_client.param_serialize(
1681
+ method='GET',
1682
+ resource_path='/api/v1/alert/receiver',
1683
+ path_params=_path_params,
1684
+ query_params=_query_params,
1685
+ header_params=_header_params,
1686
+ body=_body_params,
1687
+ post_params=_form_params,
1688
+ files=_files,
1689
+ auth_settings=_auth_settings,
1690
+ collection_formats=_collection_formats,
1691
+ _host=_host,
1692
+ _request_auth=_request_auth
1693
+ )
1694
+
1695
+
1696
+
1697
+
1698
+ @validate_call
1699
+ def list_alert_rules(
1700
+ self,
1701
+ _request_timeout: Union[
1702
+ None,
1703
+ Annotated[StrictFloat, Field(gt=0)],
1704
+ Tuple[
1705
+ Annotated[StrictFloat, Field(gt=0)],
1706
+ Annotated[StrictFloat, Field(gt=0)]
1707
+ ]
1708
+ ] = None,
1709
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1710
+ _content_type: Optional[StrictStr] = None,
1711
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1712
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1713
+ ) -> List[GetAlertRuleResponse]:
1714
+ """list_alert_rules
1715
+
1716
+ List all alert rules
1717
+
1718
+ :param _request_timeout: timeout setting for this request. If one
1719
+ number provided, it will be total request
1720
+ timeout. It can also be a pair (tuple) of
1721
+ (connection, read) timeouts.
1722
+ :type _request_timeout: int, tuple(int, int), optional
1723
+ :param _request_auth: set to override the auth_settings for an a single
1724
+ request; this effectively ignores the
1725
+ authentication in the spec for a single request.
1726
+ :type _request_auth: dict, optional
1727
+ :param _content_type: force content-type for the request.
1728
+ :type _content_type: str, Optional
1729
+ :param _headers: set to override the headers for a single
1730
+ request; this effectively ignores the headers
1731
+ in the spec for a single request.
1732
+ :type _headers: dict, optional
1733
+ :param _host_index: set to override the host_index for a single
1734
+ request; this effectively ignores the host_index
1735
+ in the spec for a single request.
1736
+ :type _host_index: int, optional
1737
+ :return: Returns the result object.
1738
+ """ # noqa: E501
1739
+
1740
+ _param = self._list_alert_rules_serialize(
1741
+ _request_auth=_request_auth,
1742
+ _content_type=_content_type,
1743
+ _headers=_headers,
1744
+ _host_index=_host_index
1745
+ )
1746
+
1747
+ _response_types_map: Dict[str, Optional[str]] = {
1748
+ '200': "List[GetAlertRuleResponse]",
1749
+ '500': "Error",
1750
+ }
1751
+ response_data = self.api_client.call_api(
1752
+ *_param,
1753
+ _request_timeout=_request_timeout
1754
+ )
1755
+ response_data.read()
1756
+ return self.api_client.response_deserialize(
1757
+ response_data=response_data,
1758
+ response_types_map=_response_types_map,
1759
+ ).data
1760
+
1761
+
1762
+ @validate_call
1763
+ def list_alert_rules_with_http_info(
1764
+ self,
1765
+ _request_timeout: Union[
1766
+ None,
1767
+ Annotated[StrictFloat, Field(gt=0)],
1768
+ Tuple[
1769
+ Annotated[StrictFloat, Field(gt=0)],
1770
+ Annotated[StrictFloat, Field(gt=0)]
1771
+ ]
1772
+ ] = None,
1773
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1774
+ _content_type: Optional[StrictStr] = None,
1775
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1776
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1777
+ ) -> ApiResponse[List[GetAlertRuleResponse]]:
1778
+ """list_alert_rules
1779
+
1780
+ List all alert rules
1781
+
1782
+ :param _request_timeout: timeout setting for this request. If one
1783
+ number provided, it will be total request
1784
+ timeout. It can also be a pair (tuple) of
1785
+ (connection, read) timeouts.
1786
+ :type _request_timeout: int, tuple(int, int), optional
1787
+ :param _request_auth: set to override the auth_settings for an a single
1788
+ request; this effectively ignores the
1789
+ authentication in the spec for a single request.
1790
+ :type _request_auth: dict, optional
1791
+ :param _content_type: force content-type for the request.
1792
+ :type _content_type: str, Optional
1793
+ :param _headers: set to override the headers for a single
1794
+ request; this effectively ignores the headers
1795
+ in the spec for a single request.
1796
+ :type _headers: dict, optional
1797
+ :param _host_index: set to override the host_index for a single
1798
+ request; this effectively ignores the host_index
1799
+ in the spec for a single request.
1800
+ :type _host_index: int, optional
1801
+ :return: Returns the result object.
1802
+ """ # noqa: E501
1803
+
1804
+ _param = self._list_alert_rules_serialize(
1805
+ _request_auth=_request_auth,
1806
+ _content_type=_content_type,
1807
+ _headers=_headers,
1808
+ _host_index=_host_index
1809
+ )
1810
+
1811
+ _response_types_map: Dict[str, Optional[str]] = {
1812
+ '200': "List[GetAlertRuleResponse]",
1813
+ '500': "Error",
1814
+ }
1815
+ response_data = self.api_client.call_api(
1816
+ *_param,
1817
+ _request_timeout=_request_timeout
1818
+ )
1819
+ response_data.read()
1820
+ return self.api_client.response_deserialize(
1821
+ response_data=response_data,
1822
+ response_types_map=_response_types_map,
1823
+ )
1824
+
1825
+
1826
+ @validate_call
1827
+ def list_alert_rules_without_preload_content(
1828
+ self,
1829
+ _request_timeout: Union[
1830
+ None,
1831
+ Annotated[StrictFloat, Field(gt=0)],
1832
+ Tuple[
1833
+ Annotated[StrictFloat, Field(gt=0)],
1834
+ Annotated[StrictFloat, Field(gt=0)]
1835
+ ]
1836
+ ] = None,
1837
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1838
+ _content_type: Optional[StrictStr] = None,
1839
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1840
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1841
+ ) -> RESTResponseType:
1842
+ """list_alert_rules
1843
+
1844
+ List all alert rules
1845
+
1846
+ :param _request_timeout: timeout setting for this request. If one
1847
+ number provided, it will be total request
1848
+ timeout. It can also be a pair (tuple) of
1849
+ (connection, read) timeouts.
1850
+ :type _request_timeout: int, tuple(int, int), optional
1851
+ :param _request_auth: set to override the auth_settings for an a single
1852
+ request; this effectively ignores the
1853
+ authentication in the spec for a single request.
1854
+ :type _request_auth: dict, optional
1855
+ :param _content_type: force content-type for the request.
1856
+ :type _content_type: str, Optional
1857
+ :param _headers: set to override the headers for a single
1858
+ request; this effectively ignores the headers
1859
+ in the spec for a single request.
1860
+ :type _headers: dict, optional
1861
+ :param _host_index: set to override the host_index for a single
1862
+ request; this effectively ignores the host_index
1863
+ in the spec for a single request.
1864
+ :type _host_index: int, optional
1865
+ :return: Returns the result object.
1866
+ """ # noqa: E501
1867
+
1868
+ _param = self._list_alert_rules_serialize(
1869
+ _request_auth=_request_auth,
1870
+ _content_type=_content_type,
1871
+ _headers=_headers,
1872
+ _host_index=_host_index
1873
+ )
1874
+
1875
+ _response_types_map: Dict[str, Optional[str]] = {
1876
+ '200': "List[GetAlertRuleResponse]",
1877
+ '500': "Error",
1878
+ }
1879
+ response_data = self.api_client.call_api(
1880
+ *_param,
1881
+ _request_timeout=_request_timeout
1882
+ )
1883
+ return response_data.response
1884
+
1885
+
1886
+ def _list_alert_rules_serialize(
1887
+ self,
1888
+ _request_auth,
1889
+ _content_type,
1890
+ _headers,
1891
+ _host_index,
1892
+ ) -> RequestSerialized:
1893
+
1894
+ _host = None
1895
+
1896
+ _collection_formats: Dict[str, str] = {
1897
+ }
1898
+
1899
+ _path_params: Dict[str, str] = {}
1900
+ _query_params: List[Tuple[str, str]] = []
1901
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1902
+ _form_params: List[Tuple[str, str]] = []
1903
+ _files: Dict[str, Union[str, bytes]] = {}
1904
+ _body_params: Optional[bytes] = None
1905
+
1906
+ # process the path parameters
1907
+ # process the query parameters
1908
+ # process the header parameters
1909
+ # process the form parameters
1910
+ # process the body parameter
1911
+
1912
+
1913
+ # set the HTTP header `Accept`
1914
+ if 'Accept' not in _header_params:
1915
+ _header_params['Accept'] = self.api_client.select_header_accept(
1916
+ [
1917
+ 'application/json'
1918
+ ]
1919
+ )
1920
+
1921
+
1922
+ # authentication setting
1923
+ _auth_settings: List[str] = [
1924
+ ]
1925
+
1926
+ return self.api_client.param_serialize(
1927
+ method='GET',
1928
+ resource_path='/api/v1/alert/rule',
1929
+ path_params=_path_params,
1930
+ query_params=_query_params,
1931
+ header_params=_header_params,
1932
+ body=_body_params,
1933
+ post_params=_form_params,
1934
+ files=_files,
1935
+ auth_settings=_auth_settings,
1936
+ collection_formats=_collection_formats,
1937
+ _host=_host,
1938
+ _request_auth=_request_auth
1939
+ )
1940
+
1941
+
1942
+
1943
+
1944
+ @validate_call
1945
+ def update_alert_message_in_batch(
1946
+ self,
1947
+ update_alert_message_status_request: Optional[UpdateAlertMessageStatusRequest] = None,
1948
+ _request_timeout: Union[
1949
+ None,
1950
+ Annotated[StrictFloat, Field(gt=0)],
1951
+ Tuple[
1952
+ Annotated[StrictFloat, Field(gt=0)],
1953
+ Annotated[StrictFloat, Field(gt=0)]
1954
+ ]
1955
+ ] = None,
1956
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1957
+ _content_type: Optional[StrictStr] = None,
1958
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1959
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1960
+ ) -> str:
1961
+ """update_alert_message_in_batch
1962
+
1963
+ Update the message status in batch
1964
+
1965
+ :param update_alert_message_status_request:
1966
+ :type update_alert_message_status_request: UpdateAlertMessageStatusRequest
1967
+ :param _request_timeout: timeout setting for this request. If one
1968
+ number provided, it will be total request
1969
+ timeout. It can also be a pair (tuple) of
1970
+ (connection, read) timeouts.
1971
+ :type _request_timeout: int, tuple(int, int), optional
1972
+ :param _request_auth: set to override the auth_settings for an a single
1973
+ request; this effectively ignores the
1974
+ authentication in the spec for a single request.
1975
+ :type _request_auth: dict, optional
1976
+ :param _content_type: force content-type for the request.
1977
+ :type _content_type: str, Optional
1978
+ :param _headers: set to override the headers for a single
1979
+ request; this effectively ignores the headers
1980
+ in the spec for a single request.
1981
+ :type _headers: dict, optional
1982
+ :param _host_index: set to override the host_index for a single
1983
+ request; this effectively ignores the host_index
1984
+ in the spec for a single request.
1985
+ :type _host_index: int, optional
1986
+ :return: Returns the result object.
1987
+ """ # noqa: E501
1988
+
1989
+ _param = self._update_alert_message_in_batch_serialize(
1990
+ update_alert_message_status_request=update_alert_message_status_request,
1991
+ _request_auth=_request_auth,
1992
+ _content_type=_content_type,
1993
+ _headers=_headers,
1994
+ _host_index=_host_index
1995
+ )
1996
+
1997
+ _response_types_map: Dict[str, Optional[str]] = {
1998
+ '200': "str",
1999
+ '500': "Error",
2000
+ }
2001
+ response_data = self.api_client.call_api(
2002
+ *_param,
2003
+ _request_timeout=_request_timeout
2004
+ )
2005
+ response_data.read()
2006
+ return self.api_client.response_deserialize(
2007
+ response_data=response_data,
2008
+ response_types_map=_response_types_map,
2009
+ ).data
2010
+
2011
+
2012
+ @validate_call
2013
+ def update_alert_message_in_batch_with_http_info(
2014
+ self,
2015
+ update_alert_message_status_request: Optional[UpdateAlertMessageStatusRequest] = None,
2016
+ _request_timeout: Union[
2017
+ None,
2018
+ Annotated[StrictFloat, Field(gt=0)],
2019
+ Tuple[
2020
+ Annotated[StrictFloat, Field(gt=0)],
2021
+ Annotated[StrictFloat, Field(gt=0)]
2022
+ ]
2023
+ ] = None,
2024
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2025
+ _content_type: Optional[StrictStr] = None,
2026
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2027
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2028
+ ) -> ApiResponse[str]:
2029
+ """update_alert_message_in_batch
2030
+
2031
+ Update the message status in batch
2032
+
2033
+ :param update_alert_message_status_request:
2034
+ :type update_alert_message_status_request: UpdateAlertMessageStatusRequest
2035
+ :param _request_timeout: timeout setting for this request. If one
2036
+ number provided, it will be total request
2037
+ timeout. It can also be a pair (tuple) of
2038
+ (connection, read) timeouts.
2039
+ :type _request_timeout: int, tuple(int, int), optional
2040
+ :param _request_auth: set to override the auth_settings for an a single
2041
+ request; this effectively ignores the
2042
+ authentication in the spec for a single request.
2043
+ :type _request_auth: dict, optional
2044
+ :param _content_type: force content-type for the request.
2045
+ :type _content_type: str, Optional
2046
+ :param _headers: set to override the headers for a single
2047
+ request; this effectively ignores the headers
2048
+ in the spec for a single request.
2049
+ :type _headers: dict, optional
2050
+ :param _host_index: set to override the host_index for a single
2051
+ request; this effectively ignores the host_index
2052
+ in the spec for a single request.
2053
+ :type _host_index: int, optional
2054
+ :return: Returns the result object.
2055
+ """ # noqa: E501
2056
+
2057
+ _param = self._update_alert_message_in_batch_serialize(
2058
+ update_alert_message_status_request=update_alert_message_status_request,
2059
+ _request_auth=_request_auth,
2060
+ _content_type=_content_type,
2061
+ _headers=_headers,
2062
+ _host_index=_host_index
2063
+ )
2064
+
2065
+ _response_types_map: Dict[str, Optional[str]] = {
2066
+ '200': "str",
2067
+ '500': "Error",
2068
+ }
2069
+ response_data = self.api_client.call_api(
2070
+ *_param,
2071
+ _request_timeout=_request_timeout
2072
+ )
2073
+ response_data.read()
2074
+ return self.api_client.response_deserialize(
2075
+ response_data=response_data,
2076
+ response_types_map=_response_types_map,
2077
+ )
2078
+
2079
+
2080
+ @validate_call
2081
+ def update_alert_message_in_batch_without_preload_content(
2082
+ self,
2083
+ update_alert_message_status_request: Optional[UpdateAlertMessageStatusRequest] = None,
2084
+ _request_timeout: Union[
2085
+ None,
2086
+ Annotated[StrictFloat, Field(gt=0)],
2087
+ Tuple[
2088
+ Annotated[StrictFloat, Field(gt=0)],
2089
+ Annotated[StrictFloat, Field(gt=0)]
2090
+ ]
2091
+ ] = None,
2092
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2093
+ _content_type: Optional[StrictStr] = None,
2094
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2095
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2096
+ ) -> RESTResponseType:
2097
+ """update_alert_message_in_batch
2098
+
2099
+ Update the message status in batch
2100
+
2101
+ :param update_alert_message_status_request:
2102
+ :type update_alert_message_status_request: UpdateAlertMessageStatusRequest
2103
+ :param _request_timeout: timeout setting for this request. If one
2104
+ number provided, it will be total request
2105
+ timeout. It can also be a pair (tuple) of
2106
+ (connection, read) timeouts.
2107
+ :type _request_timeout: int, tuple(int, int), optional
2108
+ :param _request_auth: set to override the auth_settings for an a single
2109
+ request; this effectively ignores the
2110
+ authentication in the spec for a single request.
2111
+ :type _request_auth: dict, optional
2112
+ :param _content_type: force content-type for the request.
2113
+ :type _content_type: str, Optional
2114
+ :param _headers: set to override the headers for a single
2115
+ request; this effectively ignores the headers
2116
+ in the spec for a single request.
2117
+ :type _headers: dict, optional
2118
+ :param _host_index: set to override the host_index for a single
2119
+ request; this effectively ignores the host_index
2120
+ in the spec for a single request.
2121
+ :type _host_index: int, optional
2122
+ :return: Returns the result object.
2123
+ """ # noqa: E501
2124
+
2125
+ _param = self._update_alert_message_in_batch_serialize(
2126
+ update_alert_message_status_request=update_alert_message_status_request,
2127
+ _request_auth=_request_auth,
2128
+ _content_type=_content_type,
2129
+ _headers=_headers,
2130
+ _host_index=_host_index
2131
+ )
2132
+
2133
+ _response_types_map: Dict[str, Optional[str]] = {
2134
+ '200': "str",
2135
+ '500': "Error",
2136
+ }
2137
+ response_data = self.api_client.call_api(
2138
+ *_param,
2139
+ _request_timeout=_request_timeout
2140
+ )
2141
+ return response_data.response
2142
+
2143
+
2144
+ def _update_alert_message_in_batch_serialize(
2145
+ self,
2146
+ update_alert_message_status_request,
2147
+ _request_auth,
2148
+ _content_type,
2149
+ _headers,
2150
+ _host_index,
2151
+ ) -> RequestSerialized:
2152
+
2153
+ _host = None
2154
+
2155
+ _collection_formats: Dict[str, str] = {
2156
+ }
2157
+
2158
+ _path_params: Dict[str, str] = {}
2159
+ _query_params: List[Tuple[str, str]] = []
2160
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2161
+ _form_params: List[Tuple[str, str]] = []
2162
+ _files: Dict[str, Union[str, bytes]] = {}
2163
+ _body_params: Optional[bytes] = None
2164
+
2165
+ # process the path parameters
2166
+ # process the query parameters
2167
+ # process the header parameters
2168
+ # process the form parameters
2169
+ # process the body parameter
2170
+ if update_alert_message_status_request is not None:
2171
+ _body_params = update_alert_message_status_request
2172
+
2173
+
2174
+ # set the HTTP header `Accept`
2175
+ if 'Accept' not in _header_params:
2176
+ _header_params['Accept'] = self.api_client.select_header_accept(
2177
+ [
2178
+ 'application/json'
2179
+ ]
2180
+ )
2181
+
2182
+ # set the HTTP header `Content-Type`
2183
+ if _content_type:
2184
+ _header_params['Content-Type'] = _content_type
2185
+ else:
2186
+ _default_content_type = (
2187
+ self.api_client.select_header_content_type(
2188
+ [
2189
+ 'application/json'
2190
+ ]
2191
+ )
2192
+ )
2193
+ if _default_content_type is not None:
2194
+ _header_params['Content-Type'] = _default_content_type
2195
+
2196
+ # authentication setting
2197
+ _auth_settings: List[str] = [
2198
+ ]
2199
+
2200
+ return self.api_client.param_serialize(
2201
+ method='PUT',
2202
+ resource_path='/api/v1/alert/message-collection/status',
2203
+ path_params=_path_params,
2204
+ query_params=_query_params,
2205
+ header_params=_header_params,
2206
+ body=_body_params,
2207
+ post_params=_form_params,
2208
+ files=_files,
2209
+ auth_settings=_auth_settings,
2210
+ collection_formats=_collection_formats,
2211
+ _host=_host,
2212
+ _request_auth=_request_auth
2213
+ )
2214
+
2215
+
2216
+
2217
+
2218
+ @validate_call
2219
+ def update_alert_receiver_by_id(
2220
+ self,
2221
+ receiver_id: StrictStr,
2222
+ create_alert_receiver_request: Optional[CreateAlertReceiverRequest] = None,
2223
+ _request_timeout: Union[
2224
+ None,
2225
+ Annotated[StrictFloat, Field(gt=0)],
2226
+ Tuple[
2227
+ Annotated[StrictFloat, Field(gt=0)],
2228
+ Annotated[StrictFloat, Field(gt=0)]
2229
+ ]
2230
+ ] = None,
2231
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2232
+ _content_type: Optional[StrictStr] = None,
2233
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2234
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2235
+ ) -> str:
2236
+ """update_alert_receiver_by_id
2237
+
2238
+ Update alert receiver by ID
2239
+
2240
+ :param receiver_id: (required)
2241
+ :type receiver_id: str
2242
+ :param create_alert_receiver_request:
2243
+ :type create_alert_receiver_request: CreateAlertReceiverRequest
2244
+ :param _request_timeout: timeout setting for this request. If one
2245
+ number provided, it will be total request
2246
+ timeout. It can also be a pair (tuple) of
2247
+ (connection, read) timeouts.
2248
+ :type _request_timeout: int, tuple(int, int), optional
2249
+ :param _request_auth: set to override the auth_settings for an a single
2250
+ request; this effectively ignores the
2251
+ authentication in the spec for a single request.
2252
+ :type _request_auth: dict, optional
2253
+ :param _content_type: force content-type for the request.
2254
+ :type _content_type: str, Optional
2255
+ :param _headers: set to override the headers for a single
2256
+ request; this effectively ignores the headers
2257
+ in the spec for a single request.
2258
+ :type _headers: dict, optional
2259
+ :param _host_index: set to override the host_index for a single
2260
+ request; this effectively ignores the host_index
2261
+ in the spec for a single request.
2262
+ :type _host_index: int, optional
2263
+ :return: Returns the result object.
2264
+ """ # noqa: E501
2265
+
2266
+ _param = self._update_alert_receiver_by_id_serialize(
2267
+ receiver_id=receiver_id,
2268
+ create_alert_receiver_request=create_alert_receiver_request,
2269
+ _request_auth=_request_auth,
2270
+ _content_type=_content_type,
2271
+ _headers=_headers,
2272
+ _host_index=_host_index
2273
+ )
2274
+
2275
+ _response_types_map: Dict[str, Optional[str]] = {
2276
+ '200': "str",
2277
+ '500': "Error",
2278
+ }
2279
+ response_data = self.api_client.call_api(
2280
+ *_param,
2281
+ _request_timeout=_request_timeout
2282
+ )
2283
+ response_data.read()
2284
+ return self.api_client.response_deserialize(
2285
+ response_data=response_data,
2286
+ response_types_map=_response_types_map,
2287
+ ).data
2288
+
2289
+
2290
+ @validate_call
2291
+ def update_alert_receiver_by_id_with_http_info(
2292
+ self,
2293
+ receiver_id: StrictStr,
2294
+ create_alert_receiver_request: Optional[CreateAlertReceiverRequest] = None,
2295
+ _request_timeout: Union[
2296
+ None,
2297
+ Annotated[StrictFloat, Field(gt=0)],
2298
+ Tuple[
2299
+ Annotated[StrictFloat, Field(gt=0)],
2300
+ Annotated[StrictFloat, Field(gt=0)]
2301
+ ]
2302
+ ] = None,
2303
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2304
+ _content_type: Optional[StrictStr] = None,
2305
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2306
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2307
+ ) -> ApiResponse[str]:
2308
+ """update_alert_receiver_by_id
2309
+
2310
+ Update alert receiver by ID
2311
+
2312
+ :param receiver_id: (required)
2313
+ :type receiver_id: str
2314
+ :param create_alert_receiver_request:
2315
+ :type create_alert_receiver_request: CreateAlertReceiverRequest
2316
+ :param _request_timeout: timeout setting for this request. If one
2317
+ number provided, it will be total request
2318
+ timeout. It can also be a pair (tuple) of
2319
+ (connection, read) timeouts.
2320
+ :type _request_timeout: int, tuple(int, int), optional
2321
+ :param _request_auth: set to override the auth_settings for an a single
2322
+ request; this effectively ignores the
2323
+ authentication in the spec for a single request.
2324
+ :type _request_auth: dict, optional
2325
+ :param _content_type: force content-type for the request.
2326
+ :type _content_type: str, Optional
2327
+ :param _headers: set to override the headers for a single
2328
+ request; this effectively ignores the headers
2329
+ in the spec for a single request.
2330
+ :type _headers: dict, optional
2331
+ :param _host_index: set to override the host_index for a single
2332
+ request; this effectively ignores the host_index
2333
+ in the spec for a single request.
2334
+ :type _host_index: int, optional
2335
+ :return: Returns the result object.
2336
+ """ # noqa: E501
2337
+
2338
+ _param = self._update_alert_receiver_by_id_serialize(
2339
+ receiver_id=receiver_id,
2340
+ create_alert_receiver_request=create_alert_receiver_request,
2341
+ _request_auth=_request_auth,
2342
+ _content_type=_content_type,
2343
+ _headers=_headers,
2344
+ _host_index=_host_index
2345
+ )
2346
+
2347
+ _response_types_map: Dict[str, Optional[str]] = {
2348
+ '200': "str",
2349
+ '500': "Error",
2350
+ }
2351
+ response_data = self.api_client.call_api(
2352
+ *_param,
2353
+ _request_timeout=_request_timeout
2354
+ )
2355
+ response_data.read()
2356
+ return self.api_client.response_deserialize(
2357
+ response_data=response_data,
2358
+ response_types_map=_response_types_map,
2359
+ )
2360
+
2361
+
2362
+ @validate_call
2363
+ def update_alert_receiver_by_id_without_preload_content(
2364
+ self,
2365
+ receiver_id: StrictStr,
2366
+ create_alert_receiver_request: Optional[CreateAlertReceiverRequest] = None,
2367
+ _request_timeout: Union[
2368
+ None,
2369
+ Annotated[StrictFloat, Field(gt=0)],
2370
+ Tuple[
2371
+ Annotated[StrictFloat, Field(gt=0)],
2372
+ Annotated[StrictFloat, Field(gt=0)]
2373
+ ]
2374
+ ] = None,
2375
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2376
+ _content_type: Optional[StrictStr] = None,
2377
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2378
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2379
+ ) -> RESTResponseType:
2380
+ """update_alert_receiver_by_id
2381
+
2382
+ Update alert receiver by ID
2383
+
2384
+ :param receiver_id: (required)
2385
+ :type receiver_id: str
2386
+ :param create_alert_receiver_request:
2387
+ :type create_alert_receiver_request: CreateAlertReceiverRequest
2388
+ :param _request_timeout: timeout setting for this request. If one
2389
+ number provided, it will be total request
2390
+ timeout. It can also be a pair (tuple) of
2391
+ (connection, read) timeouts.
2392
+ :type _request_timeout: int, tuple(int, int), optional
2393
+ :param _request_auth: set to override the auth_settings for an a single
2394
+ request; this effectively ignores the
2395
+ authentication in the spec for a single request.
2396
+ :type _request_auth: dict, optional
2397
+ :param _content_type: force content-type for the request.
2398
+ :type _content_type: str, Optional
2399
+ :param _headers: set to override the headers for a single
2400
+ request; this effectively ignores the headers
2401
+ in the spec for a single request.
2402
+ :type _headers: dict, optional
2403
+ :param _host_index: set to override the host_index for a single
2404
+ request; this effectively ignores the host_index
2405
+ in the spec for a single request.
2406
+ :type _host_index: int, optional
2407
+ :return: Returns the result object.
2408
+ """ # noqa: E501
2409
+
2410
+ _param = self._update_alert_receiver_by_id_serialize(
2411
+ receiver_id=receiver_id,
2412
+ create_alert_receiver_request=create_alert_receiver_request,
2413
+ _request_auth=_request_auth,
2414
+ _content_type=_content_type,
2415
+ _headers=_headers,
2416
+ _host_index=_host_index
2417
+ )
2418
+
2419
+ _response_types_map: Dict[str, Optional[str]] = {
2420
+ '200': "str",
2421
+ '500': "Error",
2422
+ }
2423
+ response_data = self.api_client.call_api(
2424
+ *_param,
2425
+ _request_timeout=_request_timeout
2426
+ )
2427
+ return response_data.response
2428
+
2429
+
2430
+ def _update_alert_receiver_by_id_serialize(
2431
+ self,
2432
+ receiver_id,
2433
+ create_alert_receiver_request,
2434
+ _request_auth,
2435
+ _content_type,
2436
+ _headers,
2437
+ _host_index,
2438
+ ) -> RequestSerialized:
2439
+
2440
+ _host = None
2441
+
2442
+ _collection_formats: Dict[str, str] = {
2443
+ }
2444
+
2445
+ _path_params: Dict[str, str] = {}
2446
+ _query_params: List[Tuple[str, str]] = []
2447
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2448
+ _form_params: List[Tuple[str, str]] = []
2449
+ _files: Dict[str, Union[str, bytes]] = {}
2450
+ _body_params: Optional[bytes] = None
2451
+
2452
+ # process the path parameters
2453
+ if receiver_id is not None:
2454
+ _path_params['receiver_id'] = receiver_id
2455
+ # process the query parameters
2456
+ # process the header parameters
2457
+ # process the form parameters
2458
+ # process the body parameter
2459
+ if create_alert_receiver_request is not None:
2460
+ _body_params = create_alert_receiver_request
2461
+
2462
+
2463
+ # set the HTTP header `Accept`
2464
+ if 'Accept' not in _header_params:
2465
+ _header_params['Accept'] = self.api_client.select_header_accept(
2466
+ [
2467
+ 'application/json'
2468
+ ]
2469
+ )
2470
+
2471
+ # set the HTTP header `Content-Type`
2472
+ if _content_type:
2473
+ _header_params['Content-Type'] = _content_type
2474
+ else:
2475
+ _default_content_type = (
2476
+ self.api_client.select_header_content_type(
2477
+ [
2478
+ 'application/json'
2479
+ ]
2480
+ )
2481
+ )
2482
+ if _default_content_type is not None:
2483
+ _header_params['Content-Type'] = _default_content_type
2484
+
2485
+ # authentication setting
2486
+ _auth_settings: List[str] = [
2487
+ ]
2488
+
2489
+ return self.api_client.param_serialize(
2490
+ method='PUT',
2491
+ resource_path='/api/v1/alert/receiver/{receiver_id}',
2492
+ path_params=_path_params,
2493
+ query_params=_query_params,
2494
+ header_params=_header_params,
2495
+ body=_body_params,
2496
+ post_params=_form_params,
2497
+ files=_files,
2498
+ auth_settings=_auth_settings,
2499
+ collection_formats=_collection_formats,
2500
+ _host=_host,
2501
+ _request_auth=_request_auth
2502
+ )
2503
+
2504
+
2505
+
2506
+
2507
+ @validate_call
2508
+ def update_alert_rule_by_id(
2509
+ self,
2510
+ rule_id: StrictStr,
2511
+ create_alert_rule_request: Optional[CreateAlertRuleRequest] = None,
2512
+ _request_timeout: Union[
2513
+ None,
2514
+ Annotated[StrictFloat, Field(gt=0)],
2515
+ Tuple[
2516
+ Annotated[StrictFloat, Field(gt=0)],
2517
+ Annotated[StrictFloat, Field(gt=0)]
2518
+ ]
2519
+ ] = None,
2520
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2521
+ _content_type: Optional[StrictStr] = None,
2522
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2523
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2524
+ ) -> str:
2525
+ """update_alert_rule_by_id
2526
+
2527
+
2528
+ :param rule_id: (required)
2529
+ :type rule_id: str
2530
+ :param create_alert_rule_request:
2531
+ :type create_alert_rule_request: CreateAlertRuleRequest
2532
+ :param _request_timeout: timeout setting for this request. If one
2533
+ number provided, it will be total request
2534
+ timeout. It can also be a pair (tuple) of
2535
+ (connection, read) timeouts.
2536
+ :type _request_timeout: int, tuple(int, int), optional
2537
+ :param _request_auth: set to override the auth_settings for an a single
2538
+ request; this effectively ignores the
2539
+ authentication in the spec for a single request.
2540
+ :type _request_auth: dict, optional
2541
+ :param _content_type: force content-type for the request.
2542
+ :type _content_type: str, Optional
2543
+ :param _headers: set to override the headers for a single
2544
+ request; this effectively ignores the headers
2545
+ in the spec for a single request.
2546
+ :type _headers: dict, optional
2547
+ :param _host_index: set to override the host_index for a single
2548
+ request; this effectively ignores the host_index
2549
+ in the spec for a single request.
2550
+ :type _host_index: int, optional
2551
+ :return: Returns the result object.
2552
+ """ # noqa: E501
2553
+
2554
+ _param = self._update_alert_rule_by_id_serialize(
2555
+ rule_id=rule_id,
2556
+ create_alert_rule_request=create_alert_rule_request,
2557
+ _request_auth=_request_auth,
2558
+ _content_type=_content_type,
2559
+ _headers=_headers,
2560
+ _host_index=_host_index
2561
+ )
2562
+
2563
+ _response_types_map: Dict[str, Optional[str]] = {
2564
+ '200': "str",
2565
+ '500': "Error",
2566
+ }
2567
+ response_data = self.api_client.call_api(
2568
+ *_param,
2569
+ _request_timeout=_request_timeout
2570
+ )
2571
+ response_data.read()
2572
+ return self.api_client.response_deserialize(
2573
+ response_data=response_data,
2574
+ response_types_map=_response_types_map,
2575
+ ).data
2576
+
2577
+
2578
+ @validate_call
2579
+ def update_alert_rule_by_id_with_http_info(
2580
+ self,
2581
+ rule_id: StrictStr,
2582
+ create_alert_rule_request: Optional[CreateAlertRuleRequest] = None,
2583
+ _request_timeout: Union[
2584
+ None,
2585
+ Annotated[StrictFloat, Field(gt=0)],
2586
+ Tuple[
2587
+ Annotated[StrictFloat, Field(gt=0)],
2588
+ Annotated[StrictFloat, Field(gt=0)]
2589
+ ]
2590
+ ] = None,
2591
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2592
+ _content_type: Optional[StrictStr] = None,
2593
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2594
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2595
+ ) -> ApiResponse[str]:
2596
+ """update_alert_rule_by_id
2597
+
2598
+
2599
+ :param rule_id: (required)
2600
+ :type rule_id: str
2601
+ :param create_alert_rule_request:
2602
+ :type create_alert_rule_request: CreateAlertRuleRequest
2603
+ :param _request_timeout: timeout setting for this request. If one
2604
+ number provided, it will be total request
2605
+ timeout. It can also be a pair (tuple) of
2606
+ (connection, read) timeouts.
2607
+ :type _request_timeout: int, tuple(int, int), optional
2608
+ :param _request_auth: set to override the auth_settings for an a single
2609
+ request; this effectively ignores the
2610
+ authentication in the spec for a single request.
2611
+ :type _request_auth: dict, optional
2612
+ :param _content_type: force content-type for the request.
2613
+ :type _content_type: str, Optional
2614
+ :param _headers: set to override the headers for a single
2615
+ request; this effectively ignores the headers
2616
+ in the spec for a single request.
2617
+ :type _headers: dict, optional
2618
+ :param _host_index: set to override the host_index for a single
2619
+ request; this effectively ignores the host_index
2620
+ in the spec for a single request.
2621
+ :type _host_index: int, optional
2622
+ :return: Returns the result object.
2623
+ """ # noqa: E501
2624
+
2625
+ _param = self._update_alert_rule_by_id_serialize(
2626
+ rule_id=rule_id,
2627
+ create_alert_rule_request=create_alert_rule_request,
2628
+ _request_auth=_request_auth,
2629
+ _content_type=_content_type,
2630
+ _headers=_headers,
2631
+ _host_index=_host_index
2632
+ )
2633
+
2634
+ _response_types_map: Dict[str, Optional[str]] = {
2635
+ '200': "str",
2636
+ '500': "Error",
2637
+ }
2638
+ response_data = self.api_client.call_api(
2639
+ *_param,
2640
+ _request_timeout=_request_timeout
2641
+ )
2642
+ response_data.read()
2643
+ return self.api_client.response_deserialize(
2644
+ response_data=response_data,
2645
+ response_types_map=_response_types_map,
2646
+ )
2647
+
2648
+
2649
+ @validate_call
2650
+ def update_alert_rule_by_id_without_preload_content(
2651
+ self,
2652
+ rule_id: StrictStr,
2653
+ create_alert_rule_request: Optional[CreateAlertRuleRequest] = None,
2654
+ _request_timeout: Union[
2655
+ None,
2656
+ Annotated[StrictFloat, Field(gt=0)],
2657
+ Tuple[
2658
+ Annotated[StrictFloat, Field(gt=0)],
2659
+ Annotated[StrictFloat, Field(gt=0)]
2660
+ ]
2661
+ ] = None,
2662
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2663
+ _content_type: Optional[StrictStr] = None,
2664
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2665
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2666
+ ) -> RESTResponseType:
2667
+ """update_alert_rule_by_id
2668
+
2669
+
2670
+ :param rule_id: (required)
2671
+ :type rule_id: str
2672
+ :param create_alert_rule_request:
2673
+ :type create_alert_rule_request: CreateAlertRuleRequest
2674
+ :param _request_timeout: timeout setting for this request. If one
2675
+ number provided, it will be total request
2676
+ timeout. It can also be a pair (tuple) of
2677
+ (connection, read) timeouts.
2678
+ :type _request_timeout: int, tuple(int, int), optional
2679
+ :param _request_auth: set to override the auth_settings for an a single
2680
+ request; this effectively ignores the
2681
+ authentication in the spec for a single request.
2682
+ :type _request_auth: dict, optional
2683
+ :param _content_type: force content-type for the request.
2684
+ :type _content_type: str, Optional
2685
+ :param _headers: set to override the headers for a single
2686
+ request; this effectively ignores the headers
2687
+ in the spec for a single request.
2688
+ :type _headers: dict, optional
2689
+ :param _host_index: set to override the host_index for a single
2690
+ request; this effectively ignores the host_index
2691
+ in the spec for a single request.
2692
+ :type _host_index: int, optional
2693
+ :return: Returns the result object.
2694
+ """ # noqa: E501
2695
+
2696
+ _param = self._update_alert_rule_by_id_serialize(
2697
+ rule_id=rule_id,
2698
+ create_alert_rule_request=create_alert_rule_request,
2699
+ _request_auth=_request_auth,
2700
+ _content_type=_content_type,
2701
+ _headers=_headers,
2702
+ _host_index=_host_index
2703
+ )
2704
+
2705
+ _response_types_map: Dict[str, Optional[str]] = {
2706
+ '200': "str",
2707
+ '500': "Error",
2708
+ }
2709
+ response_data = self.api_client.call_api(
2710
+ *_param,
2711
+ _request_timeout=_request_timeout
2712
+ )
2713
+ return response_data.response
2714
+
2715
+
2716
+ def _update_alert_rule_by_id_serialize(
2717
+ self,
2718
+ rule_id,
2719
+ create_alert_rule_request,
2720
+ _request_auth,
2721
+ _content_type,
2722
+ _headers,
2723
+ _host_index,
2724
+ ) -> RequestSerialized:
2725
+
2726
+ _host = None
2727
+
2728
+ _collection_formats: Dict[str, str] = {
2729
+ }
2730
+
2731
+ _path_params: Dict[str, str] = {}
2732
+ _query_params: List[Tuple[str, str]] = []
2733
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2734
+ _form_params: List[Tuple[str, str]] = []
2735
+ _files: Dict[str, Union[str, bytes]] = {}
2736
+ _body_params: Optional[bytes] = None
2737
+
2738
+ # process the path parameters
2739
+ if rule_id is not None:
2740
+ _path_params['rule_id'] = rule_id
2741
+ # process the query parameters
2742
+ # process the header parameters
2743
+ # process the form parameters
2744
+ # process the body parameter
2745
+ if create_alert_rule_request is not None:
2746
+ _body_params = create_alert_rule_request
2747
+
2748
+
2749
+ # set the HTTP header `Accept`
2750
+ if 'Accept' not in _header_params:
2751
+ _header_params['Accept'] = self.api_client.select_header_accept(
2752
+ [
2753
+ 'application/json'
2754
+ ]
2755
+ )
2756
+
2757
+ # set the HTTP header `Content-Type`
2758
+ if _content_type:
2759
+ _header_params['Content-Type'] = _content_type
2760
+ else:
2761
+ _default_content_type = (
2762
+ self.api_client.select_header_content_type(
2763
+ [
2764
+ 'application/json'
2765
+ ]
2766
+ )
2767
+ )
2768
+ if _default_content_type is not None:
2769
+ _header_params['Content-Type'] = _default_content_type
2770
+
2771
+ # authentication setting
2772
+ _auth_settings: List[str] = [
2773
+ ]
2774
+
2775
+ return self.api_client.param_serialize(
2776
+ method='PUT',
2777
+ resource_path='/api/v1/alert/rule/{rule_id}',
2778
+ path_params=_path_params,
2779
+ query_params=_query_params,
2780
+ header_params=_header_params,
2781
+ body=_body_params,
2782
+ post_params=_form_params,
2783
+ files=_files,
2784
+ auth_settings=_auth_settings,
2785
+ collection_formats=_collection_formats,
2786
+ _host=_host,
2787
+ _request_auth=_request_auth
2788
+ )
2789
+
2790
+