baiducloud-python-sdk-cprom 0.0.1__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.
Files changed (95) hide show
  1. baiducloud_python_sdk_cprom/__init__.py +5 -0
  2. baiducloud_python_sdk_cprom/api/__init__.py +0 -0
  3. baiducloud_python_sdk_cprom/api/cprom_client.py +1197 -0
  4. baiducloud_python_sdk_cprom/models/__init__.py +90 -0
  5. baiducloud_python_sdk_cprom/models/bind_cluster_request.py +72 -0
  6. baiducloud_python_sdk_cprom/models/bind_cluster_response.py +61 -0
  7. baiducloud_python_sdk_cprom/models/callback_config.py +68 -0
  8. baiducloud_python_sdk_cprom/models/claim_alert_event_request.py +68 -0
  9. baiducloud_python_sdk_cprom/models/claim_alert_event_response.py +78 -0
  10. baiducloud_python_sdk_cprom/models/claim_condition.py +58 -0
  11. baiducloud_python_sdk_cprom/models/claimed_info.py +82 -0
  12. baiducloud_python_sdk_cprom/models/create_alert_request.py +142 -0
  13. baiducloud_python_sdk_cprom/models/create_alert_response.py +61 -0
  14. baiducloud_python_sdk_cprom/models/create_custom_scrape_task_request.py +72 -0
  15. baiducloud_python_sdk_cprom/models/create_custom_scrape_task_response.py +61 -0
  16. baiducloud_python_sdk_cprom/models/create_instance_request.py +117 -0
  17. baiducloud_python_sdk_cprom/models/create_notification_policy_request.py +149 -0
  18. baiducloud_python_sdk_cprom/models/create_notification_policy_response.py +61 -0
  19. baiducloud_python_sdk_cprom/models/create_podmonitor_request.py +98 -0
  20. baiducloud_python_sdk_cprom/models/create_podmonitor_response.py +61 -0
  21. baiducloud_python_sdk_cprom/models/create_service_monitor_request.py +98 -0
  22. baiducloud_python_sdk_cprom/models/create_service_monitor_response.py +61 -0
  23. baiducloud_python_sdk_cprom/models/delete_alert_request.py +64 -0
  24. baiducloud_python_sdk_cprom/models/delete_custom_scrape_task_request.py +70 -0
  25. baiducloud_python_sdk_cprom/models/delete_instance_request.py +64 -0
  26. baiducloud_python_sdk_cprom/models/delete_notification_policy_request.py +58 -0
  27. baiducloud_python_sdk_cprom/models/delete_podmonitor_request.py +70 -0
  28. baiducloud_python_sdk_cprom/models/delete_service_monitor_request.py +70 -0
  29. baiducloud_python_sdk_cprom/models/endpoint.py +82 -0
  30. baiducloud_python_sdk_cprom/models/escalate_param.py +78 -0
  31. baiducloud_python_sdk_cprom/models/event.py +216 -0
  32. baiducloud_python_sdk_cprom/models/event_claim_detail.py +74 -0
  33. baiducloud_python_sdk_cprom/models/generate_instance_token_request.py +72 -0
  34. baiducloud_python_sdk_cprom/models/get_alert_detail_request.py +64 -0
  35. baiducloud_python_sdk_cprom/models/get_alert_detail_response.py +136 -0
  36. baiducloud_python_sdk_cprom/models/get_alert_event_detail_request.py +58 -0
  37. baiducloud_python_sdk_cprom/models/get_alert_event_detail_response.py +218 -0
  38. baiducloud_python_sdk_cprom/models/get_cluster_bind_status_request.py +58 -0
  39. baiducloud_python_sdk_cprom/models/get_cluster_bind_status_response.py +77 -0
  40. baiducloud_python_sdk_cprom/models/get_notification_policy_request.py +58 -0
  41. baiducloud_python_sdk_cprom/models/get_notification_policy_response.py +167 -0
  42. baiducloud_python_sdk_cprom/models/label_selector.py +58 -0
  43. baiducloud_python_sdk_cprom/models/list_alert_events_request.py +159 -0
  44. baiducloud_python_sdk_cprom/models/list_alert_events_response.py +102 -0
  45. baiducloud_python_sdk_cprom/models/list_alert_templates_response.py +62 -0
  46. baiducloud_python_sdk_cprom/models/list_alerts_request.py +82 -0
  47. baiducloud_python_sdk_cprom/models/list_alerts_response.py +128 -0
  48. baiducloud_python_sdk_cprom/models/list_bindable_cloud_products_response.py +62 -0
  49. baiducloud_python_sdk_cprom/models/list_instances_request.py +82 -0
  50. baiducloud_python_sdk_cprom/models/list_instances_response.py +102 -0
  51. baiducloud_python_sdk_cprom/models/list_notification_policies_request.py +76 -0
  52. baiducloud_python_sdk_cprom/models/list_notification_policies_response.py +128 -0
  53. baiducloud_python_sdk_cprom/models/list_pod_monitors_request.py +110 -0
  54. baiducloud_python_sdk_cprom/models/list_pod_monitors_response.py +137 -0
  55. baiducloud_python_sdk_cprom/models/list_related_cloud_products_request.py +58 -0
  56. baiducloud_python_sdk_cprom/models/list_related_cloud_products_response.py +61 -0
  57. baiducloud_python_sdk_cprom/models/list_service_monitors_request.py +110 -0
  58. baiducloud_python_sdk_cprom/models/list_service_monitors_response.py +137 -0
  59. baiducloud_python_sdk_cprom/models/mentioned_user_config.py +66 -0
  60. baiducloud_python_sdk_cprom/models/monitor_instance.py +135 -0
  61. baiducloud_python_sdk_cprom/models/namespace_selector.py +58 -0
  62. baiducloud_python_sdk_cprom/models/notify_action.py +96 -0
  63. baiducloud_python_sdk_cprom/models/notify_rule.py +179 -0
  64. baiducloud_python_sdk_cprom/models/object_meta.py +66 -0
  65. baiducloud_python_sdk_cprom/models/pod_metrics_endpoint.py +74 -0
  66. baiducloud_python_sdk_cprom/models/pod_monitor.py +86 -0
  67. baiducloud_python_sdk_cprom/models/pod_monitor_item.py +92 -0
  68. baiducloud_python_sdk_cprom/models/pod_monitor_spec.py +80 -0
  69. baiducloud_python_sdk_cprom/models/remote_read_request.py +90 -0
  70. baiducloud_python_sdk_cprom/models/remote_read_response.py +127 -0
  71. baiducloud_python_sdk_cprom/models/remote_write_request.py +90 -0
  72. baiducloud_python_sdk_cprom/models/repeat_notify_config.py +90 -0
  73. baiducloud_python_sdk_cprom/models/rule_detail.py +142 -0
  74. baiducloud_python_sdk_cprom/models/rule_template.py +82 -0
  75. baiducloud_python_sdk_cprom/models/scope_detail.py +74 -0
  76. baiducloud_python_sdk_cprom/models/service_monitor.py +86 -0
  77. baiducloud_python_sdk_cprom/models/service_monitor_endpoint.py +74 -0
  78. baiducloud_python_sdk_cprom/models/service_monitor_item.py +92 -0
  79. baiducloud_python_sdk_cprom/models/service_monitor_spec.py +80 -0
  80. baiducloud_python_sdk_cprom/models/status.py +74 -0
  81. baiducloud_python_sdk_cprom/models/toggle_pod_monitor_service_request.py +70 -0
  82. baiducloud_python_sdk_cprom/models/toggle_service_monitor_service_request.py +70 -0
  83. baiducloud_python_sdk_cprom/models/update_alert_request.py +149 -0
  84. baiducloud_python_sdk_cprom/models/update_notification_policy_request.py +156 -0
  85. baiducloud_python_sdk_cprom/models/update_pod_monitor_request.py +87 -0
  86. baiducloud_python_sdk_cprom/models/update_related_cloud_products_request.py +66 -0
  87. baiducloud_python_sdk_cprom/models/update_service_monitor_request.py +87 -0
  88. baiducloud_python_sdk_cprom/models/user.py +90 -0
  89. baiducloud_python_sdk_cprom/models/user_group.py +74 -0
  90. baiducloud_python_sdk_cprom/models/webhook_detail.py +102 -0
  91. baiducloud_python_sdk_cprom-0.0.1.dist-info/LICENSE +177 -0
  92. baiducloud_python_sdk_cprom-0.0.1.dist-info/METADATA +76 -0
  93. baiducloud_python_sdk_cprom-0.0.1.dist-info/RECORD +95 -0
  94. baiducloud_python_sdk_cprom-0.0.1.dist-info/WHEEL +5 -0
  95. baiducloud_python_sdk_cprom-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,167 @@
