huaweicloudsdkaom 3.1.170__py3-none-any.whl → 3.1.172__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of huaweicloudsdkaom might be problematic. Click here for more details.

@@ -60,6 +60,14 @@ class AomRegion:
60
60
  "https://aom.af-north-1.myhuaweicloud.com")
61
61
  CN_NORTH_12 = Region("cn-north-12",
62
62
  "https://aom.cn-north-12.myhuaweicloud.com")
63
+ CN_EAST_5 = Region("cn-east-5",
64
+ "https://aom.cn-east-5.myhuaweicloud.com")
65
+ CN_EAST_4 = Region("cn-east-4",
66
+ "https://aom.cn-east-4.myhuaweicloud.com")
67
+ CN_NORTH_11 = Region("cn-north-11",
68
+ "https://aom.cn-north-11.myhuaweicloud.com")
69
+ CN_SOUTHWEST_3 = Region("cn-southwest-3",
70
+ "https://aom.cn-southwest-3.myhuaweicloud.com")
63
71
 
64
72
  static_fields = {
65
73
  "cn-north-4": CN_NORTH_4,
@@ -89,6 +97,10 @@ class AomRegion:
89
97
  "ap-southeast-5": AP_SOUTHEAST_5,
90
98
  "af-north-1": AF_NORTH_1,
91
99
  "cn-north-12": CN_NORTH_12,
100
+ "cn-east-5": CN_EAST_5,
101
+ "cn-east-4": CN_EAST_4,
102
+ "cn-north-11": CN_NORTH_11,
103
+ "cn-southwest-3": CN_SOUTHWEST_3,
92
104
  }
93
105
 
94
106
  @classmethod
@@ -32,6 +32,12 @@ from huaweicloudsdkaom.v2.model.app_rules import AppRules
32
32
  from huaweicloudsdkaom.v2.model.app_rules_body import AppRulesBody
33
33
  from huaweicloudsdkaom.v2.model.app_rules_spec import AppRulesSpec
34
34
  from huaweicloudsdkaom.v2.model.application_name_rule import ApplicationNameRule
35
+ from huaweicloudsdkaom.v2.model.batch_alarm_rules_body import BatchAlarmRulesBody
36
+ from huaweicloudsdkaom.v2.model.batch_update_action_rules import BatchUpdateActionRules
37
+ from huaweicloudsdkaom.v2.model.batch_update_alarm_rule_request import BatchUpdateAlarmRuleRequest
38
+ from huaweicloudsdkaom.v2.model.batch_update_alarm_rule_response import BatchUpdateAlarmRuleResponse
39
+ from huaweicloudsdkaom.v2.model.batch_update_item_result import BatchUpdateItemResult
40
+ from huaweicloudsdkaom.v2.model.batch_update_request import BatchUpdateRequest
35
41
  from huaweicloudsdkaom.v2.model.cmdb_info import CmdbInfo
36
42
  from huaweicloudsdkaom.v2.model.count_events_request import CountEventsRequest
37
43
  from huaweicloudsdkaom.v2.model.count_events_response import CountEventsResponse
@@ -492,6 +492,75 @@ class AomAsyncClient(Client):
492
492
 
493
493
  return http_info
494
494
 
495
+ def batch_update_alarm_rule_async(self, request):
496
+ r"""批量更新Prometheus监控告警规则
497
+
498
+ 该接口用于批量启停Prometheus监控告警规则、批量修改Prometheus监控告警规则的告警行动规则。
499
+
500
+ Please refer to HUAWEI cloud API Explorer for details.
501
+
502
+
503
+ :param request: Request instance for BatchUpdateAlarmRule
504
+ :type request: :class:`huaweicloudsdkaom.v2.BatchUpdateAlarmRuleRequest`
505
+ :rtype: :class:`huaweicloudsdkaom.v2.BatchUpdateAlarmRuleResponse`
506
+ """
507
+ http_info = self._batch_update_alarm_rule_http_info(request)
508
+ return self._call_api(**http_info)
509
+
510
+ def batch_update_alarm_rule_async_invoker(self, request):
511
+ http_info = self._batch_update_alarm_rule_http_info(request)
512
+ return AsyncInvoker(self, http_info)
513
+
514
+ def _batch_update_alarm_rule_http_info(self, request):
515
+ http_info = {
516
+ "method": "PUT",
517
+ "resource_path": "/v4/{project_id}/alarm-rules/batch-update",
518
+ "request_type": request.__class__.__name__,
519
+ "response_type": "BatchUpdateAlarmRuleResponse"
520
+ }
521
+
522
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
523
+
524
+ cname = None
525
+
526
+ collection_formats = {}
527
+
528
+ path_params = {}
529
+
530
+ query_params = []
531
+ if 'action' in local_var_params:
532
+ query_params.append(('action', local_var_params['action']))
533
+
534
+ header_params = {}
535
+ if 'enterprise_project_id' in local_var_params:
536
+ header_params['Enterprise-Project-Id'] = local_var_params['enterprise_project_id']
537
+
538
+ form_params = {}
539
+
540
+ body = None
541
+ if 'body' in local_var_params:
542
+ body = local_var_params['body']
543
+ if isinstance(request, SdkStreamRequest):
544
+ body = request.get_file_stream()
545
+
546
+ response_headers = []
547
+
548
+ header_params['Content-Type'] = http_utils.select_header_content_type(
549
+ ['application/json'])
550
+
551
+ auth_settings = []
552
+
553
+ http_info["cname"] = cname
554
+ http_info["collection_formats"] = collection_formats
555
+ http_info["path_params"] = path_params
556
+ http_info["query_params"] = query_params
557
+ http_info["header_params"] = header_params
558
+ http_info["post_params"] = form_params
559
+ http_info["body"] = body
560
+ http_info["response_headers"] = response_headers
561
+
562
+ return http_info
563
+
495
564
  def count_events_async(self, request):
