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.
- baiducloud_python_sdk_cprom/__init__.py +5 -0
- baiducloud_python_sdk_cprom/api/__init__.py +0 -0
- baiducloud_python_sdk_cprom/api/cprom_client.py +1197 -0
- baiducloud_python_sdk_cprom/models/__init__.py +90 -0
- baiducloud_python_sdk_cprom/models/bind_cluster_request.py +72 -0
- baiducloud_python_sdk_cprom/models/bind_cluster_response.py +61 -0
- baiducloud_python_sdk_cprom/models/callback_config.py +68 -0
- baiducloud_python_sdk_cprom/models/claim_alert_event_request.py +68 -0
- baiducloud_python_sdk_cprom/models/claim_alert_event_response.py +78 -0
- baiducloud_python_sdk_cprom/models/claim_condition.py +58 -0
- baiducloud_python_sdk_cprom/models/claimed_info.py +82 -0
- baiducloud_python_sdk_cprom/models/create_alert_request.py +142 -0
- baiducloud_python_sdk_cprom/models/create_alert_response.py +61 -0
- baiducloud_python_sdk_cprom/models/create_custom_scrape_task_request.py +72 -0
- baiducloud_python_sdk_cprom/models/create_custom_scrape_task_response.py +61 -0
- baiducloud_python_sdk_cprom/models/create_instance_request.py +117 -0
- baiducloud_python_sdk_cprom/models/create_notification_policy_request.py +149 -0
- baiducloud_python_sdk_cprom/models/create_notification_policy_response.py +61 -0
- baiducloud_python_sdk_cprom/models/create_podmonitor_request.py +98 -0
- baiducloud_python_sdk_cprom/models/create_podmonitor_response.py +61 -0
- baiducloud_python_sdk_cprom/models/create_service_monitor_request.py +98 -0
- baiducloud_python_sdk_cprom/models/create_service_monitor_response.py +61 -0
- baiducloud_python_sdk_cprom/models/delete_alert_request.py +64 -0
- baiducloud_python_sdk_cprom/models/delete_custom_scrape_task_request.py +70 -0
- baiducloud_python_sdk_cprom/models/delete_instance_request.py +64 -0
- baiducloud_python_sdk_cprom/models/delete_notification_policy_request.py +58 -0
- baiducloud_python_sdk_cprom/models/delete_podmonitor_request.py +70 -0
- baiducloud_python_sdk_cprom/models/delete_service_monitor_request.py +70 -0
- baiducloud_python_sdk_cprom/models/endpoint.py +82 -0
- baiducloud_python_sdk_cprom/models/escalate_param.py +78 -0
- baiducloud_python_sdk_cprom/models/event.py +216 -0
- baiducloud_python_sdk_cprom/models/event_claim_detail.py +74 -0
- baiducloud_python_sdk_cprom/models/generate_instance_token_request.py +72 -0
- baiducloud_python_sdk_cprom/models/get_alert_detail_request.py +64 -0
- baiducloud_python_sdk_cprom/models/get_alert_detail_response.py +136 -0
- baiducloud_python_sdk_cprom/models/get_alert_event_detail_request.py +58 -0
- baiducloud_python_sdk_cprom/models/get_alert_event_detail_response.py +218 -0
- baiducloud_python_sdk_cprom/models/get_cluster_bind_status_request.py +58 -0
- baiducloud_python_sdk_cprom/models/get_cluster_bind_status_response.py +77 -0
- baiducloud_python_sdk_cprom/models/get_notification_policy_request.py +58 -0
- baiducloud_python_sdk_cprom/models/get_notification_policy_response.py +167 -0
- baiducloud_python_sdk_cprom/models/label_selector.py +58 -0
- baiducloud_python_sdk_cprom/models/list_alert_events_request.py +159 -0
- baiducloud_python_sdk_cprom/models/list_alert_events_response.py +102 -0
- baiducloud_python_sdk_cprom/models/list_alert_templates_response.py +62 -0
- baiducloud_python_sdk_cprom/models/list_alerts_request.py +82 -0
- baiducloud_python_sdk_cprom/models/list_alerts_response.py +128 -0
- baiducloud_python_sdk_cprom/models/list_bindable_cloud_products_response.py +62 -0
- baiducloud_python_sdk_cprom/models/list_instances_request.py +82 -0
- baiducloud_python_sdk_cprom/models/list_instances_response.py +102 -0
- baiducloud_python_sdk_cprom/models/list_notification_policies_request.py +76 -0
- baiducloud_python_sdk_cprom/models/list_notification_policies_response.py +128 -0
- baiducloud_python_sdk_cprom/models/list_pod_monitors_request.py +110 -0
- baiducloud_python_sdk_cprom/models/list_pod_monitors_response.py +137 -0
- baiducloud_python_sdk_cprom/models/list_related_cloud_products_request.py +58 -0
- baiducloud_python_sdk_cprom/models/list_related_cloud_products_response.py +61 -0
- baiducloud_python_sdk_cprom/models/list_service_monitors_request.py +110 -0
- baiducloud_python_sdk_cprom/models/list_service_monitors_response.py +137 -0
- baiducloud_python_sdk_cprom/models/mentioned_user_config.py +66 -0
- baiducloud_python_sdk_cprom/models/monitor_instance.py +135 -0
- baiducloud_python_sdk_cprom/models/namespace_selector.py +58 -0
- baiducloud_python_sdk_cprom/models/notify_action.py +96 -0
- baiducloud_python_sdk_cprom/models/notify_rule.py +179 -0
- baiducloud_python_sdk_cprom/models/object_meta.py +66 -0
- baiducloud_python_sdk_cprom/models/pod_metrics_endpoint.py +74 -0
- baiducloud_python_sdk_cprom/models/pod_monitor.py +86 -0
- baiducloud_python_sdk_cprom/models/pod_monitor_item.py +92 -0
- baiducloud_python_sdk_cprom/models/pod_monitor_spec.py +80 -0
- baiducloud_python_sdk_cprom/models/remote_read_request.py +90 -0
- baiducloud_python_sdk_cprom/models/remote_read_response.py +127 -0
- baiducloud_python_sdk_cprom/models/remote_write_request.py +90 -0
- baiducloud_python_sdk_cprom/models/repeat_notify_config.py +90 -0
- baiducloud_python_sdk_cprom/models/rule_detail.py +142 -0
- baiducloud_python_sdk_cprom/models/rule_template.py +82 -0
- baiducloud_python_sdk_cprom/models/scope_detail.py +74 -0
- baiducloud_python_sdk_cprom/models/service_monitor.py +86 -0
- baiducloud_python_sdk_cprom/models/service_monitor_endpoint.py +74 -0
- baiducloud_python_sdk_cprom/models/service_monitor_item.py +92 -0
- baiducloud_python_sdk_cprom/models/service_monitor_spec.py +80 -0
- baiducloud_python_sdk_cprom/models/status.py +74 -0
- baiducloud_python_sdk_cprom/models/toggle_pod_monitor_service_request.py +70 -0
- baiducloud_python_sdk_cprom/models/toggle_service_monitor_service_request.py +70 -0
- baiducloud_python_sdk_cprom/models/update_alert_request.py +149 -0
- baiducloud_python_sdk_cprom/models/update_notification_policy_request.py +156 -0
- baiducloud_python_sdk_cprom/models/update_pod_monitor_request.py +87 -0
- baiducloud_python_sdk_cprom/models/update_related_cloud_products_request.py +66 -0
- baiducloud_python_sdk_cprom/models/update_service_monitor_request.py +87 -0
- baiducloud_python_sdk_cprom/models/user.py +90 -0
- baiducloud_python_sdk_cprom/models/user_group.py +74 -0
- baiducloud_python_sdk_cprom/models/webhook_detail.py +102 -0
- baiducloud_python_sdk_cprom-0.0.1.dist-info/LICENSE +177 -0
- baiducloud_python_sdk_cprom-0.0.1.dist-info/METADATA +76 -0
- baiducloud_python_sdk_cprom-0.0.1.dist-info/RECORD +95 -0
- baiducloud_python_sdk_cprom-0.0.1.dist-info/WHEEL +5 -0
- baiducloud_python_sdk_cprom-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MonitorInstance information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cprom.models.status import Status
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MonitorInstance(AbstractModel):
|
|
11
|
+
"""
|
|
12
|
+
MonitorInstance
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(
|
|
16
|
+
self,
|
|
17
|
+
instance_id=None,
|
|
18
|
+
instance_name=None,
|
|
19
|
+
instance_spec=None,
|
|
20
|
+
instance_type=None,
|
|
21
|
+
retention_period=None,
|
|
22
|
+
create_time=None,
|
|
23
|
+
grafana_id=None,
|
|
24
|
+
grafana_name=None,
|
|
25
|
+
status=None,
|
|
26
|
+
):
|
|
27
|
+
"""
|
|
28
|
+
Initialize MonitorInstance instance.
|
|
29
|
+
|
|
30
|
+
:param instance_id: 监控实例ID
|
|
31
|
+
:type instance_id: str (optional)
|
|
32
|
+
|
|
33
|
+
:param instance_name: 监控实例名字
|
|
34
|
+
:type instance_name: str (optional)
|
|
35
|
+
|
|
36
|
+
:param instance_spec: 实例规格类型,默认为基础版\"free-v1\",可选值:advance-v1,advance-v2,free-v1
|
|
37
|
+
:type instance_spec: str (optional)
|
|
38
|
+
|
|
39
|
+
:param instance_type: 监控实例类型,默认为CCE,代表CCE型监控实例,可选值:CCE、BCM
|
|
40
|
+
:type instance_type: str (optional)
|
|
41
|
+
|
|
42
|
+
:param retention_period: 数据存储时长,示例格式: 15d
|
|
43
|
+
:type retention_period: str (optional)
|
|
44
|
+
|
|
45
|
+
:param create_time: 监控实例创建时间(0时区),格式: 2025-02-05T08:14:23Z
|
|
46
|
+
:type create_time: str (optional)
|
|
47
|
+
|
|
48
|
+
:param grafana_id: Grafana ID
|
|
49
|
+
:type grafana_id: str (optional)
|
|
50
|
+
|
|
51
|
+
:param grafana_name: Grafana名称
|
|
52
|
+
:type grafana_name: str (optional)
|
|
53
|
+
|
|
54
|
+
:param status: status attribute
|
|
55
|
+
:type status: Status (optional)
|
|
56
|
+
"""
|
|
57
|
+
super().__init__()
|
|
58
|
+
self.instance_id = instance_id
|
|
59
|
+
self.instance_name = instance_name
|
|
60
|
+
self.instance_spec = instance_spec
|
|
61
|
+
self.instance_type = instance_type
|
|
62
|
+
self.retention_period = retention_period
|
|
63
|
+
self.create_time = create_time
|
|
64
|
+
self.grafana_id = grafana_id
|
|
65
|
+
self.grafana_name = grafana_name
|
|
66
|
+
self.status = status
|
|
67
|
+
|
|
68
|
+
def to_dict(self):
|
|
69
|
+
"""
|
|
70
|
+
Convert the model instance to a dictionary representation.
|
|
71
|
+
|
|
72
|
+
Nested model objects are recursively converted to dictionaries.
|
|
73
|
+
|
|
74
|
+
:return: Dictionary representation of the model
|
|
75
|
+
:rtype: dict
|
|
76
|
+
"""
|
|
77
|
+
_map = super().to_dict()
|
|
78
|
+
if _map is not None:
|
|
79
|
+
return _map
|
|
80
|
+
result = dict()
|
|
81
|
+
if self.instance_id is not None:
|
|
82
|
+
result['instanceId'] = self.instance_id
|
|
83
|
+
if self.instance_name is not None:
|
|
84
|
+
result['instanceName'] = self.instance_name
|
|
85
|
+
if self.instance_spec is not None:
|
|
86
|
+
result['instanceSpec'] = self.instance_spec
|
|
87
|
+
if self.instance_type is not None:
|
|
88
|
+
result['instanceType'] = self.instance_type
|
|
89
|
+
if self.retention_period is not None:
|
|
90
|
+
result['retentionPeriod'] = self.retention_period
|
|
91
|
+
if self.create_time is not None:
|
|
92
|
+
result['createTime'] = self.create_time
|
|
93
|
+
if self.grafana_id is not None:
|
|
94
|
+
result['grafanaId'] = self.grafana_id
|
|
95
|
+
if self.grafana_name is not None:
|
|
96
|
+
result['grafanaName'] = self.grafana_name
|
|
97
|
+
if self.status is not None:
|
|
98
|
+
result['status'] = self.status.to_dict()
|
|
99
|
+
return result
|
|
100
|
+
|
|
101
|
+
def from_dict(self, m):
|
|
102
|
+
"""
|
|
103
|
+
Populate the model instance from a dictionary.
|
|
104
|
+
|
|
105
|
+
Nested dictionaries are recursively converted to model objects.
|
|
106
|
+
|
|
107
|
+
:param m: Dictionary containing model data
|
|
108
|
+
:type m: dict
|
|
109
|
+
|
|
110
|
+
:return: Self reference for method chaining
|
|
111
|
+
:rtype: MonitorInstance
|
|
112
|
+
|
|
113
|
+
:raises TypeError: If input is not a dictionary type
|
|
114
|
+
:raises ValueError: If nested model conversion fails
|
|
115
|
+
"""
|
|
116
|
+
m = m or dict()
|
|
117
|
+
if m.get('instanceId') is not None:
|
|
118
|
+
self.instance_id = m.get('instanceId')
|
|
119
|
+
if m.get('instanceName') is not None:
|
|
120
|
+
self.instance_name = m.get('instanceName')
|
|
121
|
+
if m.get('instanceSpec') is not None:
|
|
122
|
+
self.instance_spec = m.get('instanceSpec')
|
|
123
|
+
if m.get('instanceType') is not None:
|
|
124
|
+
self.instance_type = m.get('instanceType')
|
|
125
|
+
if m.get('retentionPeriod') is not None:
|
|
126
|
+
self.retention_period = m.get('retentionPeriod')
|
|
127
|
+
if m.get('createTime') is not None:
|
|
128
|
+
self.create_time = m.get('createTime')
|
|
129
|
+
if m.get('grafanaId') is not None:
|
|
130
|
+
self.grafana_id = m.get('grafanaId')
|
|
131
|
+
if m.get('grafanaName') is not None:
|
|
132
|
+
self.grafana_name = m.get('grafanaName')
|
|
133
|
+
if m.get('status') is not None:
|
|
134
|
+
self.status = Status().from_dict(m.get('status'))
|
|
135
|
+
return self
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NamespaceSelector information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class NamespaceSelector(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
NamespaceSelector
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, match_names=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize NamespaceSelector instance.
|
|
16
|
+
|
|
17
|
+
:param match_names: 命名空间列表
|
|
18
|
+
:type match_names: List[str] (optional)
|
|
19
|
+
"""
|
|
20
|
+
super().__init__()
|
|
21
|
+
self.match_names = match_names
|
|
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_names is not None:
|
|
37
|
+
result['matchNames'] = self.match_names
|
|
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: NamespaceSelector
|
|
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('matchNames') is not None:
|
|
57
|
+
self.match_names = m.get('matchNames')
|
|
58
|
+
return self
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NotifyAction information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cprom.models.user import User
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_cprom.models.user_group import UserGroup
|
|
10
|
+
|
|
11
|
+
from baiducloud_python_sdk_cprom.models.callback_config import CallbackConfig
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class NotifyAction(AbstractModel):
|
|
15
|
+
"""
|
|
16
|
+
NotifyAction
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, channel=None, receiver_type=None, users=None, user_groups=None, webhook_config_list=None):
|
|
20
|
+
"""
|
|
21
|
+
Initialize NotifyAction instance.
|
|
22
|
+
|
|
23
|
+
:param channel: 通知渠道,phone:电话 , sms: 短信, email: 邮件
|
|
24
|
+
:type channel: List[str] (optional)
|
|
25
|
+
|
|
26
|
+
:param receiver_type: 接受者类型,user:用户,userGroup:用户组
|
|
27
|
+
:type receiver_type: str (optional)
|
|
28
|
+
|
|
29
|
+
:param users: 用户列表
|
|
30
|
+
:type users: List[User] (optional)
|
|
31
|
+
|
|
32
|
+
:param user_groups: 用户组列表
|
|
33
|
+
:type user_groups: List[UserGroup] (optional)
|
|
34
|
+
|
|
35
|
+
:param webhook_config_list: webhook 回调配置信息列表
|
|
36
|
+
:type webhook_config_list: List[CallbackConfig] (optional)
|
|
37
|
+
"""
|
|
38
|
+
super().__init__()
|
|
39
|
+
self.channel = channel
|
|
40
|
+
self.receiver_type = receiver_type
|
|
41
|
+
self.users = users
|
|
42
|
+
self.user_groups = user_groups
|
|
43
|
+
self.webhook_config_list = webhook_config_list
|
|
44
|
+
|
|
45
|
+
def to_dict(self):
|
|
46
|
+
"""
|
|
47
|
+
Convert the model instance to a dictionary representation.
|
|
48
|
+
|
|
49
|
+
Nested model objects are recursively converted to dictionaries.
|
|
50
|
+
|
|
51
|
+
:return: Dictionary representation of the model
|
|
52
|
+
:rtype: dict
|
|
53
|
+
"""
|
|
54
|
+
_map = super().to_dict()
|
|
55
|
+
if _map is not None:
|
|
56
|
+
return _map
|
|
57
|
+
result = dict()
|
|
58
|
+
if self.channel is not None:
|
|
59
|
+
result['channel'] = self.channel
|
|
60
|
+
if self.receiver_type is not None:
|
|
61
|
+
result['receiverType'] = self.receiver_type
|
|
62
|
+
if self.users is not None:
|
|
63
|
+
result['users'] = [i.to_dict() for i in self.users]
|
|
64
|
+
if self.user_groups is not None:
|
|
65
|
+
result['userGroups'] = [i.to_dict() for i in self.user_groups]
|
|
66
|
+
if self.webhook_config_list is not None:
|
|
67
|
+
result['webhookConfigList'] = [i.to_dict() for i in self.webhook_config_list]
|
|
68
|
+
return result
|
|
69
|
+
|
|
70
|
+
def from_dict(self, m):
|
|
71
|
+
"""
|
|
72
|
+
Populate the model instance from a dictionary.
|
|
73
|
+
|
|
74
|
+
Nested dictionaries are recursively converted to model objects.
|
|
75
|
+
|
|
76
|
+
:param m: Dictionary containing model data
|
|
77
|
+
:type m: dict
|
|
78
|
+
|
|
79
|
+
:return: Self reference for method chaining
|
|
80
|
+
:rtype: NotifyAction
|
|
81
|
+
|
|
82
|
+
:raises TypeError: If input is not a dictionary type
|
|
83
|
+
:raises ValueError: If nested model conversion fails
|
|
84
|
+
"""
|
|
85
|
+
m = m or dict()
|
|
86
|
+
if m.get('channel') is not None:
|
|
87
|
+
self.channel = m.get('channel')
|
|
88
|
+
if m.get('receiverType') is not None:
|
|
89
|
+
self.receiver_type = m.get('receiverType')
|
|
90
|
+
if m.get('users') is not None:
|
|
91
|
+
self.users = [User().from_dict(i) for i in m.get('users')]
|
|
92
|
+
if m.get('userGroups') is not None:
|
|
93
|
+
self.user_groups = [UserGroup().from_dict(i) for i in m.get('userGroups')]
|
|
94
|
+
if m.get('webhookConfigList') is not None:
|
|
95
|
+
self.webhook_config_list = [CallbackConfig().from_dict(i) for i in m.get('webhookConfigList')]
|
|
96
|
+
return self
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NotifyRule information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cprom.models.user import User
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_cprom.models.user_group import UserGroup
|
|
10
|
+
|
|
11
|
+
from baiducloud_python_sdk_cprom.models.callback_config import CallbackConfig
|
|
12
|
+
|
|
13
|
+
from baiducloud_python_sdk_cprom.models.escalate_param import EscalateParam
|
|
14
|
+
|
|
15
|
+
from baiducloud_python_sdk_cprom.models.repeat_notify_config import RepeatNotifyConfig
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class NotifyRule(AbstractModel):
|
|
19
|
+
"""
|
|
20
|
+
NotifyRule
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
notify_rule_id=None,
|
|
26
|
+
notify_rule_name=None,
|
|
27
|
+
start_time=None,
|
|
28
|
+
end_time=None,
|
|
29
|
+
channel=None,
|
|
30
|
+
receiver_type=None,
|
|
31
|
+
users=None,
|
|
32
|
+
user_groups=None,
|
|
33
|
+
webhook_config_list=None,
|
|
34
|
+
escalate_config_list=None,
|
|
35
|
+
repeat_notify_config=None,
|
|
36
|
+
create_time=None,
|
|
37
|
+
update_time=None,
|
|
38
|
+
):
|
|
39
|
+
"""
|
|
40
|
+
Initialize NotifyRule instance.
|
|
41
|
+
|
|
42
|
+
:param notify_rule_id: 通知策略ID
|
|
43
|
+
:type notify_rule_id: str (optional)
|
|
44
|
+
|
|
45
|
+
:param notify_rule_name: 通知名称
|
|
46
|
+
:type notify_rule_name: str (optional)
|
|
47
|
+
|
|
48
|
+
:param start_time: 通知时段开始时间
|
|
49
|
+
:type start_time: str (optional)
|
|
50
|
+
|
|
51
|
+
:param end_time: 通知时段终止时间
|
|
52
|
+
:type end_time: str (optional)
|
|
53
|
+
|
|
54
|
+
:param channel: 通知渠道,phone:电话 , sms: 短信, email: 邮件
|
|
55
|
+
:type channel: List[str] (optional)
|
|
56
|
+
|
|
57
|
+
:param receiver_type: 接收者类型,user:用户,userGroup:用户组
|
|
58
|
+
:type receiver_type: str (optional)
|
|
59
|
+
|
|
60
|
+
:param users: 用户列表
|
|
61
|
+
:type users: List[User] (optional)
|
|
62
|
+
|
|
63
|
+
:param user_groups: 用户组列表
|
|
64
|
+
:type user_groups: List[UserGroup] (optional)
|
|
65
|
+
|
|
66
|
+
:param webhook_config_list: webhook 回调配置信息列表
|
|
67
|
+
:type webhook_config_list: List[CallbackConfig] (optional)
|
|
68
|
+
|
|
69
|
+
:param escalate_config_list: 通知策略升级参数列表
|
|
70
|
+
:type escalate_config_list: List[EscalateParam] (optional)
|
|
71
|
+
|
|
72
|
+
:param repeat_notify_config: repeat_notify_config attribute
|
|
73
|
+
:type repeat_notify_config: RepeatNotifyConfig (optional)
|
|
74
|
+
|
|
75
|
+
:param create_time: 创建时间
|
|
76
|
+
:type create_time: str (optional)
|
|
77
|
+
|
|
78
|
+
:param update_time: 更新时间
|
|
79
|
+
:type update_time: str (optional)
|
|
80
|
+
"""
|
|
81
|
+
super().__init__()
|
|
82
|
+
self.notify_rule_id = notify_rule_id
|
|
83
|
+
self.notify_rule_name = notify_rule_name
|
|
84
|
+
self.start_time = start_time
|
|
85
|
+
self.end_time = end_time
|
|
86
|
+
self.channel = channel
|
|
87
|
+
self.receiver_type = receiver_type
|
|
88
|
+
self.users = users
|
|
89
|
+
self.user_groups = user_groups
|
|
90
|
+
self.webhook_config_list = webhook_config_list
|
|
91
|
+
self.escalate_config_list = escalate_config_list
|
|
92
|
+
self.repeat_notify_config = repeat_notify_config
|
|
93
|
+
self.create_time = create_time
|
|
94
|
+
self.update_time = update_time
|
|
95
|
+
|
|
96
|
+
def to_dict(self):
|
|
97
|
+
"""
|
|
98
|
+
Convert the model instance to a dictionary representation.
|
|
99
|
+
|
|
100
|
+
Nested model objects are recursively converted to dictionaries.
|
|
101
|
+
|
|
102
|
+
:return: Dictionary representation of the model
|
|
103
|
+
:rtype: dict
|
|
104
|
+
"""
|
|
105
|
+
_map = super().to_dict()
|
|
106
|
+
if _map is not None:
|
|
107
|
+
return _map
|
|
108
|
+
result = dict()
|
|
109
|
+
if self.notify_rule_id is not None:
|
|
110
|
+
result['notifyRuleId'] = self.notify_rule_id
|
|
111
|
+
if self.notify_rule_name is not None:
|
|
112
|
+
result['notifyRuleName'] = self.notify_rule_name
|
|
113
|
+
if self.start_time is not None:
|
|
114
|
+
result['startTime'] = self.start_time
|
|
115
|
+
if self.end_time is not None:
|
|
116
|
+
result['endTime'] = self.end_time
|
|
117
|
+
if self.channel is not None:
|
|
118
|
+
result['channel'] = self.channel
|
|
119
|
+
if self.receiver_type is not None:
|
|
120
|
+
result['receiverType'] = self.receiver_type
|
|
121
|
+
if self.users is not None:
|
|
122
|
+
result['users'] = [i.to_dict() for i in self.users]
|
|
123
|
+
if self.user_groups is not None:
|
|
124
|
+
result['userGroups'] = [i.to_dict() for i in self.user_groups]
|
|
125
|
+
if self.webhook_config_list is not None:
|
|
126
|
+
result['webhookConfigList'] = [i.to_dict() for i in self.webhook_config_list]
|
|
127
|
+
if self.escalate_config_list is not None:
|
|
128
|
+
result['escalateConfigList'] = [i.to_dict() for i in self.escalate_config_list]
|
|
129
|
+
if self.repeat_notify_config is not None:
|
|
130
|
+
result['repeatNotifyConfig'] = self.repeat_notify_config.to_dict()
|
|
131
|
+
if self.create_time is not None:
|
|
132
|
+
result['createTime'] = self.create_time
|
|
133
|
+
if self.update_time is not None:
|
|
134
|
+
result['updateTime'] = self.update_time
|
|
135
|
+
return result
|
|
136
|
+
|
|
137
|
+
def from_dict(self, m):
|
|
138
|
+
"""
|
|
139
|
+
Populate the model instance from a dictionary.
|
|
140
|
+
|
|
141
|
+
Nested dictionaries are recursively converted to model objects.
|
|
142
|
+
|
|
143
|
+
:param m: Dictionary containing model data
|
|
144
|
+
:type m: dict
|
|
145
|
+
|
|
146
|
+
:return: Self reference for method chaining
|
|
147
|
+
:rtype: NotifyRule
|
|
148
|
+
|
|
149
|
+
:raises TypeError: If input is not a dictionary type
|
|
150
|
+
:raises ValueError: If nested model conversion fails
|
|
151
|
+
"""
|
|
152
|
+
m = m or dict()
|
|
153
|
+
if m.get('notifyRuleId') is not None:
|
|
154
|
+
self.notify_rule_id = m.get('notifyRuleId')
|
|
155
|
+
if m.get('notifyRuleName') is not None:
|
|
156
|
+
self.notify_rule_name = m.get('notifyRuleName')
|
|
157
|
+
if m.get('startTime') is not None:
|
|
158
|
+
self.start_time = m.get('startTime')
|
|
159
|
+
if m.get('endTime') is not None:
|
|
160
|
+
self.end_time = m.get('endTime')
|
|
161
|
+
if m.get('channel') is not None:
|
|
162
|
+
self.channel = m.get('channel')
|
|
163
|
+
if m.get('receiverType') is not None:
|
|
164
|
+
self.receiver_type = m.get('receiverType')
|
|
165
|
+
if m.get('users') is not None:
|
|
166
|
+
self.users = [User().from_dict(i) for i in m.get('users')]
|
|
167
|
+
if m.get('userGroups') is not None:
|
|
168
|
+
self.user_groups = [UserGroup().from_dict(i) for i in m.get('userGroups')]
|
|
169
|
+
if m.get('webhookConfigList') is not None:
|
|
170
|
+
self.webhook_config_list = [CallbackConfig().from_dict(i) for i in m.get('webhookConfigList')]
|
|
171
|
+
if m.get('escalateConfigList') is not None:
|
|
172
|
+
self.escalate_config_list = [EscalateParam().from_dict(i) for i in m.get('escalateConfigList')]
|
|
173
|
+
if m.get('repeatNotifyConfig') is not None:
|
|
174
|
+
self.repeat_notify_config = RepeatNotifyConfig().from_dict(m.get('repeatNotifyConfig'))
|
|
175
|
+
if m.get('createTime') is not None:
|
|
176
|
+
self.create_time = m.get('createTime')
|
|
177
|
+
if m.get('updateTime') is not None:
|
|
178
|
+
self.update_time = m.get('updateTime')
|
|
179
|
+
return self
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ObjectMeta information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ObjectMeta(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
ObjectMeta
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, name=None, namespace=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize ObjectMeta instance.
|
|
16
|
+
|
|
17
|
+
:param name: 资源名称
|
|
18
|
+
:type name: str (optional)
|
|
19
|
+
|
|
20
|
+
:param namespace: 命名空间
|
|
21
|
+
:type namespace: str (optional)
|
|
22
|
+
"""
|
|
23
|
+
super().__init__()
|
|
24
|
+
self.name = name
|
|
25
|
+
self.namespace = namespace
|
|
26
|
+
|
|
27
|
+
def to_dict(self):
|
|
28
|
+
"""
|
|
29
|
+
Convert the model instance to a dictionary representation.
|
|
30
|
+
|
|
31
|
+
Nested model objects are recursively converted to dictionaries.
|
|
32
|
+
|
|
33
|
+
:return: Dictionary representation of the model
|
|
34
|
+
:rtype: dict
|
|
35
|
+
"""
|
|
36
|
+
_map = super().to_dict()
|
|
37
|
+
if _map is not None:
|
|
38
|
+
return _map
|
|
39
|
+
result = dict()
|
|
40
|
+
if self.name is not None:
|
|
41
|
+
result['name'] = self.name
|
|
42
|
+
if self.namespace is not None:
|
|
43
|
+
result['namespace'] = self.namespace
|
|
44
|
+
return result
|
|
45
|
+
|
|
46
|
+
def from_dict(self, m):
|
|
47
|
+
"""
|
|
48
|
+
Populate the model instance from a dictionary.
|
|
49
|
+
|
|
50
|
+
Nested dictionaries are recursively converted to model objects.
|
|
51
|
+
|
|
52
|
+
:param m: Dictionary containing model data
|
|
53
|
+
:type m: dict
|
|
54
|
+
|
|
55
|
+
:return: Self reference for method chaining
|
|
56
|
+
:rtype: ObjectMeta
|
|
57
|
+
|
|
58
|
+
:raises TypeError: If input is not a dictionary type
|
|
59
|
+
:raises ValueError: If nested model conversion fails
|
|
60
|
+
"""
|
|
61
|
+
m = m or dict()
|
|
62
|
+
if m.get('name') is not None:
|
|
63
|
+
self.name = m.get('name')
|
|
64
|
+
if m.get('namespace') is not None:
|
|
65
|
+
self.namespace = m.get('namespace')
|
|
66
|
+
return self
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PodMetricsEndpoint information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PodMetricsEndpoint(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
PodMetricsEndpoint
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, interval=None, path=None, port=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize PodMetricsEndpoint instance.
|
|
16
|
+
|
|
17
|
+
:param interval: 采集间隔,如:15s,可不传,默认为 15s
|
|
18
|
+
:type interval: str (optional)
|
|
19
|
+
|
|
20
|
+
:param path: 采集路径,如:/metrics 可不传,默认为 /metrics
|
|
21
|
+
:type path: str (optional)
|
|
22
|
+
|
|
23
|
+
:param port: 对应 Pod 的 port name,注意不是端口号
|
|
24
|
+
:type port: str (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.interval = interval
|
|
28
|
+
self.path = path
|
|
29
|
+
self.port = port
|
|
30
|
+
|
|
31
|
+
def to_dict(self):
|
|
32
|
+
"""
|
|
33
|
+
Convert the model instance to a dictionary representation.
|
|
34
|
+
|
|
35
|
+
Nested model objects are recursively converted to dictionaries.
|
|
36
|
+
|
|
37
|
+
:return: Dictionary representation of the model
|
|
38
|
+
:rtype: dict
|
|
39
|
+
"""
|
|
40
|
+
_map = super().to_dict()
|
|
41
|
+
if _map is not None:
|
|
42
|
+
return _map
|
|
43
|
+
result = dict()
|
|
44
|
+
if self.interval is not None:
|
|
45
|
+
result['interval'] = self.interval
|
|
46
|
+
if self.path is not None:
|
|
47
|
+
result['path'] = self.path
|
|
48
|
+
if self.port is not None:
|
|
49
|
+
result['port'] = self.port
|
|
50
|
+
return result
|
|
51
|
+
|
|
52
|
+
def from_dict(self, m):
|
|
53
|
+
"""
|
|
54
|
+
Populate the model instance from a dictionary.
|
|
55
|
+
|
|
56
|
+
Nested dictionaries are recursively converted to model objects.
|
|
57
|
+
|
|
58
|
+
:param m: Dictionary containing model data
|
|
59
|
+
:type m: dict
|
|
60
|
+
|
|
61
|
+
:return: Self reference for method chaining
|
|
62
|
+
:rtype: PodMetricsEndpoint
|
|
63
|
+
|
|
64
|
+
:raises TypeError: If input is not a dictionary type
|
|
65
|
+
:raises ValueError: If nested model conversion fails
|
|
66
|
+
"""
|
|
67
|
+
m = m or dict()
|
|
68
|
+
if m.get('interval') is not None:
|
|
69
|
+
self.interval = m.get('interval')
|
|
70
|
+
if m.get('path') is not None:
|
|
71
|
+
self.path = m.get('path')
|
|
72
|
+
if m.get('port') is not None:
|
|
73
|
+
self.port = m.get('port')
|
|
74
|
+
return self
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PodMonitor information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cprom.models.object_meta import ObjectMeta
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_cprom.models.pod_monitor_spec import PodMonitorSpec
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PodMonitor(AbstractModel):
|
|
13
|
+
"""
|
|
14
|
+
PodMonitor
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(self, api_version=None, kind=None, metadata=None, spec=None):
|
|
18
|
+
"""
|
|
19
|
+
Initialize PodMonitor instance.
|
|
20
|
+
|
|
21
|
+
:param api_version: 固定值:monitoring.coreos.com/v1
|
|
22
|
+
:type api_version: str (optional)
|
|
23
|
+
|
|
24
|
+
:param kind: 固定值:PodMonitor
|
|
25
|
+
:type kind: str (optional)
|
|
26
|
+
|
|
27
|
+
:param metadata: metadata attribute
|
|
28
|
+
:type metadata: ObjectMeta (optional)
|
|
29
|
+
|
|
30
|
+
:param spec: spec attribute
|
|
31
|
+
:type spec: PodMonitorSpec (optional)
|
|
32
|
+
"""
|
|
33
|
+
super().__init__()
|
|
34
|
+
self.api_version = api_version
|
|
35
|
+
self.kind = kind
|
|
36
|
+
self.metadata = metadata
|
|
37
|
+
self.spec = spec
|
|
38
|
+
|
|
39
|
+
def to_dict(self):
|
|
40
|
+
"""
|
|
41
|
+
Convert the model instance to a dictionary representation.
|
|
42
|
+
|
|
43
|
+
Nested model objects are recursively converted to dictionaries.
|
|
44
|
+
|
|
45
|
+
:return: Dictionary representation of the model
|
|
46
|
+
:rtype: dict
|
|
47
|
+
"""
|
|
48
|
+
_map = super().to_dict()
|
|
49
|
+
if _map is not None:
|
|
50
|
+
return _map
|
|
51
|
+
result = dict()
|
|
52
|
+
if self.api_version is not None:
|
|
53
|
+
result['apiVersion'] = self.api_version
|
|
54
|
+
if self.kind is not None:
|
|
55
|
+
result['kind'] = self.kind
|
|
56
|
+
if self.metadata is not None:
|
|
57
|
+
result['metadata'] = self.metadata.to_dict()
|
|
58
|
+
if self.spec is not None:
|
|
59
|
+
result['spec'] = self.spec.to_dict()
|
|
60
|
+
return result
|
|
61
|
+
|
|
62
|
+
def from_dict(self, m):
|
|
63
|
+
"""
|
|
64
|
+
Populate the model instance from a dictionary.
|
|
65
|
+
|
|
66
|
+
Nested dictionaries are recursively converted to model objects.
|
|
67
|
+
|
|
68
|
+
:param m: Dictionary containing model data
|
|
69
|
+
:type m: dict
|
|
70
|
+
|
|
71
|
+
:return: Self reference for method chaining
|
|
72
|
+
:rtype: PodMonitor
|
|
73
|
+
|
|
74
|
+
:raises TypeError: If input is not a dictionary type
|
|
75
|
+
:raises ValueError: If nested model conversion fails
|
|
76
|
+
"""
|
|
77
|
+
m = m or dict()
|
|
78
|
+
if m.get('apiVersion') is not None:
|
|
79
|
+
self.api_version = m.get('apiVersion')
|
|
80
|
+
if m.get('kind') is not None:
|
|
81
|
+
self.kind = m.get('kind')
|
|
82
|
+
if m.get('metadata') is not None:
|
|
83
|
+
self.metadata = ObjectMeta().from_dict(m.get('metadata'))
|
|
84
|
+
if m.get('spec') is not None:
|
|
85
|
+
self.spec = PodMonitorSpec().from_dict(m.get('spec'))
|
|
86
|
+
return self
|