baiducloud-python-sdk-as 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. baiducloud_python_sdk_as/__init__.py +5 -0
  2. baiducloud_python_sdk_as/api/__init__.py +0 -0
  3. baiducloud_python_sdk_as/api/as_client.py +626 -0
  4. baiducloud_python_sdk_as/models/__init__.py +78 -0
  5. baiducloud_python_sdk_as/models/action_type.py +20 -0
  6. baiducloud_python_sdk_as/models/adjust_num_v2_request.py +72 -0
  7. baiducloud_python_sdk_as/models/adjust_num_v2_response.py +80 -0
  8. baiducloud_python_sdk_as/models/alarm_rule.py +135 -0
  9. baiducloud_python_sdk_as/models/as_alarm_rule.py +189 -0
  10. baiducloud_python_sdk_as/models/as_eip.py +90 -0
  11. baiducloud_python_sdk_as/models/as_group.py +186 -0
  12. baiducloud_python_sdk_as/models/as_record.py +202 -0
  13. baiducloud_python_sdk_as/models/assign_tag_info.py +76 -0
  14. baiducloud_python_sdk_as/models/attach_node_v2_request.py +72 -0
  15. baiducloud_python_sdk_as/models/attach_node_v2_response.py +78 -0
  16. baiducloud_python_sdk_as/models/bcc_name_config.py +82 -0
  17. baiducloud_python_sdk_as/models/billing_info.py +68 -0
  18. baiducloud_python_sdk_as/models/blb_info.py +82 -0
  19. baiducloud_python_sdk_as/models/cds_info.py +82 -0
  20. baiducloud_python_sdk_as/models/check_detail.py +74 -0
  21. baiducloud_python_sdk_as/models/check_entity.py +76 -0
  22. baiducloud_python_sdk_as/models/cmd_config.py +142 -0
  23. baiducloud_python_sdk_as/models/create_as_group_v2_request.py +245 -0
  24. baiducloud_python_sdk_as/models/create_as_group_v2_response.py +69 -0
  25. baiducloud_python_sdk_as/models/create_rule_v2_request.py +172 -0
  26. baiducloud_python_sdk_as/models/create_rule_v2_response.py +61 -0
  27. baiducloud_python_sdk_as/models/dag_model.py +58 -0
  28. baiducloud_python_sdk_as/models/delete_as_group_v2_request.py +60 -0
  29. baiducloud_python_sdk_as/models/delete_rule_v2_request.py +58 -0
  30. baiducloud_python_sdk_as/models/detach_node_v2_request.py +72 -0
  31. baiducloud_python_sdk_as/models/detach_node_v2_response.py +78 -0
  32. baiducloud_python_sdk_as/models/dimension.py +66 -0
  33. baiducloud_python_sdk_as/models/eip_config.py +112 -0
  34. baiducloud_python_sdk_as/models/eip_group_bandwidth.py +74 -0
  35. baiducloud_python_sdk_as/models/eip_group_decrease.py +58 -0
  36. baiducloud_python_sdk_as/models/eip_group_increase.py +66 -0
  37. baiducloud_python_sdk_as/models/eip_info.py +82 -0
  38. baiducloud_python_sdk_as/models/ephemeral_disk.py +66 -0
  39. baiducloud_python_sdk_as/models/exec_cmd_strategy_type.py +19 -0
  40. baiducloud_python_sdk_as/models/exec_rule_v2_request.py +72 -0
  41. baiducloud_python_sdk_as/models/exec_rule_v2_response.py +80 -0
  42. baiducloud_python_sdk_as/models/expect_action.py +74 -0
  43. baiducloud_python_sdk_as/models/get_as_group_v2_request.py +58 -0
  44. baiducloud_python_sdk_as/models/get_as_group_v2_response.py +279 -0
  45. baiducloud_python_sdk_as/models/get_rule_v2_request.py +58 -0
  46. baiducloud_python_sdk_as/models/get_rule_v2_response.py +218 -0
  47. baiducloud_python_sdk_as/models/group_config.py +90 -0
  48. baiducloud_python_sdk_as/models/health_check_config.py +66 -0
  49. baiducloud_python_sdk_as/models/health_check_state.py +102 -0
  50. baiducloud_python_sdk_as/models/list_as_group_v2_request.py +96 -0
  51. baiducloud_python_sdk_as/models/list_as_group_v2_response.py +102 -0
  52. baiducloud_python_sdk_as/models/list_as_node_v2_request.py +94 -0
  53. baiducloud_python_sdk_as/models/list_as_node_v2_response.py +102 -0
  54. baiducloud_python_sdk_as/models/list_rule_v2_request.py +94 -0
  55. baiducloud_python_sdk_as/models/list_rule_v2_response.py +102 -0
  56. baiducloud_python_sdk_as/models/list_task_v2_request.py +94 -0
  57. baiducloud_python_sdk_as/models/list_task_v2_response.py +102 -0
  58. baiducloud_python_sdk_as/models/monitor_object.py +84 -0
  59. baiducloud_python_sdk_as/models/node.py +245 -0
  60. baiducloud_python_sdk_as/models/node_info.py +373 -0
  61. baiducloud_python_sdk_as/models/period_type.py +21 -0
  62. baiducloud_python_sdk_as/models/policy_resource.py +70 -0
  63. baiducloud_python_sdk_as/models/reservation.py +58 -0
  64. baiducloud_python_sdk_as/models/resource.py +66 -0
  65. baiducloud_python_sdk_as/models/rule.py +216 -0
  66. baiducloud_python_sdk_as/models/scale_condition.py +160 -0
  67. baiducloud_python_sdk_as/models/scaling_down_v2_request.py +72 -0
  68. baiducloud_python_sdk_as/models/scaling_down_v2_response.py +78 -0
  69. baiducloud_python_sdk_as/models/scaling_up_v2_request.py +88 -0
  70. baiducloud_python_sdk_as/models/scaling_up_v2_response.py +80 -0
  71. baiducloud_python_sdk_as/models/state.py +19 -0
  72. baiducloud_python_sdk_as/models/status.py +41 -0
  73. baiducloud_python_sdk_as/models/tag_info.py +66 -0
  74. baiducloud_python_sdk_as/models/type.py +20 -0
  75. baiducloud_python_sdk_as/models/update_is_managed_v2_request.py +80 -0
  76. baiducloud_python_sdk_as/models/update_protect_v2_request.py +80 -0
  77. baiducloud_python_sdk_as/models/vpc_info.py +74 -0
  78. baiducloud_python_sdk_as/models/zone_info.py +100 -0
  79. baiducloud_python_sdk_as-0.0.1.dist-info/LICENSE +177 -0
  80. baiducloud_python_sdk_as-0.0.1.dist-info/METADATA +76 -0
  81. baiducloud_python_sdk_as-0.0.1.dist-info/RECORD +83 -0
  82. baiducloud_python_sdk_as-0.0.1.dist-info/WHEEL +5 -0
  83. baiducloud_python_sdk_as-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,78 @@
