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,92 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PodMonitorItem information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cprom.models.endpoint import Endpoint
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PodMonitorItem(AbstractModel):
|
|
11
|
+
"""
|
|
12
|
+
PodMonitorItem
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, pod_monitor_name=None, namespace=None, enable=None, create_time=None, endpoints=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize PodMonitorItem instance.
|
|
18
|
+
|
|
19
|
+
:param pod_monitor_name: Pod Monitor名称
|
|
20
|
+
:type pod_monitor_name: str (optional)
|
|
21
|
+
|
|
22
|
+
:param namespace: Pod Monitor命名空间
|
|
23
|
+
:type namespace: str (optional)
|
|
24
|
+
|
|
25
|
+
:param enable: 是否启用:true/false
|
|
26
|
+
:type enable: str (optional)
|
|
27
|
+
|
|
28
|
+
:param create_time: 创建时间
|
|
29
|
+
:type create_time: str (optional)
|
|
30
|
+
|
|
31
|
+
:param endpoints: 端点信息
|
|
32
|
+
:type endpoints: List[Endpoint] (optional)
|
|
33
|
+
"""
|
|
34
|
+
super().__init__()
|
|
35
|
+
self.pod_monitor_name = pod_monitor_name
|
|
36
|
+
self.namespace = namespace
|
|
37
|
+
self.enable = enable
|
|
38
|
+
self.create_time = create_time
|
|
39
|
+
self.endpoints = endpoints
|
|
40
|
+
|
|
41
|
+
def to_dict(self):
|
|
42
|
+
"""
|
|
43
|
+
Convert the model instance to a dictionary representation.
|
|
44
|
+
|
|
45
|
+
Nested model objects are recursively converted to dictionaries.
|
|
46
|
+
|
|
47
|
+
:return: Dictionary representation of the model
|
|
48
|
+
:rtype: dict
|
|
49
|
+
"""
|
|
50
|
+
_map = super().to_dict()
|
|
51
|
+
if _map is not None:
|
|
52
|
+
return _map
|
|
53
|
+
result = dict()
|
|
54
|
+
if self.pod_monitor_name is not None:
|
|
55
|
+
result['podMonitorName'] = self.pod_monitor_name
|
|
56
|
+
if self.namespace is not None:
|
|
57
|
+
result['namespace'] = self.namespace
|
|
58
|
+
if self.enable is not None:
|
|
59
|
+
result['enable'] = self.enable
|
|
60
|
+
if self.create_time is not None:
|
|
61
|
+
result['createTime'] = self.create_time
|
|
62
|
+
if self.endpoints is not None:
|
|
63
|
+
result['endpoints'] = [i.to_dict() for i in self.endpoints]
|
|
64
|
+
return result
|
|
65
|
+
|
|
66
|
+
def from_dict(self, m):
|
|
67
|
+
"""
|
|
68
|
+
Populate the model instance from a dictionary.
|
|
69
|
+
|
|
70
|
+
Nested dictionaries are recursively converted to model objects.
|
|
71
|
+
|
|
72
|
+
:param m: Dictionary containing model data
|
|
73
|
+
:type m: dict
|
|
74
|
+
|
|
75
|
+
:return: Self reference for method chaining
|
|
76
|
+
:rtype: PodMonitorItem
|
|
77
|
+
|
|
78
|
+
:raises TypeError: If input is not a dictionary type
|
|
79
|
+
:raises ValueError: If nested model conversion fails
|
|
80
|
+
"""
|
|
81
|
+
m = m or dict()
|
|
82
|
+
if m.get('podMonitorName') is not None:
|
|
83
|
+
self.pod_monitor_name = m.get('podMonitorName')
|
|
84
|
+
if m.get('namespace') is not None:
|
|
85
|
+
self.namespace = m.get('namespace')
|
|
86
|
+
if m.get('enable') is not None:
|
|
87
|
+
self.enable = m.get('enable')
|
|
88
|
+
if m.get('createTime') is not None:
|
|
89
|
+
self.create_time = m.get('createTime')
|
|
90
|
+
if m.get('endpoints') is not None:
|
|
91
|
+
self.endpoints = [Endpoint().from_dict(i) for i in m.get('endpoints')]
|
|
92
|
+
return self
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PodMonitorSpec information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_cprom.models.namespace_selector import NamespaceSelector
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_cprom.models.pod_metrics_endpoint import PodMetricsEndpoint
|
|
10
|
+
|
|
11
|
+
from baiducloud_python_sdk_cprom.models.label_selector import LabelSelector
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PodMonitorSpec(AbstractModel):
|
|
15
|
+
"""
|
|
16
|
+
PodMonitorSpec
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, namespace_selector=None, pod_metrics_endpoints=None, selector=None):
|
|
20
|
+
"""
|
|
21
|
+
Initialize PodMonitorSpec instance.
|
|
22
|
+
|
|
23
|
+
:param namespace_selector: namespace_selector attribute
|
|
24
|
+
:type namespace_selector: NamespaceSelector (optional)
|
|
25
|
+
|
|
26
|
+
:param pod_metrics_endpoints: 采集端点配置列表
|
|
27
|
+
:type pod_metrics_endpoints: List[PodMetricsEndpoint] (optional)
|
|
28
|
+
|
|
29
|
+
:param selector: selector attribute
|
|
30
|
+
:type selector: LabelSelector (optional)
|
|
31
|
+
"""
|
|
32
|
+
super().__init__()
|
|
33
|
+
self.namespace_selector = namespace_selector
|
|
34
|
+
self.pod_metrics_endpoints = pod_metrics_endpoints
|
|
35
|
+
self.selector = selector
|
|
36
|
+
|
|
37
|
+
def to_dict(self):
|
|
38
|
+
"""
|
|
39
|
+
Convert the model instance to a dictionary representation.
|
|
40
|
+
|
|
41
|
+
Nested model objects are recursively converted to dictionaries.
|
|
42
|
+
|
|
43
|
+
:return: Dictionary representation of the model
|
|
44
|
+
:rtype: dict
|
|
45
|
+
"""
|
|
46
|
+
_map = super().to_dict()
|
|
47
|
+
if _map is not None:
|
|
48
|
+
return _map
|
|
49
|
+
result = dict()
|
|
50
|
+
if self.namespace_selector is not None:
|
|
51
|
+
result['namespaceSelector'] = self.namespace_selector.to_dict()
|
|
52
|
+
if self.pod_metrics_endpoints is not None:
|
|
53
|
+
result['podMetricsEndpoints'] = [i.to_dict() for i in self.pod_metrics_endpoints]
|
|
54
|
+
if self.selector is not None:
|
|
55
|
+
result['selector'] = self.selector.to_dict()
|
|
56
|
+
return result
|
|
57
|
+
|
|
58
|
+
def from_dict(self, m):
|
|
59
|
+
"""
|
|
60
|
+
Populate the model instance from a dictionary.
|
|
61
|
+
|
|
62
|
+
Nested dictionaries are recursively converted to model objects.
|
|
63
|
+
|
|
64
|
+
:param m: Dictionary containing model data
|
|
65
|
+
:type m: dict
|
|
66
|
+
|
|
67
|
+
:return: Self reference for method chaining
|
|
68
|
+
:rtype: PodMonitorSpec
|
|
69
|
+
|
|
70
|
+
:raises TypeError: If input is not a dictionary type
|
|
71
|
+
:raises ValueError: If nested model conversion fails
|
|
72
|
+
"""
|
|
73
|
+
m = m or dict()
|
|
74
|
+
if m.get('namespaceSelector') is not None:
|
|
75
|
+
self.namespace_selector = NamespaceSelector().from_dict(m.get('namespaceSelector'))
|
|
76
|
+
if m.get('podMetricsEndpoints') is not None:
|
|
77
|
+
self.pod_metrics_endpoints = [PodMetricsEndpoint().from_dict(i) for i in m.get('podMetricsEndpoints')]
|
|
78
|
+
if m.get('selector') is not None:
|
|
79
|
+
self.selector = LabelSelector().from_dict(m.get('selector'))
|
|
80
|
+
return self
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for RemoteReadRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RemoteReadRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for RemoteReadRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, remote_read_url, query, step, start, end):
|
|
16
|
+
"""
|
|
17
|
+
Initialize RemoteReadRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param remote_read_url: remote_read_url parameter
|
|
20
|
+
:type remote_read_url: str (required)
|
|
21
|
+
|
|
22
|
+
:param query: query parameter
|
|
23
|
+
:type query: str (required)
|
|
24
|
+
|
|
25
|
+
:param step: step parameter
|
|
26
|
+
:type step: int (required)
|
|
27
|
+
|
|
28
|
+
:param start: start parameter
|
|
29
|
+
:type start: int (required)
|
|
30
|
+
|
|
31
|
+
:param end: end parameter
|
|
32
|
+
:type end: int (required)
|
|
33
|
+
"""
|
|
34
|
+
super().__init__()
|
|
35
|
+
self.remote_read_url = remote_read_url
|
|
36
|
+
self.query = query
|
|
37
|
+
self.step = step
|
|
38
|
+
self.start = start
|
|
39
|
+
self.end = end
|
|
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
|
+
if self.query is not None:
|
|
55
|
+
result['query'] = self.query
|
|
56
|
+
if self.step is not None:
|
|
57
|
+
result['step'] = self.step
|
|
58
|
+
if self.start is not None:
|
|
59
|
+
result['start'] = self.start
|
|
60
|
+
if self.end is not None:
|
|
61
|
+
result['end'] = self.end
|
|
62
|
+
return result
|
|
63
|
+
|
|
64
|
+
def from_dict(self, m):
|
|
65
|
+
"""
|
|
66
|
+
Populate the request entity from a dictionary.
|
|
67
|
+
|
|
68
|
+
Nested dictionaries are recursively converted to model objects.
|
|
69
|
+
|
|
70
|
+
:param m: Dictionary containing request data
|
|
71
|
+
:type m: dict
|
|
72
|
+
|
|
73
|
+
:return: Self reference for method chaining
|
|
74
|
+
:rtype: RemoteReadRequest
|
|
75
|
+
|
|
76
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
77
|
+
:raises ValueError: If nested model conversion fails
|
|
78
|
+
"""
|
|
79
|
+
m = m or dict()
|
|
80
|
+
if m.get('remoteReadUrl') is not None:
|
|
81
|
+
self.remote_read_url = m.get('remoteReadUrl')
|
|
82
|
+
if m.get('query') is not None:
|
|
83
|
+
self.query = m.get('query')
|
|
84
|
+
if m.get('step') is not None:
|
|
85
|
+
self.step = m.get('step')
|
|
86
|
+
if m.get('start') is not None:
|
|
87
|
+
self.start = m.get('start')
|
|
88
|
+
if m.get('end') is not None:
|
|
89
|
+
self.end = m.get('end')
|
|
90
|
+
return self
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for RemoteReadResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RemoteReadResponse(BceResponse):
|
|
9
|
+
"""
|
|
10
|
+
RemoteReadResponse
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(
|
|
14
|
+
self,
|
|
15
|
+
status=None,
|
|
16
|
+
is_partial=None,
|
|
17
|
+
data=None,
|
|
18
|
+
data_result_type=None,
|
|
19
|
+
data_result=None,
|
|
20
|
+
data_result_metric=None,
|
|
21
|
+
data_result_values=None,
|
|
22
|
+
data_result_value=None,
|
|
23
|
+
):
|
|
24
|
+
"""
|
|
25
|
+
Initialize RemoteReadResponse response.
|
|
26
|
+
|
|
27
|
+
:param status: 请求是否成功。
|
|
28
|
+
:type status: str (optional)
|
|
29
|
+
|
|
30
|
+
:param is_partial: 查询结果是否为部分数据。
|
|
31
|
+
:type is_partial: bool (optional)
|
|
32
|
+
|
|
33
|
+
:param data: data field
|
|
34
|
+
:type data: object (optional)
|
|
35
|
+
|
|
36
|
+
:param data_result_type: 查询结果类型,如 `matrix` 或 `vector`。
|
|
37
|
+
:type data_result_type: str (optional)
|
|
38
|
+
|
|
39
|
+
:param data_result: 查询结果列表,列表项包含 `metric` 以及 `values` 或 `value` 等信息。
|
|
40
|
+
:type data_result: List[object] (optional)
|
|
41
|
+
|
|
42
|
+
:param data_result_metric: 查询指标的所有维度。
|
|
43
|
+
:type data_result_metric: Dict[str, object] (optional)
|
|
44
|
+
|
|
45
|
+
:param data_result_values: 区间查询返回的样本点列表,每个元素为 `[时间戳, 数值]`。
|
|
46
|
+
:type data_result_values: List[object] (optional)
|
|
47
|
+
|
|
48
|
+
:param data_result_value: 即时查询返回的单个样本点,格式为 `[时间戳, 数值]`。
|
|
49
|
+
:type data_result_value: List[object] (optional)
|
|
50
|
+
"""
|
|
51
|
+
super().__init__()
|
|
52
|
+
self.status = status
|
|
53
|
+
self.is_partial = is_partial
|
|
54
|
+
self.data = data
|
|
55
|
+
self.data_result_type = data_result_type
|
|
56
|
+
self.data_result = data_result
|
|
57
|
+
self.data_result_metric = data_result_metric
|
|
58
|
+
self.data_result_values = data_result_values
|
|
59
|
+
self.data_result_value = data_result_value
|
|
60
|
+
|
|
61
|
+
def to_dict(self):
|
|
62
|
+
"""
|
|
63
|
+
Convert the response instance to a dictionary representation.
|
|
64
|
+
|
|
65
|
+
Includes metadata from the parent BceResponse class.
|
|
66
|
+
Nested model objects are recursively converted to dictionaries.
|
|
67
|
+
|
|
68
|
+
:return: Dictionary representation of the response
|
|
69
|
+
:rtype: dict
|
|
70
|
+
"""
|
|
71
|
+
_map = super().to_dict()
|
|
72
|
+
if _map is not None:
|
|
73
|
+
return _map
|
|
74
|
+
result = dict()
|
|
75
|
+
if self.metadata is not None:
|
|
76
|
+
result['metadata'] = dict(self.metadata)
|
|
77
|
+
if self.status is not None:
|
|
78
|
+
result['status'] = self.status
|
|
79
|
+
if self.is_partial is not None:
|
|
80
|
+
result['isPartial'] = self.is_partial
|
|
81
|
+
if self.data is not None:
|
|
82
|
+
result['data'] = self.data
|
|
83
|
+
if self.data_result_type is not None:
|
|
84
|
+
result['data.resultType'] = self.data_result_type
|
|
85
|
+
if self.data_result is not None:
|
|
86
|
+
result['data.result'] = self.data_result
|
|
87
|
+
if self.data_result_metric is not None:
|
|
88
|
+
result['data.result[].metric'] = self.data_result_metric
|
|
89
|
+
if self.data_result_values is not None:
|
|
90
|
+
result['data.result[].values'] = self.data_result_values
|
|
91
|
+
if self.data_result_value is not None:
|
|
92
|
+
result['data.result[].value'] = self.data_result_value
|
|
93
|
+
return result
|
|
94
|
+
|
|
95
|
+
def from_dict(self, m):
|
|
96
|
+
"""
|
|
97
|
+
Populate the response instance from a dictionary.
|
|
98
|
+
|
|
99
|
+
Nested dictionaries are recursively converted to model objects.
|
|
100
|
+
|
|
101
|
+
:param m: Dictionary containing response data
|
|
102
|
+
:type m: dict
|
|
103
|
+
|
|
104
|
+
:return: Self reference for method chaining
|
|
105
|
+
:rtype: RemoteReadResponse
|
|
106
|
+
|
|
107
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
108
|
+
:raises ValueError: If nested model conversion fails
|
|
109
|
+
"""
|
|
110
|
+
m = m or dict()
|
|
111
|
+
if m.get('status') is not None:
|
|
112
|
+
self.status = m.get('status')
|
|
113
|
+
if m.get('isPartial') is not None:
|
|
114
|
+
self.is_partial = m.get('isPartial')
|
|
115
|
+
if m.get('data') is not None:
|
|
116
|
+
self.data = m.get('data')
|
|
117
|
+
if m.get('data.resultType') is not None:
|
|
118
|
+
self.data_result_type = m.get('data.resultType')
|
|
119
|
+
if m.get('data.result') is not None:
|
|
120
|
+
self.data_result = m.get('data.result')
|
|
121
|
+
if m.get('data.result[].metric') is not None:
|
|
122
|
+
self.data_result_metric = m.get('data.result[].metric')
|
|
123
|
+
if m.get('data.result[].values') is not None:
|
|
124
|
+
self.data_result_values = m.get('data.result[].values')
|
|
125
|
+
if m.get('data.result[].value') is not None:
|
|
126
|
+
self.data_result_value = m.get('data.result[].value')
|
|
127
|
+
return self
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for RemoteWriteRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RemoteWriteRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for RemoteWriteRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, remote_write_url, body, content_type, content_encoding, instance_id, authorization):
|
|
16
|
+
"""
|
|
17
|
+
Initialize RemoteWriteRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param remote_write_url: remote_write_url parameter
|
|
20
|
+
:type remote_write_url: str (required)
|
|
21
|
+
|
|
22
|
+
:param body: body parameter
|
|
23
|
+
:type body: bytearray (required)
|
|
24
|
+
|
|
25
|
+
:param content_type: content_type parameter
|
|
26
|
+
:type content_type: str (required)
|
|
27
|
+
|
|
28
|
+
:param content_encoding: content_encoding parameter
|
|
29
|
+
:type content_encoding: str (required)
|
|
30
|
+
|
|
31
|
+
:param instance_id: instance_id parameter
|
|
32
|
+
:type instance_id: str (required)
|
|
33
|
+
|
|
34
|
+
:param authorization: authorization parameter
|
|
35
|
+
:type authorization: str (required)
|
|
36
|
+
"""
|
|
37
|
+
super().__init__()
|
|
38
|
+
self.remote_write_url = remote_write_url
|
|
39
|
+
self.body = body
|
|
40
|
+
self.content_type = content_type
|
|
41
|
+
self.content_encoding = content_encoding
|
|
42
|
+
self.instance_id = instance_id
|
|
43
|
+
self.authorization = authorization
|
|
44
|
+
|
|
45
|
+
def to_dict(self):
|
|
46
|
+
"""
|
|
47
|
+
Convert the request entity to a dictionary representation.
|
|
48
|
+
|
|
49
|
+
Nested model objects are recursively converted to dictionaries.
|
|
50
|
+
|
|
51
|
+
:return: Dictionary representation of the request
|
|
52
|
+
:rtype: dict
|
|
53
|
+
"""
|
|
54
|
+
_map = super().to_dict()
|
|
55
|
+
if _map is not None:
|
|
56
|
+
return _map
|
|
57
|
+
result = dict()
|
|
58
|
+
if self.body is not None:
|
|
59
|
+
result['body'] = self.body
|
|
60
|
+
return result
|
|
61
|
+
|
|
62
|
+
def from_dict(self, m):
|
|
63
|
+
"""
|
|
64
|
+
Populate the request entity from a dictionary.
|
|
65
|
+
|
|
66
|
+
Nested dictionaries are recursively converted to model objects.
|
|
67
|
+
|
|
68
|
+
:param m: Dictionary containing request data
|
|
69
|
+
:type m: dict
|
|
70
|
+
|
|
71
|
+
:return: Self reference for method chaining
|
|
72
|
+
:rtype: RemoteWriteRequest
|
|
73
|
+
|
|
74
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
75
|
+
:raises ValueError: If nested model conversion fails
|
|
76
|
+
"""
|
|
77
|
+
m = m or dict()
|
|
78
|
+
if m.get('remoteWriteUrl') is not None:
|
|
79
|
+
self.remote_write_url = m.get('remoteWriteUrl')
|
|
80
|
+
if m.get('body') is not None:
|
|
81
|
+
self.body = m.get('body')
|
|
82
|
+
if m.get('Content-Type') is not None:
|
|
83
|
+
self.content_type = m.get('Content-Type')
|
|
84
|
+
if m.get('Content-Encoding') is not None:
|
|
85
|
+
self.content_encoding = m.get('Content-Encoding')
|
|
86
|
+
if m.get('InstanceId') is not None:
|
|
87
|
+
self.instance_id = m.get('InstanceId')
|
|
88
|
+
if m.get('Authorization') is not None:
|
|
89
|
+
self.authorization = m.get('Authorization')
|
|
90
|
+
return self
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""
|
|
2
|
+
RepeatNotifyConfig information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RepeatNotifyConfig(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
RepeatNotifyConfig
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, enabled=None, interval_hour=None, interval_min=None, max_count=None, strategy=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize RepeatNotifyConfig instance.
|
|
16
|
+
|
|
17
|
+
:param enabled: 是否开启重复通知
|
|
18
|
+
:type enabled: bool (optional)
|
|
19
|
+
|
|
20
|
+
:param interval_hour: 重复通知间隔小时数
|
|
21
|
+
:type interval_hour: int (optional)
|
|
22
|
+
|
|
23
|
+
:param interval_min: 重复通知间隔分钟数
|
|
24
|
+
:type interval_min: int (optional)
|
|
25
|
+
|
|
26
|
+
:param max_count: 最大重复通知次数
|
|
27
|
+
:type max_count: int (optional)
|
|
28
|
+
|
|
29
|
+
:param strategy: 重复通知策略
|
|
30
|
+
:type strategy: str (optional)
|
|
31
|
+
"""
|
|
32
|
+
super().__init__()
|
|
33
|
+
self.enabled = enabled
|
|
34
|
+
self.interval_hour = interval_hour
|
|
35
|
+
self.interval_min = interval_min
|
|
36
|
+
self.max_count = max_count
|
|
37
|
+
self.strategy = strategy
|
|
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.enabled is not None:
|
|
53
|
+
result['enabled'] = self.enabled
|
|
54
|
+
if self.interval_hour is not None:
|
|
55
|
+
result['intervalHour'] = self.interval_hour
|
|
56
|
+
if self.interval_min is not None:
|
|
57
|
+
result['intervalMin'] = self.interval_min
|
|
58
|
+
if self.max_count is not None:
|
|
59
|
+
result['maxCount'] = self.max_count
|
|
60
|
+
if self.strategy is not None:
|
|
61
|
+
result['strategy'] = self.strategy
|
|
62
|
+
return result
|
|
63
|
+
|
|
64
|
+
def from_dict(self, m):
|
|
65
|
+
"""
|
|
66
|
+
Populate the model instance from a dictionary.
|
|
67
|
+
|
|
68
|
+
Nested dictionaries are recursively converted to model objects.
|
|
69
|
+
|
|
70
|
+
:param m: Dictionary containing model data
|
|
71
|
+
:type m: dict
|
|
72
|
+
|
|
73
|
+
:return: Self reference for method chaining
|
|
74
|
+
:rtype: RepeatNotifyConfig
|
|
75
|
+
|
|
76
|
+
:raises TypeError: If input is not a dictionary type
|
|
77
|
+
:raises ValueError: If nested model conversion fails
|
|
78
|
+
"""
|
|
79
|
+
m = m or dict()
|
|
80
|
+
if m.get('enabled') is not None:
|
|
81
|
+
self.enabled = m.get('enabled')
|
|
82
|
+
if m.get('intervalHour') is not None:
|
|
83
|
+
self.interval_hour = m.get('intervalHour')
|
|
84
|
+
if m.get('intervalMin') is not None:
|
|
85
|
+
self.interval_min = m.get('intervalMin')
|
|
86
|
+
if m.get('maxCount') is not None:
|
|
87
|
+
self.max_count = m.get('maxCount')
|
|
88
|
+
if m.get('strategy') is not None:
|
|
89
|
+
self.strategy = m.get('strategy')
|
|
90
|
+
return self
|