496
565
  r"""统计事件告警信息
497
566
 
@@ -492,6 +492,75 @@ class AomClient(Client):
492
492
 
493
493
  return http_info
494
494
 
495
+ def batch_update_alarm_rule(self, request):
496
+ r"""批量更新Prometheus监控告警规则
497
+
498
+ 该接口用于批量启停Prometheus监控告警规则、批量修改Prometheus监控告警规则的告警行动规则。
499
+
500
+ Please refer to HUAWEI cloud API Explorer for details.
501
+
502
+ :param request: Request instance for BatchUpdateAlarmRule
503
+ :type request: :class:`huaweicloudsdkaom.v2.BatchUpdateAlarmRuleRequest`
504
+ :rtype: :class:`huaweicloudsdkaom.v2.BatchUpdateAlarmRuleResponse`
505
+ """
506
+ http_info = self._batch_update_alarm_rule_http_info(request)
507
+ return self._call_api(**http_info)
508
+
509
+ def batch_update_alarm_rule_invoker(self, request):
510
+ http_info = self._batch_update_alarm_rule_http_info(request)
511
+ return SyncInvoker(self, http_info)
512
+
513
+ @classmethod
514
+ def _batch_update_alarm_rule_http_info(cls, request):
515
+ http_info = {
516
+ "method": "PUT",
517
+ "resource_path": "/v4/{project_id}/alarm-rules/batch-update",
518
+ "request_type": request.__class__.__name__,
519
+ "response_type": "BatchUpdateAlarmRuleResponse"
520
+ }
521
+
522
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
523
+
524
+ cname = None
525
+
526
+ collection_formats = {}
527
+
528
+ path_params = {}
529
+
530
+ query_params = []
531
+ if 'action' in local_var_params:
532
+ query_params.append(('action', local_var_params['action']))
533
+
534
+ header_params = {}
535
+ if 'enterprise_project_id' in local_var_params:
536
+ header_params['Enterprise-Project-Id'] = local_var_params['enterprise_project_id']
537
+
538
+ form_params = {}
539
+
540
+ body = None
541
+ if 'body' in local_var_params:
542
+ body = local_var_params['body']
543
+ if isinstance(request, SdkStreamRequest):
544
+ body = request.get_file_stream()
545
+
546
+ response_headers = []
547
+
548
+ header_params['Content-Type'] = http_utils.select_header_content_type(
549
+ ['application/json'])
550
+
551
+ auth_settings = []
552
+
553
+ http_info["cname"] = cname
554
+ http_info["collection_formats"] = collection_formats
555
+ http_info["path_params"] = path_params
556
+ http_info["query_params"] = query_params
557
+ http_info["header_params"] = header_params
558
+ http_info["post_params"] = form_params
559
+ http_info["body"] = body
560
+ http_info["response_headers"] = response_headers
561
+
562
+ return http_info
563
+
495
564
  def count_events(self, request):
496
565
  r"""统计事件告警信息
497
566
 
@@ -30,6 +30,12 @@ from huaweicloudsdkaom.v2.model.app_rules import AppRules
30
30
  from huaweicloudsdkaom.v2.model.app_rules_body import AppRulesBody
31
31
  from huaweicloudsdkaom.v2.model.app_rules_spec import AppRulesSpec
32
32
  from huaweicloudsdkaom.v2.model.application_name_rule import ApplicationNameRule