1
+ """
2
+ Models for as SDK.
3
+ """
4
+
5
+ from .action_type import ActionType
6
+ from .adjust_num_v2_request import AdjustNumV2Request
7
+ from .adjust_num_v2_response import AdjustNumV2Response
8
+ from .alarm_rule import AlarmRule
9
+ from .as_alarm_rule import AsAlarmRule
10
+ from .as_eip import AsEip
11
+ from .as_group import AsGroup
12
+ from .as_record import AsRecord
13
+ from .assign_tag_info import AssignTagInfo
14
+ from .attach_node_v2_request import AttachNodeV2Request
15
+ from .attach_node_v2_response import AttachNodeV2Response
16
+ from .bcc_name_config import BccNameConfig
17
+ from .billing_info import BillingInfo
18
+ from .blb_info import BlbInfo
19
+ from .cds_info import CdsInfo
20
+ from .check_detail import CheckDetail
21
+ from .check_entity import CheckEntity
22
+ from .cmd_config import CmdConfig
23
+ from .create_as_group_v2_request import CreateAsGroupV2Request
24
+ from .create_as_group_v2_response import CreateAsGroupV2Response
25
+ from .create_rule_v2_request import CreateRuleV2Request
26
+ from .create_rule_v2_response import CreateRuleV2Response
27
+ from .dag_model import DagModel
28
+ from .delete_as_group_v2_request import DeleteAsGroupV2Request
29
+ from .detach_node_v2_request import DetachNodeV2Request
30
+ from .detach_node_v2_response import DetachNodeV2Response
31
+ from .dimension import Dimension
32
+ from .eip_config import EipConfig
33
+ from .eip_group_bandwidth import EipGroupBandwidth
34
+ from .eip_group_decrease import EipGroupDecrease
35
+ from .eip_group_increase import EipGroupIncrease
36
+ from .eip_info import EipInfo
37
+ from .ephemeral_disk import EphemeralDisk
38
+ from .exec_cmd_strategy_type import ExecCmdStrategyType
39
+ from .exec_rule_v2_request import ExecRuleV2Request
40
+ from .exec_rule_v2_response import ExecRuleV2Response
41
+ from .expect_action import ExpectAction
42
+ from .get_as_group_v2_response import GetAsGroupV2Response
43
+ from .get_rule_v2_response import GetRuleV2Response
44
+ from .group_config import GroupConfig
45
+ from .health_check_config import HealthCheckConfig
46
+ from .health_check_state import HealthCheckState
47
+ from .list_as_group_v2_response import ListAsGroupV2Response
48
+ from .list_as_node_v2_response import ListAsNodeV2Response
49
+ from .list_rule_v2_response import ListRuleV2Response
50
+ from .list_task_v2_response import ListTaskV2Response
51
+ from .monitor_object import MonitorObject
52
+ from .node import Node
53
+ from .node_info import NodeInfo
54
+ from .period_type import PeriodType
55
+ from .policy_resource import PolicyResource
56
+ from .reservation import Reservation
57
+ from .resource import Resource
58
+ from .rule import Rule
59
+ from .scale_condition import ScaleCondition
60
+ from .scaling_down_v2_request import ScalingDownV2Request
61
+ from .scaling_down_v2_response import ScalingDownV2Response
62
+ from .scaling_up_v2_request import ScalingUpV2Request
63
+ from .scaling_up_v2_response import ScalingUpV2Response
64
+ from .state import State
65
+ from .status import Status
66
+ from .tag_info import TagInfo
67
+ from .type import Type
68
+ from .update_is_managed_v2_request import UpdateIsManagedV2Request
69
+ from .update_protect_v2_request import UpdateProtectV2Request
70
+ from .vpc_info import VpcInfo
71
+ from .zone_info import ZoneInfo
72
+ from .get_rule_v2_request import GetRuleV2Request
73
+ from .delete_rule_v2_request import DeleteRuleV2Request
74
+ from .get_as_group_v2_request import GetAsGroupV2Request
75
+ from .list_rule_v2_request import ListRuleV2Request
76
+ from .list_as_group_v2_request import ListAsGroupV2Request
77
+ from .list_as_node_v2_request import ListAsNodeV2Request
78
+ from .list_task_v2_request import ListTaskV2Request
@@ -0,0 +1,20 @@
1
+ """
2
+ ActionType information
3
+ """
4
+
5
+
6
+ class ActionType:
7
+ """
8
+ Enum class for ActionType
9
+ Allowed values: INCREASE, DECREASE, ADJUST
10
+ """
11
+
12
+ INCREASE = 'INCREASE'
13
+ DECREASE = 'DECREASE'
14
+ ADJUST = 'ADJUST'
15
+
16
+ @staticmethod
17
+ def is_valid(value):
18
+ """Check if the value is valid for this enum"""
19
+ valid_values = ['INCREASE', 'DECREASE', 'ADJUST']
20
+ return value in valid_values
@@ -0,0 +1,72 @@
1
+ """
2
+ Request entity for AdjustNumV2Request information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class AdjustNumV2Request(AbstractModel):
9
+ """
10
+ Request entity for AdjustNumV2Request operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(self, group_id, adjust_node, adjust_num):
16
+ """
17
+ Initialize AdjustNumV2Request request entity.
18
+
19
+ :param group_id: group_id parameter
20
+ :type group_id: str (required)
21
+
22
+ :param adjust_node: adjust_node parameter
23
+ :type adjust_node: str (required)
24
+
25
+ :param adjust_num: 期望调整到的节点数
26
+ :type adjust_num: int (required)
27
+ """
28
+ super().__init__()
29
+ self.group_id = group_id
30
+ self.adjust_node = adjust_node
31
+ self.adjust_num = adjust_num
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
+ if self.adjust_num is not None:
47
+ result['adjustNum'] = self.adjust_num
48
+ return result
49
+
50
+ def from_dict(self, m):
51
+ """
52
+ Populate the request entity from a dictionary.
53
+
54
+ Nested dictionaries are recursively converted to model objects.
55
+
56
+ :param m: Dictionary containing request data
57
+ :type m: dict
58
+
59
+ :return: Self reference for method chaining
60
+ :rtype: AdjustNumV2Request
61
+
62
+ :raises TypeError: If input is not a dictionary or field type mismatch
63
+ :raises ValueError: If nested model conversion fails
64
+ """
65
+ m = m or dict()
66
+ if m.get('groupId') is not None:
67
+ self.group_id = m.get('groupId')
68
+ if m.get('adjustNode') is not None:
69
+ self.adjust_node = m.get('adjustNode')
70
+ if m.get('adjustNum') is not None:
71
+ self.adjust_num = m.get('adjustNum')
72
+ return self
@@ -0,0 +1,80 @@
1
+ """
2
+ AdjustNumV2Response information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+ from baiducloud_python_sdk_as.models.dag_model import DagModel
8
+
9
+
10
+ class AdjustNumV2Response(BceResponse):
11
+ """
12
+ AdjustNumV2Response
13
+ """
14
+
15
+ def __init__(self, success=None, msg=None, result=None):
16
+ """
17
+ Initialize AdjustNumV2Response instance.
18
+
19
+ :param success: 请求是否成功
20
+ :type success: bool (optional)
21
+
22
+ :param msg: 响应消息
23
+ :type msg: str (optional)
24
+
25
+ :param result: result attribute
26
+ :type result: DagModel (optional)
27
+ """
28
+ super().__init__()
29
+ self.success = success
30
+ self.msg = msg
31
+ self.result = result
32
+
33
+ def to_dict(self):
34
+ """
35
+ Convert the model instance to a dictionary representation.
36
+
37
+ Nested model objects are recursively converted to dictionaries.
38
+
39
+ Includes metadata from the parent BceResponse class.
40
+
41
+ :return: Dictionary representation of the model
42
+ :rtype: dict
43
+ """
44
+ _map = super().to_dict()
45
+ if _map is not None:
46
+ return _map
47
+ result = dict()
48
+ if self.metadata is not None:
49
+ result['metadata'] = dict(self.metadata)
50
+ if self.success is not None:
51
+ result['success'] = self.success
52
+ if self.msg is not None:
53
+ result['msg'] = self.msg
54
+ if self.result is not None:
55
+ result['result'] = self.result.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: AdjustNumV2Response
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('success') is not None:
75
+ self.success = m.get('success')
76
+ if m.get('msg') is not None:
77
+ self.msg = m.get('msg')
78
+ if m.get('result') is not None:
79
+ self.result = DagModel().from_dict(m.get('result'))
80
+ return self
@@ -0,0 +1,135 @@
1
+ """
2
+ AlarmRule information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_as.models.dimension import Dimension
8
+
9
+
10
+ class AlarmRule(AbstractModel):
11
+ """
12
+ AlarmRule
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ id=None,
18
+ index=None,
19
+ metric=None,
20
+ period_in_second=None,
21
+ statistics=None,
22
+ threshold=None,
23
+ comparison_operator=None,
24
+ evaluation_period_count=None,
25
+ metric_dimensions=None,
26
+ ):
27
+ """
28
+ Initialize AlarmRule instance.
29
+
30
+ :param id: 报警规则id
31
+ :type id: int (optional)
32
+
33
+ :param index: 报警规则的索引,当多个规则共同组成同一报警规则,它们的索引相同
34
+ :type index: int (optional)
35
+
36
+ :param metric: 监控指标名称,如:vCPUUsagePercent
37
+ :type metric: str (optional)
38
+
39
+ :param period_in_second: 多长时间计算一次是否满足各个报警规则,即单个评估周期时长,单位s
40
+ :type period_in_second: int (optional)
41
+
42
+ :param statistics: 统计方式,可选值为:maximum(最大值)、minimum(最小值)、sum(和值)、average(平均值)
43
+ :type statistics: str (optional)
44
+
45
+ :param threshold: 报警规则的阈值
46
+ :type threshold: str (optional)
47
+
48
+ :param comparison_operator: 和阈值比较的算符,取值为>=、>、=、<、<=
49
+ :type comparison_operator: str (optional)
50
+
51
+ :param evaluation_period_count: 触发报警所需连续发生次数
52
+ :type evaluation_period_count: int (optional)
53
+
54
+ :param metric_dimensions: 指标维度
55
+ :type metric_dimensions: List[Dimension] (optional)
56
+ """
57
+ super().__init__()
58
+ self.id = id
59
+ self.index = index
60
+ self.metric = metric
61
+ self.period_in_second = period_in_second
62
+ self.statistics = statistics
63
+ self.threshold = threshold
64
+ self.comparison_operator = comparison_operator
65
+ self.evaluation_period_count = evaluation_period_count
66
+ self.metric_dimensions = metric_dimensions
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.id is not None:
82
+ result['id'] = self.id
83
+ if self.index is not None:
84
+ result['index'] = self.index
85
+ if self.metric is not None:
86
+ result['metric'] = self.metric
87
+ if self.period_in_second is not None:
88
+ result['periodInSecond'] = self.period_in_second
89
+ if self.statistics is not None:
90
+ result['statistics'] = self.statistics
91
+ if self.threshold is not None:
92
+ result['threshold'] = self.threshold
93
+ if self.comparison_operator is not None:
94
+ result['comparisonOperator'] = self.comparison_operator
95
+ if self.evaluation_period_count is not None:
96
+ result['evaluationPeriodCount'] = self.evaluation_period_count
97
+ if self.metric_dimensions is not None:
98
+ result['metricDimensions'] = [i.to_dict() for i in self.metric_dimensions]
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: AlarmRule
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('id') is not None:
118
+ self.id = m.get('id')
119
+ if m.get('index') is not None:
120
+ self.index = m.get('index')
121
+ if m.get('metric') is not None:
122
+ self.metric = m.get('metric')
123
+ if m.get('periodInSecond') is not None:
124
+ self.period_in_second = m.get('periodInSecond')
125
+ if m.get('statistics') is not None:
126
+ self.statistics = m.get('statistics')
127
+ if m.get('threshold') is not None:
128
+ self.threshold = m.get('threshold')
129
+ if m.get('comparisonOperator') is not None:
130
+ self.comparison_operator = m.get('comparisonOperator')
131
+ if m.get('evaluationPeriodCount') is not None:
132
+ self.evaluation_period_count = m.get('evaluationPeriodCount')
133
+ if m.get('metricDimensions') is not None:
134
+ self.metric_dimensions = [Dimension().from_dict(i) for i in m.get('metricDimensions')]
135
+ return self
@@ -0,0 +1,189 @@
1
+ """
2
+ AsAlarmRule information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_as.models.monitor_object import MonitorObject
8
+
9
+
10
+ class AsAlarmRule(AbstractModel):
11
+ """
12
+ AsAlarmRule
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ id=None,
18
+ scope=None,
19
+ monitor_object=None,
20
+ rules=None,
21
+ alarm_name=None,
22
+ alias_name=None,
23
+ insufficient_cycle=None,
24
+ policy_enabled=None,
25
+ rule_contents=None,
26
+ rule_contents_en=None,
27
+ source=None,
28
+ component_type=None,
29
+ alarm_actions=None,
30
+ ok_actions=None,
31
+ insufficient_actions=None,
32
+ ):
33
+ """
34
+ Initialize AsAlarmRule instance.
35
+
36
+ :param id: 策略ID
37
+ :type id: int (optional)
38
+
39
+ :param scope: 策略归属产品
40
+ :type scope: str (optional)
41
+
42
+ :param monitor_object: monitor_object attribute
43
+ :type monitor_object: MonitorObject (optional)
44
+
45
+ :param rules: 创建伸缩组的规则时,传入具体的判断规则,支持且规则、或规则。
46
+ :type rules: List[List[AlarmRule]] (optional)
47
+
48
+ :param alarm_name: BCM策略ID,使用BCM已有策略时候,传入对应策略的唯一id
49
+ :type alarm_name: str (optional)
50
+
51
+ :param alias_name: BCM策略别名
52
+ :type alias_name: str (optional)
53
+
54
+ :param insufficient_cycle: 无数据状态触发的持续时间,单位s
55
+ :type insufficient_cycle: int (optional)
56
+
57
+ :param policy_enabled: 策略状态
58
+ :type policy_enabled: bool (optional)
59
+
60
+ :param rule_contents: 报警规则的内容描述
61
+ :type rule_contents: List[str] (optional)
62
+
63
+ :param rule_contents_en: 报警规则的英文描述
64
+ :type rule_contents_en: List[str] (optional)
65
+
66
+ :param source: 报警策略创建来源
67
+ :type source: str (optional)
68
+
69
+ :param component_type: 表示报警策略来自于哪个业务组件
70
+ :type component_type: str (optional)
71
+
72
+ :param alarm_actions: 报警动作
73
+ :type alarm_actions: List[str] (optional)
74
+
75
+ :param ok_actions: 当报警恢复时执行的动作列表
76
+ :type ok_actions: List[str] (optional)
77
+
78
+ :param insufficient_actions: 当数据不足时执行的动作列表
79
+ :type insufficient_actions: List[str] (optional)
80
+ """
81
+ super().__init__()
82
+ self.id = id
83
+ self.scope = scope
84
+ self.monitor_object = monitor_object
85
+ self.rules = rules
86
+ self.alarm_name = alarm_name
87
+ self.alias_name = alias_name
88
+ self.insufficient_cycle = insufficient_cycle
89
+ self.policy_enabled = policy_enabled
90
+ self.rule_contents = rule_contents
91
+ self.rule_contents_en = rule_contents_en
92
+ self.source = source
93
+ self.component_type = component_type
94
+ self.alarm_actions = alarm_actions
95
+ self.ok_actions = ok_actions
96
+ self.insufficient_actions = insufficient_actions
97
+
98
+ def to_dict(self):
99
+ """
100
+ Convert the model instance to a dictionary representation.
101
+
102
+ Nested model objects are recursively converted to dictionaries.
103
+
104
+ :return: Dictionary representation of the model
105
+ :rtype: dict
106
+ """
107
+ _map = super().to_dict()
108
+ if _map is not None:
109
+ return _map
110
+ result = dict()
111
+ if self.id is not None:
112
+ result['id'] = self.id
113
+ if self.scope is not None:
114
+ result['scope'] = self.scope
115
+ if self.monitor_object is not None:
116
+ result['monitorObject'] = self.monitor_object.to_dict()
117
+ if self.rules is not None:
118
+ result['rules'] = self.rules
119
+ if self.alarm_name is not None:
120
+ result['alarmName'] = self.alarm_name
121
+ if self.alias_name is not None:
122
+ result['aliasName'] = self.alias_name
123
+ if self.insufficient_cycle is not None:
124
+ result['insufficientCycle'] = self.insufficient_cycle
125
+ if self.policy_enabled is not None:
126
+ result['policyEnabled'] = self.policy_enabled
127
+ if self.rule_contents is not None:
128
+ result['ruleContents'] = self.rule_contents
129
+ if self.rule_contents_en is not None:
130
+ result['ruleContentsEn'] = self.rule_contents_en
131
+ if self.source is not None:
132
+ result['source'] = self.source
133
+ if self.component_type is not None:
134
+ result['componentType'] = self.component_type
135
+ if self.alarm_actions is not None:
136
+ result['alarmActions'] = self.alarm_actions
137
+ if self.ok_actions is not None:
138
+ result['okActions'] = self.ok_actions
139
+ if self.insufficient_actions is not None:
140
+ result['insufficientActions'] = self.insufficient_actions
141
+ return result
142
+
143
+ def from_dict(self, m):
144
+ """
145
+ Populate the model instance from a dictionary.
146
+
147
+ Nested dictionaries are recursively converted to model objects.
148
+
149
+ :param m: Dictionary containing model data
150
+ :type m: dict
151
+
152
+ :return: Self reference for method chaining
153
+ :rtype: AsAlarmRule
154
+
155
+ :raises TypeError: If input is not a dictionary type
156
+ :raises ValueError: If nested model conversion fails
157
+ """
158
+ m = m or dict()
159
+ if m.get('id') is not None:
160
+ self.id = m.get('id')
161
+ if m.get('scope') is not None:
162
+ self.scope = m.get('scope')
163
+ if m.get('monitorObject') is not None:
164
+ self.monitor_object = MonitorObject().from_dict(m.get('monitorObject'))
165
+ if m.get('rules') is not None:
166
+ self.rules = m.get('rules')
167
+ if m.get('alarmName') is not None:
168
+ self.alarm_name = m.get('alarmName')
169
+ if m.get('aliasName') is not None:
170
+ self.alias_name = m.get('aliasName')
171
+ if m.get('insufficientCycle') is not None:
172
+ self.insufficient_cycle = m.get('insufficientCycle')
173
+ if m.get('policyEnabled') is not None:
174
+ self.policy_enabled = m.get('policyEnabled')
175
+ if m.get('ruleContents') is not None:
176
+ self.rule_contents = m.get('ruleContents')
177
+ if m.get('ruleContentsEn') is not None:
178
+ self.rule_contents_en = m.get('ruleContentsEn')
179
+ if m.get('source') is not None:
180
+ self.source = m.get('source')
181
+ if m.get('componentType') is not None:
182
+ self.component_type = m.get('componentType')
183
+ if m.get('alarmActions') is not None:
184
+ self.alarm_actions = m.get('alarmActions')
185
+ if m.get('okActions') is not None:
186
+ self.ok_actions = m.get('okActions')
187
+ if m.get('insufficientActions') is not None:
188
+ self.insufficient_actions = m.get('insufficientActions')
189
+ return self
@@ -0,0 +1,90 @@
1
+ """
2
+ AsEip information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class AsEip(AbstractModel):
9
+ """
10
+ AsEip
11
+ """
12
+
13
+ def __init__(self, bandwidth_in_mbps=None, address=None, eip_id=None, eip_status=None, eip_allocation_id=None):
14
+ """
15
+ Initialize AsEip instance.
16
+
17
+ :param bandwidth_in_mbps: 最大带宽
18
+ :type bandwidth_in_mbps: int (optional)
19
+
20
+ :param address: 公网IP
21
+ :type address: str (optional)
22
+
23
+ :param eip_id: EIP的ID
24
+ :type eip_id: str (optional)
25
+
26
+ :param eip_status: EIP状态
27
+ :type eip_status: str (optional)
28
+
29
+ :param eip_allocation_id: 弹性公网IP-实例ID
30
+ :type eip_allocation_id: str (optional)
31
+ """
32
+ super().__init__()
33
+ self.bandwidth_in_mbps = bandwidth_in_mbps
34
+ self.address = address
35
+ self.eip_id = eip_id
36
+ self.eip_status = eip_status
37
+ self.eip_allocation_id = eip_allocation_id
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.bandwidth_in_mbps is not None:
53
+ result['bandwidthInMbps'] = self.bandwidth_in_mbps
54
+ if self.address is not None:
55
+ result['address'] = self.address
56
+ if self.eip_id is not None:
57
+ result['eipId'] = self.eip_id
58
+ if self.eip_status is not None:
59
+ result['eipStatus'] = self.eip_status
60
+ if self.eip_allocation_id is not None:
61
+ result['eipAllocationId'] = self.eip_allocation_id
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: AsEip
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('bandwidthInMbps') is not None:
81
+ self.bandwidth_in_mbps = m.get('bandwidthInMbps')
82
+ if m.get('address') is not None:
83
+ self.address = m.get('address')
84
+ if m.get('eipId') is not None:
85
+ self.eip_id = m.get('eipId')
86
+ if m.get('eipStatus') is not None:
87
+ self.eip_status = m.get('eipStatus')
88
+ if m.get('eipAllocationId') is not None:
89
+ self.eip_allocation_id = m.get('eipAllocationId')
90
+ return self