1
+ """
2
+ Request entity for GetNotificationPolicyResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_cprom.models.user import User
7
+ from baiducloud_python_sdk_cprom.models.user_group import UserGroup
8
+ from baiducloud_python_sdk_cprom.models.callback_config import CallbackConfig
9
+ from baiducloud_python_sdk_cprom.models.escalate_param import EscalateParam
10
+
11
+
12
+ class GetNotificationPolicyResponse(BceResponse):
13
+ """
14
+ GetNotificationPolicyResponse
15
+ """
16
+
17
+ def __init__(
18
+ self,
19
+ notify_rule_id=None,
20
+ notify_rule_name=None,
21
+ start_time=None,
22
+ end_time=None,
23
+ channel=None,
24
+ receiver_type=None,
25
+ users=None,
26
+ user_groups=None,
27
+ webhook_config_list=None,
28
+ escalate_config_list=None,
29
+ repeat_notify_config=None,
30
+ update_time=None,
31
+ ):
32
+ """
33
+ Initialize GetNotificationPolicyResponse response.
34
+
35
+ :param notify_rule_id: 通知策略ID
36
+ :type notify_rule_id: str (optional)
37
+
38
+ :param notify_rule_name: 通知策略名称
39
+ :type notify_rule_name: str (optional)
40
+
41
+ :param start_time: 通知开始时间,时间格式 00:00:00
42
+ :type start_time: str (optional)
43
+
44
+ :param end_time: 通知结束时间,时间格式 23:59:59
45
+ :type end_time: str (optional)
46
+
47
+ :param channel: 通知渠道,phone:电话 , sms: 短信, email: 邮件
48
+ :type channel: List[str] (optional)
49
+
50
+ :param receiver_type: 接受者类型,user:用户,userGroup:用户组
51
+ :type receiver_type: str (optional)
52
+
53
+ :param users: 用户列表
54
+ :type users: List[User] (optional)
55
+
56
+ :param user_groups: 用户组列表
57
+ :type user_groups: List[UserGroup] (optional)
58
+
59
+ :param webhook_config_list: webhook 回调配置信息列表
60
+ :type webhook_config_list: List[CallbackConfig] (optional)
61
+
62
+ :param escalate_config_list: 通知策略升级参数列表
63
+ :type escalate_config_list: List[EscalateParam] (optional)
64
+
65
+ :param repeat_notify_config: 重复通知配置
66
+ :type repeat_notify_config: object (optional)
67
+
68
+ :param update_time: 更新时间
69
+ :type update_time: str (optional)
70
+ """
71
+ super().__init__()
72
+ self.notify_rule_id = notify_rule_id
73
+ self.notify_rule_name = notify_rule_name
74
+ self.start_time = start_time
75
+ self.end_time = end_time
76
+ self.channel = channel
77
+ self.receiver_type = receiver_type
78
+ self.users = users
79
+ self.user_groups = user_groups
80
+ self.webhook_config_list = webhook_config_list
81
+ self.escalate_config_list = escalate_config_list
82
+ self.repeat_notify_config = repeat_notify_config
83
+ self.update_time = update_time
84
+
85
+ def to_dict(self):
86
+ """
87
+ Convert the response instance to a dictionary representation.
88
+
89
+ Includes metadata from the parent BceResponse class.
90
+ Nested model objects are recursively converted to dictionaries.
91
+
92
+ :return: Dictionary representation of the response
93
+ :rtype: dict
94
+ """
95
+ _map = super().to_dict()
96
+ if _map is not None:
97
+ return _map
98
+ result = dict()
99
+ if self.metadata is not None:
100
+ result['metadata'] = dict(self.metadata)
101
+ if self.notify_rule_id is not None:
102
+ result['notifyRuleId'] = self.notify_rule_id
103
+ if self.notify_rule_name is not None:
104
+ result['notifyRuleName'] = self.notify_rule_name
105
+ if self.start_time is not None:
106
+ result['startTime'] = self.start_time
107
+ if self.end_time is not None:
108
+ result['endTime'] = self.end_time
109
+ if self.channel is not None:
110
+ result['channel'] = self.channel
111
+ if self.receiver_type is not None:
112
+ result['receiverType'] = self.receiver_type
113
+ if self.users is not None:
114
+ result['users'] = [i.to_dict() for i in self.users]
115
+ if self.user_groups is not None:
116
+ result['userGroups'] = [i.to_dict() for i in self.user_groups]
117
+ if self.webhook_config_list is not None:
118
+ result['webhookConfigList'] = [i.to_dict() for i in self.webhook_config_list]
119
+ if self.escalate_config_list is not None:
120
+ result['escalateConfigList'] = [i.to_dict() for i in self.escalate_config_list]
121
+ if self.repeat_notify_config is not None:
122
+ result['repeatNotifyConfig'] = self.repeat_notify_config
123
+ if self.update_time is not None:
124
+ result['updateTime'] = self.update_time
125
+ return result
126
+
127
+ def from_dict(self, m):
128
+ """
129
+ Populate the response instance from a dictionary.
130
+
131
+ Nested dictionaries are recursively converted to model objects.
132
+
133
+ :param m: Dictionary containing response data
134
+ :type m: dict
135
+
136
+ :return: Self reference for method chaining
137
+ :rtype: GetNotificationPolicyResponse
138
+
139
+ :raises TypeError: If input is not a dictionary or field type mismatch
140
+ :raises ValueError: If nested model conversion fails
141
+ """
142
+ m = m or dict()
143
+ if m.get('notifyRuleId') is not None:
144
+ self.notify_rule_id = m.get('notifyRuleId')
145
+ if m.get('notifyRuleName') is not None:
146
+ self.notify_rule_name = m.get('notifyRuleName')
147
+ if m.get('startTime') is not None:
148
+ self.start_time = m.get('startTime')
149
+ if m.get('endTime') is not None:
150
+ self.end_time = m.get('endTime')
151
+ if m.get('channel') is not None:
152
+ self.channel = m.get('channel')
153
+ if m.get('receiverType') is not None:
154
+ self.receiver_type = m.get('receiverType')
155
+ if m.get('users') is not None:
156
+ self.users = [User().from_dict(i) for i in m.get('users')]
157
+ if m.get('userGroups') is not None:
158
+ self.user_groups = [UserGroup().from_dict(i) for i in m.get('userGroups')]
159
+ if m.get('webhookConfigList') is not None:
160
+ self.webhook_config_list = [CallbackConfig().from_dict(i) for i in m.get('webhookConfigList')]
161
+ if m.get('escalateConfigList') is not None:
162
+ self.escalate_config_list = [EscalateParam().from_dict(i) for i in m.get('escalateConfigList')]
163
+ if m.get('repeatNotifyConfig') is not None:
164
+ self.repeat_notify_config = m.get('repeatNotifyConfig')
165
+ if m.get('updateTime') is not None:
166
+ self.update_time = m.get('updateTime')
167
+ return self
@@ -0,0 +1,58 @@
1
+ """
2
+ LabelSelector information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class LabelSelector(AbstractModel):
9
+ """
10
+ LabelSelector
11
+ """
12
+
13
+ def __init__(self, match_labels=None):
14
+ """
15
+ Initialize LabelSelector instance.
16
+
17
+ :param match_labels: 标签键值对,如{\"k8s-app\":\"metrics-server\"}
18
+ :type match_labels: Dict[str, str] (optional)
19
+ """
20
+ super().__init__()
21
+ self.match_labels = match_labels
22
+
23
+ def to_dict(self):
24
+ """
25
+ Convert the model instance to a dictionary representation.
26
+
27
+ Nested model objects are recursively converted to dictionaries.
28
+
29
+ :return: Dictionary representation of the model
30
+ :rtype: dict
31
+ """
32
+ _map = super().to_dict()
33
+ if _map is not None:
34
+ return _map
35
+ result = dict()
36
+ if self.match_labels is not None:
37
+ result['matchLabels'] = self.match_labels
38
+ return result
39
+
40
+ def from_dict(self, m):
41
+ """
42
+ Populate the model instance from a dictionary.
43
+
44
+ Nested dictionaries are recursively converted to model objects.
45
+
46
+ :param m: Dictionary containing model data
47
+ :type m: dict
48
+
49
+ :return: Self reference for method chaining
50
+ :rtype: LabelSelector
51
+
52
+ :raises TypeError: If input is not a dictionary type
53
+ :raises ValueError: If nested model conversion fails
54
+ """
55
+ m = m or dict()
56
+ if m.get('matchLabels') is not None:
57
+ self.match_labels = m.get('matchLabels')
58
+ return self
@@ -0,0 +1,159 @@
1
+ """
2
+ Request entity for ListAlertEventsRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ListAlertEventsRequest(AbstractModel):
9
+ """
10
+ Request entity for ListAlertEventsRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ start_time=None,
18
+ end_time=None,
19
+ page_no=None,
20
+ page_size=None,
21
+ monitor_instance_id=None,
22
+ alerting_rule_id=None,
23
+ alerting_rule_name=None,
24
+ notify_rule_id=None,
25
+ notify_rule_name=None,
26
+ severity=None,
27
+ status=None,
28
+ expr=None,
29
+ order_by=None,
30
+ order=None,
31
+ alarm_tags=None,
32
+ ):
33
+ """
34
+ Initialize ListAlertEventsRequest request entity.
35
+
36
+ :param start_time: start_time parameter
37
+ :type start_time: int (optional)
38
+
39
+ :param end_time: end_time parameter
40
+ :type end_time: int (optional)
41
+
42
+ :param page_no: page_no parameter
43
+ :type page_no: int (optional)
44
+
45
+ :param page_size: page_size parameter
46
+ :type page_size: int (optional)
47
+
48
+ :param monitor_instance_id: monitor_instance_id parameter
49
+ :type monitor_instance_id: str (optional)
50
+
51
+ :param alerting_rule_id: alerting_rule_id parameter
52
+ :type alerting_rule_id: str (optional)
53
+
54
+ :param alerting_rule_name: alerting_rule_name parameter
55
+ :type alerting_rule_name: str (optional)
56
+
57
+ :param notify_rule_id: notify_rule_id parameter
58
+ :type notify_rule_id: str (optional)
59
+
60
+ :param notify_rule_name: notify_rule_name parameter
61
+ :type notify_rule_name: str (optional)
62
+
63
+ :param severity: severity parameter
64
+ :type severity: str (optional)
65
+
66
+ :param status: status parameter
67
+ :type status: str (optional)
68
+
69
+ :param expr: expr parameter
70
+ :type expr: str (optional)
71
+
72
+ :param order_by: order_by parameter
73
+ :type order_by: str (optional)
74
+
75
+ :param order: order parameter
76
+ :type order: str (optional)
77
+
78
+ :param alarm_tags: alarm_tags parameter
79
+ :type alarm_tags: str (optional)
80
+ """
81
+ super().__init__()
82
+ self.start_time = start_time
83
+ self.end_time = end_time
84
+ self.page_no = page_no
85
+ self.page_size = page_size
86
+ self.monitor_instance_id = monitor_instance_id
87
+ self.alerting_rule_id = alerting_rule_id
88
+ self.alerting_rule_name = alerting_rule_name
89
+ self.notify_rule_id = notify_rule_id
90
+ self.notify_rule_name = notify_rule_name
91
+ self.severity = severity
92
+ self.status = status
93
+ self.expr = expr
94
+ self.order_by = order_by
95
+ self.order = order
96
+ self.alarm_tags = alarm_tags
97
+
98
+ def to_dict(self):
99
+ """
100
+ Convert the request entity to a dictionary representation.
101
+
102
+ Nested model objects are recursively converted to dictionaries.
103
+
104
+ :return: Dictionary representation of the request
105
+ :rtype: dict
106
+ """
107
+ _map = super().to_dict()
108
+ if _map is not None:
109
+ return _map
110
+ result = dict()
111
+ return result
112
+
113
+ def from_dict(self, m):
114
+ """
115
+ Populate the request entity from a dictionary.
116
+
117
+ Nested dictionaries are recursively converted to model objects.
118
+
119
+ :param m: Dictionary containing request data
120
+ :type m: dict
121
+
122
+ :return: Self reference for method chaining
123
+ :rtype: ListAlertEventsRequest
124
+
125
+ :raises TypeError: If input is not a dictionary or field type mismatch
126
+ :raises ValueError: If nested model conversion fails
127
+ """
128
+ m = m or dict()
129
+ if m.get('startTime') is not None:
130
+ self.start_time = m.get('startTime')
131
+ if m.get('endTime') is not None:
132
+ self.end_time = m.get('endTime')
133
+ if m.get('pageNo') is not None:
134
+ self.page_no = m.get('pageNo')
135
+ if m.get('pageSize') is not None:
136
+ self.page_size = m.get('pageSize')
137
+ if m.get('monitorInstanceId') is not None:
138
+ self.monitor_instance_id = m.get('monitorInstanceId')
139
+ if m.get('alertingRuleId') is not None:
140
+ self.alerting_rule_id = m.get('alertingRuleId')
141
+ if m.get('alertingRuleName') is not None:
142
+ self.alerting_rule_name = m.get('alertingRuleName')
143
+ if m.get('notifyRuleId') is not None:
144
+ self.notify_rule_id = m.get('notifyRuleId')
145
+ if m.get('notifyRuleName') is not None:
146
+ self.notify_rule_name = m.get('notifyRuleName')
147
+ if m.get('severity') is not None:
148
+ self.severity = m.get('severity')
149
+ if m.get('status') is not None:
150
+ self.status = m.get('status')
151
+ if m.get('expr') is not None:
152
+ self.expr = m.get('expr')
153
+ if m.get('orderBy') is not None:
154
+ self.order_by = m.get('orderBy')
155
+ if m.get('order') is not None:
156
+ self.order = m.get('order')
157
+ if m.get('alarmTags') is not None:
158
+ self.alarm_tags = m.get('alarmTags')
159
+ return self
@@ -0,0 +1,102 @@
1
+ """
2
+ Request entity for ListAlertEventsResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_cprom.models.event import Event
7
+
8
+
9
+ class ListAlertEventsResponse(BceResponse):
10
+ """
11
+ ListAlertEventsResponse
12
+ """
13
+
14
+ def __init__(self, total_count=None, page_no=None, page_size=None, items=None, order_by=None, order=None):
15
+ """
16
+ Initialize ListAlertEventsResponse response.
17
+
18
+ :param total_count: 告警事件总个数
19
+ :type total_count: int (optional)
20
+
21
+ :param page_no: 当前页码数
22
+ :type page_no: int (optional)
23
+
24
+ :param page_size: 当前页告警事件个数
25
+ :type page_size: int (optional)
26
+
27
+ :param items: 告警事件列表
28
+ :type items: List[Event] (optional)
29
+
30
+ :param order_by: 排序依据字段
31
+ :type order_by: str (optional)
32
+
33
+ :param order: 排序方式:desc 倒序,asc 升序
34
+ :type order: str (optional)
35
+ """
36
+ super().__init__()
37
+ self.total_count = total_count
38
+ self.page_no = page_no
39
+ self.page_size = page_size
40
+ self.items = items
41
+ self.order_by = order_by
42
+ self.order = order
43
+
44
+ def to_dict(self):
45
+ """
46
+ Convert the response instance to a dictionary representation.
47
+
48
+ Includes metadata from the parent BceResponse class.
49
+ Nested model objects are recursively converted to dictionaries.
50
+
51
+ :return: Dictionary representation of the response
52
+ :rtype: dict
53
+ """
54
+ _map = super().to_dict()
55
+ if _map is not None:
56
+ return _map
57
+ result = dict()
58
+ if self.metadata is not None:
59
+ result['metadata'] = dict(self.metadata)
60
+ if self.total_count is not None:
61
+ result['totalCount'] = self.total_count
62
+ if self.page_no is not None:
63
+ result['pageNo'] = self.page_no
64
+ if self.page_size is not None:
65
+ result['pageSize'] = self.page_size
66
+ if self.items is not None:
67
+ result['items'] = [i.to_dict() for i in self.items]
68
+ if self.order_by is not None:
69
+ result['orderBy'] = self.order_by
70
+ if self.order is not None:
71
+ result['order'] = self.order
72
+ return result
73
+
74
+ def from_dict(self, m):
75
+ """
76
+ Populate the response instance from a dictionary.
77
+
78
+ Nested dictionaries are recursively converted to model objects.
79
+
80
+ :param m: Dictionary containing response data
81
+ :type m: dict
82
+
83
+ :return: Self reference for method chaining
84
+ :rtype: ListAlertEventsResponse
85
+
86
+ :raises TypeError: If input is not a dictionary or field type mismatch
87
+ :raises ValueError: If nested model conversion fails
88
+ """
89
+ m = m or dict()
90
+ if m.get('totalCount') is not None:
91
+ self.total_count = m.get('totalCount')
92
+ if m.get('pageNo') is not None:
93
+ self.page_no = m.get('pageNo')
94
+ if m.get('pageSize') is not None:
95
+ self.page_size = m.get('pageSize')
96
+ if m.get('items') is not None:
97
+ self.items = [Event().from_dict(i) for i in m.get('items')]
98
+ if m.get('orderBy') is not None:
99
+ self.order_by = m.get('orderBy')
100
+ if m.get('order') is not None:
101
+ self.order = m.get('order')
102
+ return self
@@ -0,0 +1,62 @@
1
+ """
2
+ Request entity for ListAlertTemplatesResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_cprom.models.rule_template import RuleTemplate
7
+
8
+
9
+ class ListAlertTemplatesResponse(BceResponse):
10
+ """
11
+ ListAlertTemplatesResponse
12
+ """
13
+
14
+ def __init__(self, rule_templates=None):
15
+ """
16
+ Initialize ListAlertTemplatesResponse response.
17
+
18
+ :param rule_templates: 告警模板列表
19
+ :type rule_templates: List[RuleTemplate] (optional)
20
+ """
21
+ super().__init__()
22
+ self.rule_templates = rule_templates
23
+
24
+ def to_dict(self):
25
+ """
26
+ Convert the response instance to a dictionary representation.
27
+
28
+ Includes metadata from the parent BceResponse class.
29
+ Nested model objects are recursively converted to dictionaries.
30
+
31
+ :return: Dictionary representation of the response
32
+ :rtype: dict
33
+ """
34
+ _map = super().to_dict()
35
+ if _map is not None:
36
+ return _map
37
+ result = dict()
38
+ if self.metadata is not None:
39
+ result['metadata'] = dict(self.metadata)
40
+ if self.rule_templates is not None:
41
+ result['ruleTemplates'] = [i.to_dict() for i in self.rule_templates]
42
+ return result
43
+
44
+ def from_dict(self, m):
45
+ """
46
+ Populate the response instance from a dictionary.
47
+
48
+ Nested dictionaries are recursively converted to model objects.
49
+
50
+ :param m: Dictionary containing response data
51
+ :type m: dict
52
+
53
+ :return: Self reference for method chaining
54
+ :rtype: ListAlertTemplatesResponse
55
+
56
+ :raises TypeError: If input is not a dictionary or field type mismatch
57
+ :raises ValueError: If nested model conversion fails
58
+ """
59
+ m = m or dict()
60
+ if m.get('ruleTemplates') is not None:
61
+ self.rule_templates = [RuleTemplate().from_dict(i) for i in m.get('ruleTemplates')]
62
+ return self
@@ -0,0 +1,82 @@
1
+ """
2
+ Request entity for ListAlertsRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ListAlertsRequest(AbstractModel):
9
+ """
10
+ Request entity for ListAlertsRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(self, instance_id, page_size=None, page_no=None, keyword_type=None, keyword=None):
16
+ """
17
+ Initialize ListAlertsRequest request entity.
18
+
19
+ :param instance_id: instance_id parameter
20
+ :type instance_id: str (required)
21
+
22
+ :param page_size: page_size parameter
23
+ :type page_size: int (optional)
24
+
25
+ :param page_no: page_no parameter
26
+ :type page_no: int (optional)
27
+
28
+ :param keyword_type: keyword_type parameter
29
+ :type keyword_type: str (optional)
30
+
31
+ :param keyword: keyword parameter
32
+ :type keyword: str (optional)
33
+ """
34
+ super().__init__()
35
+ self.instance_id = instance_id
36
+ self.page_size = page_size
37
+ self.page_no = page_no
38
+ self.keyword_type = keyword_type
39
+ self.keyword = keyword
40
+
41
+ def to_dict(self):
42
+ """
43
+ Convert the request entity to a dictionary representation.
44
+
45
+ Nested model objects are recursively converted to dictionaries.
46
+
47
+ :return: Dictionary representation of the request
48
+ :rtype: dict
49
+ """
50
+ _map = super().to_dict()
51
+ if _map is not None:
52
+ return _map
53
+ result = dict()
54
+ return result
55
+
56
+ def from_dict(self, m):
57
+ """
58
+ Populate the request entity from a dictionary.
59
+
60
+ Nested dictionaries are recursively converted to model objects.
61
+
62
+ :param m: Dictionary containing request data
63
+ :type m: dict
64
+
65
+ :return: Self reference for method chaining
66
+ :rtype: ListAlertsRequest
67
+
68
+ :raises TypeError: If input is not a dictionary or field type mismatch
69
+ :raises ValueError: If nested model conversion fails
70
+ """
71
+ m = m or dict()
72
+ if m.get('instanceId') is not None:
73
+ self.instance_id = m.get('instanceId')
74
+ if m.get('pageSize') is not None:
75
+ self.page_size = m.get('pageSize')
76
+ if m.get('pageNo') is not None:
77
+ self.page_no = m.get('pageNo')
78
+ if m.get('keywordType') is not None:
79
+ self.keyword_type = m.get('keywordType')
80
+ if m.get('keyword') is not None:
81
+ self.keyword = m.get('keyword')
82
+ return self