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,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Status information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Status(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Status
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, phase=None, ready=None, message=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize Status instance.
|
|
16
|
+
|
|
17
|
+
:param phase: 监控实例状态,可选值:Pending, Creating, Failed, Running, Upgrading
|
|
18
|
+
:type phase: str (optional)
|
|
19
|
+
|
|
20
|
+
:param ready: 监控实例是否ready
|
|
21
|
+
:type ready: bool (optional)
|
|
22
|
+
|
|
23
|
+
:param message: 监控实例状态说明信息
|
|
24
|
+
:type message: str (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.phase = phase
|
|
28
|
+
self.ready = ready
|
|
29
|
+
self.message = message
|
|
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.phase is not None:
|
|
45
|
+
result['phase'] = self.phase
|
|
46
|
+
if self.ready is not None:
|
|
47
|
+
result['ready'] = self.ready
|
|
48
|
+
if self.message is not None:
|
|
49
|
+
result['message'] = self.message
|
|
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: Status
|
|
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('phase') is not None:
|
|
69
|
+
self.phase = m.get('phase')
|
|
70
|
+
if m.get('ready') is not None:
|
|
71
|
+
self.ready = m.get('ready')
|
|
72
|
+
if m.get('message') is not None:
|
|
73
|
+
self.message = m.get('message')
|
|
74
|
+
return self
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for TogglePodMonitorServiceRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TogglePodMonitorServiceRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for TogglePodMonitorServiceRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, action, instance_id, agent_id):
|
|
16
|
+
"""
|
|
17
|
+
Initialize TogglePodMonitorServiceRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param action: action parameter
|
|
20
|
+
:type action: str (required)
|
|
21
|
+
|
|
22
|
+
:param instance_id: instance_id parameter
|
|
23
|
+
:type instance_id: str (required)
|
|
24
|
+
|
|
25
|
+
:param agent_id: agent_id parameter
|
|
26
|
+
:type agent_id: str (required)
|
|
27
|
+
"""
|
|
28
|
+
super().__init__()
|
|
29
|
+
self.action = action
|
|
30
|
+
self.instance_id = instance_id
|
|
31
|
+
self.agent_id = agent_id
|
|
32
|
+
|
|
33
|
+
def to_dict(self):
|
|
34
|
+
"""
|
|
35
|
+
Convert the request entity to a dictionary representation.
|
|
36
|
+
|
|
37
|
+
Nested model objects are recursively converted to dictionaries.
|
|
38
|
+
|
|
39
|
+
:return: Dictionary representation of the request
|
|
40
|
+
:rtype: dict
|
|
41
|
+
"""
|
|
42
|
+
_map = super().to_dict()
|
|
43
|
+
if _map is not None:
|
|
44
|
+
return _map
|
|
45
|
+
result = dict()
|
|
46
|
+
return result
|
|
47
|
+
|
|
48
|
+
def from_dict(self, m):
|
|
49
|
+
"""
|
|
50
|
+
Populate the request entity from a dictionary.
|
|
51
|
+
|
|
52
|
+
Nested dictionaries are recursively converted to model objects.
|
|
53
|
+
|
|
54
|
+
:param m: Dictionary containing request data
|
|
55
|
+
:type m: dict
|
|
56
|
+
|
|
57
|
+
:return: Self reference for method chaining
|
|
58
|
+
:rtype: TogglePodMonitorServiceRequest
|
|
59
|
+
|
|
60
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
61
|
+
:raises ValueError: If nested model conversion fails
|
|
62
|
+
"""
|
|
63
|
+
m = m or dict()
|
|
64
|
+
if m.get('action') is not None:
|
|
65
|
+
self.action = m.get('action')
|
|
66
|
+
if m.get('instanceId') is not None:
|
|
67
|
+
self.instance_id = m.get('instanceId')
|
|
68
|
+
if m.get('agentId') is not None:
|
|
69
|
+
self.agent_id = m.get('agentId')
|
|
70
|
+
return self
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for ToggleServiceMonitorServiceRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ToggleServiceMonitorServiceRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for ToggleServiceMonitorServiceRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, action, instance_id, agent_id):
|
|
16
|
+
"""
|
|
17
|
+
Initialize ToggleServiceMonitorServiceRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param action: action parameter
|
|
20
|
+
:type action: str (required)
|
|
21
|
+
|
|
22
|
+
:param instance_id: instance_id parameter
|
|
23
|
+
:type instance_id: str (required)
|
|
24
|
+
|
|
25
|
+
:param agent_id: agent_id parameter
|
|
26
|
+
:type agent_id: str (required)
|
|
27
|
+
"""
|
|
28
|
+
super().__init__()
|
|
29
|
+
self.action = action
|
|
30
|
+
self.instance_id = instance_id
|
|
31
|
+
self.agent_id = agent_id
|
|
32
|
+
|
|
33
|
+
def to_dict(self):
|
|
34
|
+
"""
|
|
35
|
+
Convert the request entity to a dictionary representation.
|
|
36
|
+
|
|
37
|
+
Nested model objects are recursively converted to dictionaries.
|
|
38
|
+
|
|
39
|
+
:return: Dictionary representation of the request
|
|
40
|
+
:rtype: dict
|
|
41
|
+
"""
|
|
42
|
+
_map = super().to_dict()
|
|
43
|
+
if _map is not None:
|
|
44
|
+
return _map
|
|
45
|
+
result = dict()
|
|
46
|
+
return result
|
|
47
|
+
|
|
48
|
+
def from_dict(self, m):
|
|
49
|
+
"""
|
|
50
|
+
Populate the request entity from a dictionary.
|
|
51
|
+
|
|
52
|
+
Nested dictionaries are recursively converted to model objects.
|
|
53
|
+
|
|
54
|
+
:param m: Dictionary containing request data
|
|
55
|
+
:type m: dict
|
|
56
|
+
|
|
57
|
+
:return: Self reference for method chaining
|
|
58
|
+
:rtype: ToggleServiceMonitorServiceRequest
|
|
59
|
+
|
|
60
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
61
|
+
:raises ValueError: If nested model conversion fails
|
|
62
|
+
"""
|
|
63
|
+
m = m or dict()
|
|
64
|
+
if m.get('action') is not None:
|
|
65
|
+
self.action = m.get('action')
|
|
66
|
+
if m.get('instanceId') is not None:
|
|
67
|
+
self.instance_id = m.get('instanceId')
|
|
68
|
+
if m.get('agentId') is not None:
|
|
69
|
+
self.agent_id = m.get('agentId')
|
|
70
|
+
return self
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for UpdateAlertRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UpdateAlertRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for UpdateAlertRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(
|
|
16
|
+
self,
|
|
17
|
+
alerting_rule_id,
|
|
18
|
+
instance_id,
|
|
19
|
+
alert_name,
|
|
20
|
+
expr,
|
|
21
|
+
cprom_for,
|
|
22
|
+
description,
|
|
23
|
+
notify_rule_id,
|
|
24
|
+
severity=None,
|
|
25
|
+
enable=None,
|
|
26
|
+
labels=None,
|
|
27
|
+
annotations=None,
|
|
28
|
+
):
|
|
29
|
+
"""
|
|
30
|
+
Initialize UpdateAlertRequest request entity.
|
|
31
|
+
|
|
32
|
+
:param alerting_rule_id: alerting_rule_id parameter
|
|
33
|
+
:type alerting_rule_id: str (required)
|
|
34
|
+
|
|
35
|
+
:param instance_id: instance_id parameter
|
|
36
|
+
:type instance_id: str (required)
|
|
37
|
+
|
|
38
|
+
:param alert_name: 告警名称
|
|
39
|
+
:type alert_name: str (required)
|
|
40
|
+
|
|
41
|
+
:param expr: 告警规则,promQL查询语句
|
|
42
|
+
:type expr: str (required)
|
|
43
|
+
|
|
44
|
+
:param cprom_for: 告警持续时间
|
|
45
|
+
:type cprom_for: str (required)
|
|
46
|
+
|
|
47
|
+
:param description: 告警内容
|
|
48
|
+
:type description: str (required)
|
|
49
|
+
|
|
50
|
+
:param notify_rule_id: 通知策略ID
|
|
51
|
+
:type notify_rule_id: str (required)
|
|
52
|
+
|
|
53
|
+
:param severity: 告警级别,notice/warning/major/critical
|
|
54
|
+
:type severity: str (optional)
|
|
55
|
+
|
|
56
|
+
:param enable: 是否开启告警,开启为true,关闭为false
|
|
57
|
+
:type enable: bool (optional)
|
|
58
|
+
|
|
59
|
+
:param labels: 自定义label键值对
|
|
60
|
+
:type labels: Dict[str, str] (optional)
|
|
61
|
+
|
|
62
|
+
:param annotations: 自定义注解键值对
|
|
63
|
+
:type annotations: Dict[str, str] (optional)
|
|
64
|
+
"""
|
|
65
|
+
super().__init__()
|
|
66
|
+
self.alerting_rule_id = alerting_rule_id
|
|
67
|
+
self.instance_id = instance_id
|
|
68
|
+
self.alert_name = alert_name
|
|
69
|
+
self.expr = expr
|
|
70
|
+
self.cprom_for = cprom_for
|
|
71
|
+
self.description = description
|
|
72
|
+
self.notify_rule_id = notify_rule_id
|
|
73
|
+
self.severity = severity
|
|
74
|
+
self.enable = enable
|
|
75
|
+
self.labels = labels
|
|
76
|
+
self.annotations = annotations
|
|
77
|
+
|
|
78
|
+
def to_dict(self):
|
|
79
|
+
"""
|
|
80
|
+
Convert the request entity to a dictionary representation.
|
|
81
|
+
|
|
82
|
+
Nested model objects are recursively converted to dictionaries.
|
|
83
|
+
|
|
84
|
+
:return: Dictionary representation of the request
|
|
85
|
+
:rtype: dict
|
|
86
|
+
"""
|
|
87
|
+
_map = super().to_dict()
|
|
88
|
+
if _map is not None:
|
|
89
|
+
return _map
|
|
90
|
+
result = dict()
|
|
91
|
+
if self.alert_name is not None:
|
|
92
|
+
result['alertName'] = self.alert_name
|
|
93
|
+
if self.expr is not None:
|
|
94
|
+
result['expr'] = self.expr
|
|
95
|
+
if self.cprom_for is not None:
|
|
96
|
+
result['for'] = self.cprom_for
|
|
97
|
+
if self.description is not None:
|
|
98
|
+
result['description'] = self.description
|
|
99
|
+
if self.notify_rule_id is not None:
|
|
100
|
+
result['notifyRuleId'] = self.notify_rule_id
|
|
101
|
+
if self.severity is not None:
|
|
102
|
+
result['severity'] = self.severity
|
|
103
|
+
if self.enable is not None:
|
|
104
|
+
result['enable'] = self.enable
|
|
105
|
+
if self.labels is not None:
|
|
106
|
+
result['labels'] = self.labels
|
|
107
|
+
if self.annotations is not None:
|
|
108
|
+
result['annotations'] = self.annotations
|
|
109
|
+
return result
|
|
110
|
+
|
|
111
|
+
def from_dict(self, m):
|
|
112
|
+
"""
|
|
113
|
+
Populate the request entity from a dictionary.
|
|
114
|
+
|
|
115
|
+
Nested dictionaries are recursively converted to model objects.
|
|
116
|
+
|
|
117
|
+
:param m: Dictionary containing request data
|
|
118
|
+
:type m: dict
|
|
119
|
+
|
|
120
|
+
:return: Self reference for method chaining
|
|
121
|
+
:rtype: UpdateAlertRequest
|
|
122
|
+
|
|
123
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
124
|
+
:raises ValueError: If nested model conversion fails
|
|
125
|
+
"""
|
|
126
|
+
m = m or dict()
|
|
127
|
+
if m.get('alertingRuleId') is not None:
|
|
128
|
+
self.alerting_rule_id = m.get('alertingRuleId')
|
|
129
|
+
if m.get('instanceId') is not None:
|
|
130
|
+
self.instance_id = m.get('instanceId')
|
|
131
|
+
if m.get('alertName') is not None:
|
|
132
|
+
self.alert_name = m.get('alertName')
|
|
133
|
+
if m.get('expr') is not None:
|
|
134
|
+
self.expr = m.get('expr')
|
|
135
|
+
if m.get('for') is not None:
|
|
136
|
+
self.cprom_for = m.get('for')
|
|
137
|
+
if m.get('description') is not None:
|
|
138
|
+
self.description = m.get('description')
|
|
139
|
+
if m.get('notifyRuleId') is not None:
|
|
140
|
+
self.notify_rule_id = m.get('notifyRuleId')
|
|
141
|
+
if m.get('severity') is not None:
|
|
142
|
+
self.severity = m.get('severity')
|
|
143
|
+
if m.get('enable') is not None:
|
|
144
|
+
self.enable = m.get('enable')
|
|
145
|
+
if m.get('labels') is not None:
|
|
146
|
+
self.labels = m.get('labels')
|
|
147
|
+
if m.get('annotations') is not None:
|
|
148
|
+
self.annotations = m.get('annotations')
|
|
149
|
+
return self
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for UpdateNotificationPolicyRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
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
|
+
from baiducloud_python_sdk_cprom.models.repeat_notify_config import RepeatNotifyConfig
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class UpdateNotificationPolicyRequest(AbstractModel):
|
|
14
|
+
"""
|
|
15
|
+
Request entity for UpdateNotificationPolicyRequest operation.
|
|
16
|
+
|
|
17
|
+
This class encapsulates all parameters for the API request.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
notify_rule_id,
|
|
23
|
+
notify_rule_name,
|
|
24
|
+
start_time,
|
|
25
|
+
end_time,
|
|
26
|
+
channel,
|
|
27
|
+
receiver_type,
|
|
28
|
+
users=None,
|
|
29
|
+
user_groups=None,
|
|
30
|
+
webhook_config_list=None,
|
|
31
|
+
escalate_config_list=None,
|
|
32
|
+
repeat_notify_config=None,
|
|
33
|
+
):
|
|
34
|
+
"""
|
|
35
|
+
Initialize UpdateNotificationPolicyRequest request entity.
|
|
36
|
+
|
|
37
|
+
:param notify_rule_id: notify_rule_id parameter
|
|
38
|
+
:type notify_rule_id: str (required)
|
|
39
|
+
|
|
40
|
+
:param notify_rule_name: 通知策略名称
|
|
41
|
+
:type notify_rule_name: str (required)
|
|
42
|
+
|
|
43
|
+
:param start_time: 通知开始时间,时间格式 00:00:00
|
|
44
|
+
:type start_time: str (required)
|
|
45
|
+
|
|
46
|
+
:param end_time: 通知结束时间,时间格式 23:59:59
|
|
47
|
+
:type end_time: str (required)
|
|
48
|
+
|
|
49
|
+
:param channel: 通知渠道,phone:电话 , sms: 短信, email: 邮件
|
|
50
|
+
:type channel: List[str] (required)
|
|
51
|
+
|
|
52
|
+
:param receiver_type: 接受者类型,user:用户,userGroup:用户组
|
|
53
|
+
:type receiver_type: str (required)
|
|
54
|
+
|
|
55
|
+
:param users: 用户列表
|
|
56
|
+
:type users: List[User] (optional)
|
|
57
|
+
|
|
58
|
+
:param user_groups: 用户组列表
|
|
59
|
+
:type user_groups: List[UserGroup] (optional)
|
|
60
|
+
|
|
61
|
+
:param webhook_config_list: webhook 回调配置信息列表
|
|
62
|
+
:type webhook_config_list: List[CallbackConfig] (optional)
|
|
63
|
+
|
|
64
|
+
:param escalate_config_list: 通知策略升级参数列表
|
|
65
|
+
:type escalate_config_list: List[EscalateParam] (optional)
|
|
66
|
+
|
|
67
|
+
:param repeat_notify_config: repeat_notify_config parameter
|
|
68
|
+
:type repeat_notify_config: RepeatNotifyConfig (optional)
|
|
69
|
+
"""
|
|
70
|
+
super().__init__()
|
|
71
|
+
self.notify_rule_id = notify_rule_id
|
|
72
|
+
self.notify_rule_name = notify_rule_name
|
|
73
|
+
self.start_time = start_time
|
|
74
|
+
self.end_time = end_time
|
|
75
|
+
self.channel = channel
|
|
76
|
+
self.receiver_type = receiver_type
|
|
77
|
+
self.users = users
|
|
78
|
+
self.user_groups = user_groups
|
|
79
|
+
self.webhook_config_list = webhook_config_list
|
|
80
|
+
self.escalate_config_list = escalate_config_list
|
|
81
|
+
self.repeat_notify_config = repeat_notify_config
|
|
82
|
+
|
|
83
|
+
def to_dict(self):
|
|
84
|
+
"""
|
|
85
|
+
Convert the request entity to a dictionary representation.
|
|
86
|
+
|
|
87
|
+
Nested model objects are recursively converted to dictionaries.
|
|
88
|
+
|
|
89
|
+
:return: Dictionary representation of the request
|
|
90
|
+
:rtype: dict
|
|
91
|
+
"""
|
|
92
|
+
_map = super().to_dict()
|
|
93
|
+
if _map is not None:
|
|
94
|
+
return _map
|
|
95
|
+
result = dict()
|
|
96
|
+
if self.notify_rule_name is not None:
|
|
97
|
+
result['notifyRuleName'] = self.notify_rule_name
|
|
98
|
+
if self.start_time is not None:
|
|
99
|
+
result['startTime'] = self.start_time
|
|
100
|
+
if self.end_time is not None:
|
|
101
|
+
result['endTime'] = self.end_time
|
|
102
|
+
if self.channel is not None:
|
|
103
|
+
result['channel'] = self.channel
|
|
104
|
+
if self.receiver_type is not None:
|
|
105
|
+
result['receiverType'] = self.receiver_type
|
|
106
|
+
if self.users is not None:
|
|
107
|
+
result['users'] = [i.to_dict() for i in self.users]
|
|
108
|
+
if self.user_groups is not None:
|
|
109
|
+
result['userGroups'] = [i.to_dict() for i in self.user_groups]
|
|
110
|
+
if self.webhook_config_list is not None:
|
|
111
|
+
result['webhookConfigList'] = [i.to_dict() for i in self.webhook_config_list]
|
|
112
|
+
if self.escalate_config_list is not None:
|
|
113
|
+
result['escalateConfigList'] = [i.to_dict() for i in self.escalate_config_list]
|
|
114
|
+
if self.repeat_notify_config is not None:
|
|
115
|
+
result['repeatNotifyConfig'] = self.repeat_notify_config.to_dict()
|
|
116
|
+
return result
|
|
117
|
+
|
|
118
|
+
def from_dict(self, m):
|
|
119
|
+
"""
|
|
120
|
+
Populate the request entity from a dictionary.
|
|
121
|
+
|
|
122
|
+
Nested dictionaries are recursively converted to model objects.
|
|
123
|
+
|
|
124
|
+
:param m: Dictionary containing request data
|
|
125
|
+
:type m: dict
|
|
126
|
+
|
|
127
|
+
:return: Self reference for method chaining
|
|
128
|
+
:rtype: UpdateNotificationPolicyRequest
|
|
129
|
+
|
|
130
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
131
|
+
:raises ValueError: If nested model conversion fails
|
|
132
|
+
"""
|
|
133
|
+
m = m or dict()
|
|
134
|
+
if m.get('notifyRuleId') is not None:
|
|
135
|
+
self.notify_rule_id = m.get('notifyRuleId')
|
|
136
|
+
if m.get('notifyRuleName') is not None:
|
|
137
|
+
self.notify_rule_name = m.get('notifyRuleName')
|
|
138
|
+
if m.get('startTime') is not None:
|
|
139
|
+
self.start_time = m.get('startTime')
|
|
140
|
+
if m.get('endTime') is not None:
|
|
141
|
+
self.end_time = m.get('endTime')
|
|
142
|
+
if m.get('channel') is not None:
|
|
143
|
+
self.channel = m.get('channel')
|
|
144
|
+
if m.get('receiverType') is not None:
|
|
145
|
+
self.receiver_type = m.get('receiverType')
|
|
146
|
+
if m.get('users') is not None:
|
|
147
|
+
self.users = [User().from_dict(i) for i in m.get('users')]
|
|
148
|
+
if m.get('userGroups') is not None:
|
|
149
|
+
self.user_groups = [UserGroup().from_dict(i) for i in m.get('userGroups')]
|
|
150
|
+
if m.get('webhookConfigList') is not None:
|
|
151
|
+
self.webhook_config_list = [CallbackConfig().from_dict(i) for i in m.get('webhookConfigList')]
|
|
152
|
+
if m.get('escalateConfigList') is not None:
|
|
153
|
+
self.escalate_config_list = [EscalateParam().from_dict(i) for i in m.get('escalateConfigList')]
|
|
154
|
+
if m.get('repeatNotifyConfig') is not None:
|
|
155
|
+
self.repeat_notify_config = RepeatNotifyConfig().from_dict(m.get('repeatNotifyConfig'))
|
|
156
|
+
return self
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for UpdatePodMonitorRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
from baiducloud_python_sdk_cprom.models.pod_monitor import PodMonitor
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UpdatePodMonitorRequest(AbstractModel):
|
|
10
|
+
"""
|
|
11
|
+
Request entity for UpdatePodMonitorRequest operation.
|
|
12
|
+
|
|
13
|
+
This class encapsulates all parameters for the API request.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, pod_monitor_name, instance_id, agent_id, enable, pod_monitor):
|
|
17
|
+
"""
|
|
18
|
+
Initialize UpdatePodMonitorRequest request entity.
|
|
19
|
+
|
|
20
|
+
:param pod_monitor_name: pod_monitor_name parameter
|
|
21
|
+
:type pod_monitor_name: str (required)
|
|
22
|
+
|
|
23
|
+
:param instance_id: instance_id parameter
|
|
24
|
+
:type instance_id: str (required)
|
|
25
|
+
|
|
26
|
+
:param agent_id: agent_id parameter
|
|
27
|
+
:type agent_id: str (required)
|
|
28
|
+
|
|
29
|
+
:param enable: 是否启用:true/false
|
|
30
|
+
:type enable: str (required)
|
|
31
|
+
|
|
32
|
+
:param pod_monitor: pod_monitor parameter
|
|
33
|
+
:type pod_monitor: PodMonitor (required)
|
|
34
|
+
"""
|
|
35
|
+
super().__init__()
|
|
36
|
+
self.pod_monitor_name = pod_monitor_name
|
|
37
|
+
self.instance_id = instance_id
|
|
38
|
+
self.agent_id = agent_id
|
|
39
|
+
self.enable = enable
|
|
40
|
+
self.pod_monitor = pod_monitor
|
|
41
|
+
|
|
42
|
+
def to_dict(self):
|
|
43
|
+
"""
|
|
44
|
+
Convert the request entity to a dictionary representation.
|
|
45
|
+
|
|
46
|
+
Nested model objects are recursively converted to dictionaries.
|
|
47
|
+
|
|
48
|
+
:return: Dictionary representation of the request
|
|
49
|
+
:rtype: dict
|
|
50
|
+
"""
|
|
51
|
+
_map = super().to_dict()
|
|
52
|
+
if _map is not None:
|
|
53
|
+
return _map
|
|
54
|
+
result = dict()
|
|
55
|
+
if self.enable is not None:
|
|
56
|
+
result['enable'] = self.enable
|
|
57
|
+
if self.pod_monitor is not None:
|
|
58
|
+
result['podMonitor'] = self.pod_monitor.to_dict()
|
|
59
|
+
return result
|
|
60
|
+
|
|
61
|
+
def from_dict(self, m):
|
|
62
|
+
"""
|
|
63
|
+
Populate the request entity from a dictionary.
|
|
64
|
+
|
|
65
|
+
Nested dictionaries are recursively converted to model objects.
|
|
66
|
+
|
|
67
|
+
:param m: Dictionary containing request data
|
|
68
|
+
:type m: dict
|
|
69
|
+
|
|
70
|
+
:return: Self reference for method chaining
|
|
71
|
+
:rtype: UpdatePodMonitorRequest
|
|
72
|
+
|
|
73
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
74
|
+
:raises ValueError: If nested model conversion fails
|
|
75
|
+
"""
|
|
76
|
+
m = m or dict()
|
|
77
|
+
if m.get('podMonitorName') is not None:
|
|
78
|
+
self.pod_monitor_name = m.get('podMonitorName')
|
|
79
|
+
if m.get('instanceId') is not None:
|
|
80
|
+
self.instance_id = m.get('instanceId')
|
|
81
|
+
if m.get('agentId') is not None:
|
|
82
|
+
self.agent_id = m.get('agentId')
|
|
83
|
+
if m.get('enable') is not None:
|
|
84
|
+
self.enable = m.get('enable')
|
|
85
|
+
if m.get('podMonitor') is not None:
|
|
86
|
+
self.pod_monitor = PodMonitor().from_dict(m.get('podMonitor'))
|
|
87
|
+
return self
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for UpdateRelatedCloudProductsRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UpdateRelatedCloudProductsRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for UpdateRelatedCloudProductsRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, instance_id, scopes):
|
|
16
|
+
"""
|
|
17
|
+
Initialize UpdateRelatedCloudProductsRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param instance_id: instance_id parameter
|
|
20
|
+
:type instance_id: str (required)
|
|
21
|
+
|
|
22
|
+
:param scopes: 需要关联的云产品列表。取值可通过接口【获取可关联的 BCM 云产品列表】查询,传空数组或不传则表示清空云产品关联。
|
|
23
|
+
:type scopes: List[str] (required)
|
|
24
|
+
"""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.instance_id = instance_id
|
|
27
|
+
self.scopes = scopes
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
"""
|
|
31
|
+
Convert the request entity to a dictionary representation.
|
|
32
|
+
|
|
33
|
+
Nested model objects are recursively converted to dictionaries.
|
|
34
|
+
|
|
35
|
+
:return: Dictionary representation of the request
|
|
36
|
+
:rtype: dict
|
|
37
|
+
"""
|
|
38
|
+
_map = super().to_dict()
|
|
39
|
+
if _map is not None:
|
|
40
|
+
return _map
|
|
41
|
+
result = dict()
|
|
42
|
+
if self.scopes is not None:
|
|
43
|
+
result['scopes'] = self.scopes
|
|
44
|
+
return result
|
|
45
|
+
|
|
46
|
+
def from_dict(self, m):
|
|
47
|
+
"""
|
|
48
|
+
Populate the request entity from a dictionary.
|
|
49
|
+
|
|
50
|
+
Nested dictionaries are recursively converted to model objects.
|
|
51
|
+
|
|
52
|
+
:param m: Dictionary containing request data
|
|
53
|
+
:type m: dict
|
|
54
|
+
|
|
55
|
+
:return: Self reference for method chaining
|
|
56
|
+
:rtype: UpdateRelatedCloudProductsRequest
|
|
57
|
+
|
|
58
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
59
|
+
:raises ValueError: If nested model conversion fails
|
|
60
|
+
"""
|
|
61
|
+
m = m or dict()
|
|
62
|
+
if m.get('instanceId') is not None:
|
|
63
|
+
self.instance_id = m.get('instanceId')
|
|
64
|
+
if m.get('scopes') is not None:
|
|
65
|
+
self.scopes = m.get('scopes')
|
|
66
|
+
return self
|