33
+ from huaweicloudsdkaom.v2.model.batch_alarm_rules_body import BatchAlarmRulesBody
34
+ from huaweicloudsdkaom.v2.model.batch_update_action_rules import BatchUpdateActionRules
35
+ from huaweicloudsdkaom.v2.model.batch_update_alarm_rule_request import BatchUpdateAlarmRuleRequest
36
+ from huaweicloudsdkaom.v2.model.batch_update_alarm_rule_response import BatchUpdateAlarmRuleResponse
37
+ from huaweicloudsdkaom.v2.model.batch_update_item_result import BatchUpdateItemResult
38
+ from huaweicloudsdkaom.v2.model.batch_update_request import BatchUpdateRequest
33
39
  from huaweicloudsdkaom.v2.model.cmdb_info import CmdbInfo
34
40
  from huaweicloudsdkaom.v2.model.count_events_request import CountEventsRequest
35
41
  from huaweicloudsdkaom.v2.model.count_events_response import CountEventsResponse
@@ -0,0 +1,226 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class BatchAlarmRulesBody:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'alarm_rule_enable': 'bool',
21
+ 'alarm_rule_id': 'int',
22
+ 'alarm_rule_name': 'str',
23
+ 'alarm_rule_type': 'str',
24
+ 'enterprise_project_id': 'str'
25
+ }
26
+
27
+ attribute_map = {
28
+ 'alarm_rule_enable': 'alarm_rule_enable',
29
+ 'alarm_rule_id': 'alarm_rule_id',
30
+ 'alarm_rule_name': 'alarm_rule_name',
31
+ 'alarm_rule_type': 'alarm_rule_type',
32
+ 'enterprise_project_id': 'enterprise_project_id'
33
+ }
34
+
35
+ def __init__(self, alarm_rule_enable=None, alarm_rule_id=None, alarm_rule_name=None, alarm_rule_type=None, enterprise_project_id=None):
36
+ r"""BatchAlarmRulesBody
37
+
38
+ The model defined in huaweicloud sdk
39
+
40
+ :param alarm_rule_enable: 当前状态是否启用。
41
+ :type alarm_rule_enable: bool
42
+ :param alarm_rule_id: 告警规则id。
43
+ :type alarm_rule_id: int
44
+ :param alarm_rule_name: 告警规则名称。
45
+ :type alarm_rule_name: str
46
+ :param alarm_rule_type: 告警规则类型。 - metric:Prometheus指标 - event: 事件
47
+ :type alarm_rule_type: str
48
+ :param enterprise_project_id: 企业项目id。获取方式请参见:[获取企业项目ID](aom_04_0024.xml) 。 批量启停或批量修改单个企业项目下实例,填写企业项目id。
49
+ :type enterprise_project_id: str
50
+ """
51
+
52
+
53
+
54
+ self._alarm_rule_enable = None
55
+ self._alarm_rule_id = None
56
+ self._alarm_rule_name = None
57
+ self._alarm_rule_type = None
58
+ self._enterprise_project_id = None
59
+ self.discriminator = None
60
+
61
+ self.alarm_rule_enable = alarm_rule_enable
62
+ self.alarm_rule_id = alarm_rule_id
63
+ self.alarm_rule_name = alarm_rule_name
64
+ self.alarm_rule_type = alarm_rule_type
65
+ self.enterprise_project_id = enterprise_project_id
66
+
67
+ @property
68
+ def alarm_rule_enable(self):
69
+ r"""Gets the alarm_rule_enable of this BatchAlarmRulesBody.
70
+
71
+ 当前状态是否启用。
72
+
73
+ :return: The alarm_rule_enable of this BatchAlarmRulesBody.
74
+ :rtype: bool
75
+ """
76
+ return self._alarm_rule_enable
77
+
78
+ @alarm_rule_enable.setter
79
+ def alarm_rule_enable(self, alarm_rule_enable):
80
+ r"""Sets the alarm_rule_enable of this BatchAlarmRulesBody.
81
+
82
+ 当前状态是否启用。
83
+
84
+ :param alarm_rule_enable: The alarm_rule_enable of this BatchAlarmRulesBody.
85
+ :type alarm_rule_enable: bool
86
+ """
87
+ self._alarm_rule_enable = alarm_rule_enable
88
+
89
+ @property
90
+ def alarm_rule_id(self):
91
+ r"""Gets the alarm_rule_id of this BatchAlarmRulesBody.
92
+
93
+ 告警规则id。
94
+
95
+ :return: The alarm_rule_id of this BatchAlarmRulesBody.
96
+ :rtype: int
97
+ """
98
+ return self._alarm_rule_id
99
+
100
+ @alarm_rule_id.setter
101
+ def alarm_rule_id(self, alarm_rule_id):
102
+ r"""Sets the alarm_rule_id of this BatchAlarmRulesBody.
103
+
104
+ 告警规则id。
105
+
106
+ :param alarm_rule_id: The alarm_rule_id of this BatchAlarmRulesBody.
107
+ :type alarm_rule_id: int
108
+ """
109
+ self._alarm_rule_id = alarm_rule_id
110
+
111
+ @property
112
+ def alarm_rule_name(self):
113
+ r"""Gets the alarm_rule_name of this BatchAlarmRulesBody.
114
+
115
+ 告警规则名称。
116
+
117
+ :return: The alarm_rule_name of this BatchAlarmRulesBody.
118
+ :rtype: str
119
+ """
120
+ return self._alarm_rule_name
121
+
122
+ @alarm_rule_name.setter
123
+ def alarm_rule_name(self, alarm_rule_name):
124
+ r"""Sets the alarm_rule_name of this BatchAlarmRulesBody.
125
+
126
+ 告警规则名称。
127
+
128
+ :param alarm_rule_name: The alarm_rule_name of this BatchAlarmRulesBody.
129
+ :type alarm_rule_name: str
130
+ """
131
+ self._alarm_rule_name = alarm_rule_name
132
+
133
+ @property
134
+ def alarm_rule_type(self):
135
+ r"""Gets the alarm_rule_type of this BatchAlarmRulesBody.
136
+
137
+ 告警规则类型。 - metric:Prometheus指标 - event: 事件
138
+
139
+ :return: The alarm_rule_type of this BatchAlarmRulesBody.
140
+ :rtype: str
141
+ """
142
+ return self._alarm_rule_type
143
+
144
+ @alarm_rule_type.setter
145
+ def alarm_rule_type(self, alarm_rule_type):
146
+ r"""Sets the alarm_rule_type of this BatchAlarmRulesBody.
147
+
148
+ 告警规则类型。 - metric:Prometheus指标 - event: 事件
149
+
150
+ :param alarm_rule_type: The alarm_rule_type of this BatchAlarmRulesBody.
151
+ :type alarm_rule_type: str
152
+ """
153
+ self._alarm_rule_type = alarm_rule_type
154
+
155
+ @property
156
+ def enterprise_project_id(self):
157
+ r"""Gets the enterprise_project_id of this BatchAlarmRulesBody.
158
+
159
+ 企业项目id。获取方式请参见:[获取企业项目ID](aom_04_0024.xml) 。 批量启停或批量修改单个企业项目下实例,填写企业项目id。
160
+
161
+ :return: The enterprise_project_id of this BatchAlarmRulesBody.
162
+ :rtype: str
163
+ """
164
+ return self._enterprise_project_id
165
+
166
+ @enterprise_project_id.setter
167
+ def enterprise_project_id(self, enterprise_project_id):
168
+ r"""Sets the enterprise_project_id of this BatchAlarmRulesBody.
169
+
170
+ 企业项目id。获取方式请参见:[获取企业项目ID](aom_04_0024.xml) 。 批量启停或批量修改单个企业项目下实例,填写企业项目id。
171
+
172
+ :param enterprise_project_id: The enterprise_project_id of this BatchAlarmRulesBody.
173
+ :type enterprise_project_id: str
174
+ """
175
+ self._enterprise_project_id = enterprise_project_id
176
+
177
+ def to_dict(self):
178
+ """Returns the model properties as a dict"""
179
+ result = {}
180
+
181
+ for attr, _ in six.iteritems(self.openapi_types):
182
+ value = getattr(self, attr)
183
+ if isinstance(value, list):
184
+ result[attr] = list(map(
185
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
186
+ value
187
+ ))
188
+ elif hasattr(value, "to_dict"):
189
+ result[attr] = value.to_dict()
190
+ elif isinstance(value, dict):
191
+ result[attr] = dict(map(
192
+ lambda item: (item[0], item[1].to_dict())
193
+ if hasattr(item[1], "to_dict") else item,
194
+ value.items()
195
+ ))
196
+ else:
197
+ if attr in self.sensitive_list:
198
+ result[attr] = "****"
199
+ else:
200
+ result[attr] = value
201
+
202
+ return result
203
+
204
+ def to_str(self):
205
+ """Returns the string representation of the model"""
206
+ import simplejson as json
207
+ if six.PY2:
208
+ import sys
209
+ reload(sys)
210
+ sys.setdefaultencoding("utf-8")
211
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
212
+
213
+ def __repr__(self):
214
+ """For `print`"""
215
+ return self.to_str()
216
+
217
+ def __eq__(self, other):
218
+ """Returns true if both objects are equal"""
219
+ if not isinstance(other, BatchAlarmRulesBody):
220
+ return False
221
+
222
+ return self.__dict__ == other.__dict__
223
+
224
+ def __ne__(self, other):
225
+ """Returns true if both objects are not equal"""
226
+ return not self == other