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.
- baiducloud_python_sdk_as/__init__.py +5 -0
- baiducloud_python_sdk_as/api/__init__.py +0 -0
- baiducloud_python_sdk_as/api/as_client.py +626 -0
- baiducloud_python_sdk_as/models/__init__.py +78 -0
- baiducloud_python_sdk_as/models/action_type.py +20 -0
- baiducloud_python_sdk_as/models/adjust_num_v2_request.py +72 -0
- baiducloud_python_sdk_as/models/adjust_num_v2_response.py +80 -0
- baiducloud_python_sdk_as/models/alarm_rule.py +135 -0
- baiducloud_python_sdk_as/models/as_alarm_rule.py +189 -0
- baiducloud_python_sdk_as/models/as_eip.py +90 -0
- baiducloud_python_sdk_as/models/as_group.py +186 -0
- baiducloud_python_sdk_as/models/as_record.py +202 -0
- baiducloud_python_sdk_as/models/assign_tag_info.py +76 -0
- baiducloud_python_sdk_as/models/attach_node_v2_request.py +72 -0
- baiducloud_python_sdk_as/models/attach_node_v2_response.py +78 -0
- baiducloud_python_sdk_as/models/bcc_name_config.py +82 -0
- baiducloud_python_sdk_as/models/billing_info.py +68 -0
- baiducloud_python_sdk_as/models/blb_info.py +82 -0
- baiducloud_python_sdk_as/models/cds_info.py +82 -0
- baiducloud_python_sdk_as/models/check_detail.py +74 -0
- baiducloud_python_sdk_as/models/check_entity.py +76 -0
- baiducloud_python_sdk_as/models/cmd_config.py +142 -0
- baiducloud_python_sdk_as/models/create_as_group_v2_request.py +245 -0
- baiducloud_python_sdk_as/models/create_as_group_v2_response.py +69 -0
- baiducloud_python_sdk_as/models/create_rule_v2_request.py +172 -0
- baiducloud_python_sdk_as/models/create_rule_v2_response.py +61 -0
- baiducloud_python_sdk_as/models/dag_model.py +58 -0
- baiducloud_python_sdk_as/models/delete_as_group_v2_request.py +60 -0
- baiducloud_python_sdk_as/models/delete_rule_v2_request.py +58 -0
- baiducloud_python_sdk_as/models/detach_node_v2_request.py +72 -0
- baiducloud_python_sdk_as/models/detach_node_v2_response.py +78 -0
- baiducloud_python_sdk_as/models/dimension.py +66 -0
- baiducloud_python_sdk_as/models/eip_config.py +112 -0
- baiducloud_python_sdk_as/models/eip_group_bandwidth.py +74 -0
- baiducloud_python_sdk_as/models/eip_group_decrease.py +58 -0
- baiducloud_python_sdk_as/models/eip_group_increase.py +66 -0
- baiducloud_python_sdk_as/models/eip_info.py +82 -0
- baiducloud_python_sdk_as/models/ephemeral_disk.py +66 -0
- baiducloud_python_sdk_as/models/exec_cmd_strategy_type.py +19 -0
- baiducloud_python_sdk_as/models/exec_rule_v2_request.py +72 -0
- baiducloud_python_sdk_as/models/exec_rule_v2_response.py +80 -0
- baiducloud_python_sdk_as/models/expect_action.py +74 -0
- baiducloud_python_sdk_as/models/get_as_group_v2_request.py +58 -0
- baiducloud_python_sdk_as/models/get_as_group_v2_response.py +279 -0
- baiducloud_python_sdk_as/models/get_rule_v2_request.py +58 -0
- baiducloud_python_sdk_as/models/get_rule_v2_response.py +218 -0
- baiducloud_python_sdk_as/models/group_config.py +90 -0
- baiducloud_python_sdk_as/models/health_check_config.py +66 -0
- baiducloud_python_sdk_as/models/health_check_state.py +102 -0
- baiducloud_python_sdk_as/models/list_as_group_v2_request.py +96 -0
- baiducloud_python_sdk_as/models/list_as_group_v2_response.py +102 -0
- baiducloud_python_sdk_as/models/list_as_node_v2_request.py +94 -0
- baiducloud_python_sdk_as/models/list_as_node_v2_response.py +102 -0
- baiducloud_python_sdk_as/models/list_rule_v2_request.py +94 -0
- baiducloud_python_sdk_as/models/list_rule_v2_response.py +102 -0
- baiducloud_python_sdk_as/models/list_task_v2_request.py +94 -0
- baiducloud_python_sdk_as/models/list_task_v2_response.py +102 -0
- baiducloud_python_sdk_as/models/monitor_object.py +84 -0
- baiducloud_python_sdk_as/models/node.py +245 -0
- baiducloud_python_sdk_as/models/node_info.py +373 -0
- baiducloud_python_sdk_as/models/period_type.py +21 -0
- baiducloud_python_sdk_as/models/policy_resource.py +70 -0
- baiducloud_python_sdk_as/models/reservation.py +58 -0
- baiducloud_python_sdk_as/models/resource.py +66 -0
- baiducloud_python_sdk_as/models/rule.py +216 -0
- baiducloud_python_sdk_as/models/scale_condition.py +160 -0
- baiducloud_python_sdk_as/models/scaling_down_v2_request.py +72 -0
- baiducloud_python_sdk_as/models/scaling_down_v2_response.py +78 -0
- baiducloud_python_sdk_as/models/scaling_up_v2_request.py +88 -0
- baiducloud_python_sdk_as/models/scaling_up_v2_response.py +80 -0
- baiducloud_python_sdk_as/models/state.py +19 -0
- baiducloud_python_sdk_as/models/status.py +41 -0
- baiducloud_python_sdk_as/models/tag_info.py +66 -0
- baiducloud_python_sdk_as/models/type.py +20 -0
- baiducloud_python_sdk_as/models/update_is_managed_v2_request.py +80 -0
- baiducloud_python_sdk_as/models/update_protect_v2_request.py +80 -0
- baiducloud_python_sdk_as/models/vpc_info.py +74 -0
- baiducloud_python_sdk_as/models/zone_info.py +100 -0
- baiducloud_python_sdk_as-0.0.1.dist-info/LICENSE +177 -0
- baiducloud_python_sdk_as-0.0.1.dist-info/METADATA +76 -0
- baiducloud_python_sdk_as-0.0.1.dist-info/RECORD +83 -0
- baiducloud_python_sdk_as-0.0.1.dist-info/WHEEL +5 -0
- baiducloud_python_sdk_as-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MonitorObject information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_as.models.policy_resource import PolicyResource
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MonitorObject(AbstractModel):
|
|
11
|
+
"""
|
|
12
|
+
MonitorObject
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, type=None, names=None, resources=None, type_name=None):
|
|
16
|
+
"""
|
|
17
|
+
Initialize MonitorObject instance.
|
|
18
|
+
|
|
19
|
+
:param type: 类型
|
|
20
|
+
:type type: str (optional)
|
|
21
|
+
|
|
22
|
+
:param names: 名称列表
|
|
23
|
+
:type names: List[str] (optional)
|
|
24
|
+
|
|
25
|
+
:param resources: 关联的策略资源列表
|
|
26
|
+
:type resources: List[PolicyResource] (optional)
|
|
27
|
+
|
|
28
|
+
:param type_name: 监控类型的可读名称
|
|
29
|
+
:type type_name: str (optional)
|
|
30
|
+
"""
|
|
31
|
+
super().__init__()
|
|
32
|
+
self.type = type
|
|
33
|
+
self.names = names
|
|
34
|
+
self.resources = resources
|
|
35
|
+
self.type_name = type_name
|
|
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.type is not None:
|
|
51
|
+
result['type'] = self.type
|
|
52
|
+
if self.names is not None:
|
|
53
|
+
result['names'] = self.names
|
|
54
|
+
if self.resources is not None:
|
|
55
|
+
result['resources'] = [i.to_dict() for i in self.resources]
|
|
56
|
+
if self.type_name is not None:
|
|
57
|
+
result['typeName'] = self.type_name
|
|
58
|
+
return result
|
|
59
|
+
|
|
60
|
+
def from_dict(self, m):
|
|
61
|
+
"""
|
|
62
|
+
Populate the model instance from a dictionary.
|
|
63
|
+
|
|
64
|
+
Nested dictionaries are recursively converted to model objects.
|
|
65
|
+
|
|
66
|
+
:param m: Dictionary containing model data
|
|
67
|
+
:type m: dict
|
|
68
|
+
|
|
69
|
+
:return: Self reference for method chaining
|
|
70
|
+
:rtype: MonitorObject
|
|
71
|
+
|
|
72
|
+
:raises TypeError: If input is not a dictionary type
|
|
73
|
+
:raises ValueError: If nested model conversion fails
|
|
74
|
+
"""
|
|
75
|
+
m = m or dict()
|
|
76
|
+
if m.get('type') is not None:
|
|
77
|
+
self.type = m.get('type')
|
|
78
|
+
if m.get('names') is not None:
|
|
79
|
+
self.names = m.get('names')
|
|
80
|
+
if m.get('resources') is not None:
|
|
81
|
+
self.resources = [PolicyResource().from_dict(i) for i in m.get('resources')]
|
|
82
|
+
if m.get('typeName') is not None:
|
|
83
|
+
self.type_name = m.get('typeName')
|
|
84
|
+
return self
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Node information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_as.models.as_eip import AsEip
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_as.models.tag_info import TagInfo
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Node(AbstractModel):
|
|
13
|
+
"""
|
|
14
|
+
Node
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
instance_id=None,
|
|
20
|
+
instance_uuid=None,
|
|
21
|
+
instance_name=None,
|
|
22
|
+
floating_ip=None,
|
|
23
|
+
internal_ip=None,
|
|
24
|
+
status=None,
|
|
25
|
+
payment=None,
|
|
26
|
+
cpu_count=None,
|
|
27
|
+
memory_capacity_in_gb=None,
|
|
28
|
+
instance_type=None,
|
|
29
|
+
sys_disk_in_gb=None,
|
|
30
|
+
create_time=None,
|
|
31
|
+
eip=None,
|
|
32
|
+
subnet_type=None,
|
|
33
|
+
is_protected=None,
|
|
34
|
+
node_type=None,
|
|
35
|
+
tags=None,
|
|
36
|
+
group_id=None,
|
|
37
|
+
is_managed=None,
|
|
38
|
+
internal_spec=None,
|
|
39
|
+
logical_zone=None,
|
|
40
|
+
):
|
|
41
|
+
"""
|
|
42
|
+
Initialize Node instance.
|
|
43
|
+
|
|
44
|
+
:param instance_id: 实例ID
|
|
45
|
+
:type instance_id: str (optional)
|
|
46
|
+
|
|
47
|
+
:param instance_uuid: 实例UUID
|
|
48
|
+
:type instance_uuid: str (optional)
|
|
49
|
+
|
|
50
|
+
:param instance_name: 实例名称
|
|
51
|
+
:type instance_name: str (optional)
|
|
52
|
+
|
|
53
|
+
:param floating_ip: 浮动IP
|
|
54
|
+
:type floating_ip: str (optional)
|
|
55
|
+
|
|
56
|
+
:param internal_ip: 内网IP
|
|
57
|
+
:type internal_ip: str (optional)
|
|
58
|
+
|
|
59
|
+
:param status: 状态
|
|
60
|
+
:type status: str (optional)
|
|
61
|
+
|
|
62
|
+
:param payment: 付费方式
|
|
63
|
+
:type payment: str (optional)
|
|
64
|
+
|
|
65
|
+
:param cpu_count: cpu数量
|
|
66
|
+
:type cpu_count: int (optional)
|
|
67
|
+
|
|
68
|
+
:param memory_capacity_in_gb: 内存大小
|
|
69
|
+
:type memory_capacity_in_gb: int (optional)
|
|
70
|
+
|
|
71
|
+
:param instance_type: 实例类型
|
|
72
|
+
:type instance_type: str (optional)
|
|
73
|
+
|
|
74
|
+
:param sys_disk_in_gb: 系统盘大小
|
|
75
|
+
:type sys_disk_in_gb: int (optional)
|
|
76
|
+
|
|
77
|
+
:param create_time: 创建时间
|
|
78
|
+
:type create_time: str (optional)
|
|
79
|
+
|
|
80
|
+
:param eip: eip attribute
|
|
81
|
+
:type eip: AsEip (optional)
|
|
82
|
+
|
|
83
|
+
:param subnet_type: 子网类型
|
|
84
|
+
:type subnet_type: str (optional)
|
|
85
|
+
|
|
86
|
+
:param is_protected: 是否受保护节点
|
|
87
|
+
:type is_protected: bool (optional)
|
|
88
|
+
|
|
89
|
+
:param node_type: 节点类型
|
|
90
|
+
:type node_type: str (optional)
|
|
91
|
+
|
|
92
|
+
:param tags: 标签列表
|
|
93
|
+
:type tags: List[TagInfo] (optional)
|
|
94
|
+
|
|
95
|
+
:param group_id: 分组ID
|
|
96
|
+
:type group_id: str (optional)
|
|
97
|
+
|
|
98
|
+
:param is_managed: 是否由系统托管
|
|
99
|
+
:type is_managed: bool (optional)
|
|
100
|
+
|
|
101
|
+
:param internal_spec: 内部规格标识
|
|
102
|
+
:type internal_spec: str (optional)
|
|
103
|
+
|
|
104
|
+
:param logical_zone: 逻辑区域标识
|
|
105
|
+
:type logical_zone: str (optional)
|
|
106
|
+
"""
|
|
107
|
+
super().__init__()
|
|
108
|
+
self.instance_id = instance_id
|
|
109
|
+
self.instance_uuid = instance_uuid
|
|
110
|
+
self.instance_name = instance_name
|
|
111
|
+
self.floating_ip = floating_ip
|
|
112
|
+
self.internal_ip = internal_ip
|
|
113
|
+
self.status = status
|
|
114
|
+
self.payment = payment
|
|
115
|
+
self.cpu_count = cpu_count
|
|
116
|
+
self.memory_capacity_in_gb = memory_capacity_in_gb
|
|
117
|
+
self.instance_type = instance_type
|
|
118
|
+
self.sys_disk_in_gb = sys_disk_in_gb
|
|
119
|
+
self.create_time = create_time
|
|
120
|
+
self.eip = eip
|
|
121
|
+
self.subnet_type = subnet_type
|
|
122
|
+
self.is_protected = is_protected
|
|
123
|
+
self.node_type = node_type
|
|
124
|
+
self.tags = tags
|
|
125
|
+
self.group_id = group_id
|
|
126
|
+
self.is_managed = is_managed
|
|
127
|
+
self.internal_spec = internal_spec
|
|
128
|
+
self.logical_zone = logical_zone
|
|
129
|
+
|
|
130
|
+
def to_dict(self):
|
|
131
|
+
"""
|
|
132
|
+
Convert the model instance to a dictionary representation.
|
|
133
|
+
|
|
134
|
+
Nested model objects are recursively converted to dictionaries.
|
|
135
|
+
|
|
136
|
+
:return: Dictionary representation of the model
|
|
137
|
+
:rtype: dict
|
|
138
|
+
"""
|
|
139
|
+
_map = super().to_dict()
|
|
140
|
+
if _map is not None:
|
|
141
|
+
return _map
|
|
142
|
+
result = dict()
|
|
143
|
+
if self.instance_id is not None:
|
|
144
|
+
result['instanceId'] = self.instance_id
|
|
145
|
+
if self.instance_uuid is not None:
|
|
146
|
+
result['instanceUuid'] = self.instance_uuid
|
|
147
|
+
if self.instance_name is not None:
|
|
148
|
+
result['instanceName'] = self.instance_name
|
|
149
|
+
if self.floating_ip is not None:
|
|
150
|
+
result['floatingIp'] = self.floating_ip
|
|
151
|
+
if self.internal_ip is not None:
|
|
152
|
+
result['internalIp'] = self.internal_ip
|
|
153
|
+
if self.status is not None:
|
|
154
|
+
result['status'] = self.status
|
|
155
|
+
if self.payment is not None:
|
|
156
|
+
result['payment'] = self.payment
|
|
157
|
+
if self.cpu_count is not None:
|
|
158
|
+
result['cpuCount'] = self.cpu_count
|
|
159
|
+
if self.memory_capacity_in_gb is not None:
|
|
160
|
+
result['memoryCapacityInGB'] = self.memory_capacity_in_gb
|
|
161
|
+
if self.instance_type is not None:
|
|
162
|
+
result['instanceType'] = self.instance_type
|
|
163
|
+
if self.sys_disk_in_gb is not None:
|
|
164
|
+
result['sysDiskInGB'] = self.sys_disk_in_gb
|
|
165
|
+
if self.create_time is not None:
|
|
166
|
+
result['createTime'] = self.create_time
|
|
167
|
+
if self.eip is not None:
|
|
168
|
+
result['eip'] = self.eip.to_dict()
|
|
169
|
+
if self.subnet_type is not None:
|
|
170
|
+
result['subnetType'] = self.subnet_type
|
|
171
|
+
if self.is_protected is not None:
|
|
172
|
+
result['isProtected'] = self.is_protected
|
|
173
|
+
if self.node_type is not None:
|
|
174
|
+
result['nodeType'] = self.node_type
|
|
175
|
+
if self.tags is not None:
|
|
176
|
+
result['tags'] = [i.to_dict() for i in self.tags]
|
|
177
|
+
if self.group_id is not None:
|
|
178
|
+
result['groupId'] = self.group_id
|
|
179
|
+
if self.is_managed is not None:
|
|
180
|
+
result['isManaged'] = self.is_managed
|
|
181
|
+
if self.internal_spec is not None:
|
|
182
|
+
result['internalSpec'] = self.internal_spec
|
|
183
|
+
if self.logical_zone is not None:
|
|
184
|
+
result['logicalZone'] = self.logical_zone
|
|
185
|
+
return result
|
|
186
|
+
|
|
187
|
+
def from_dict(self, m):
|
|
188
|
+
"""
|
|
189
|
+
Populate the model instance from a dictionary.
|
|
190
|
+
|
|
191
|
+
Nested dictionaries are recursively converted to model objects.
|
|
192
|
+
|
|
193
|
+
:param m: Dictionary containing model data
|
|
194
|
+
:type m: dict
|
|
195
|
+
|
|
196
|
+
:return: Self reference for method chaining
|
|
197
|
+
:rtype: Node
|
|
198
|
+
|
|
199
|
+
:raises TypeError: If input is not a dictionary type
|
|
200
|
+
:raises ValueError: If nested model conversion fails
|
|
201
|
+
"""
|
|
202
|
+
m = m or dict()
|
|
203
|
+
if m.get('instanceId') is not None:
|
|
204
|
+
self.instance_id = m.get('instanceId')
|
|
205
|
+
if m.get('instanceUuid') is not None:
|
|
206
|
+
self.instance_uuid = m.get('instanceUuid')
|
|
207
|
+
if m.get('instanceName') is not None:
|
|
208
|
+
self.instance_name = m.get('instanceName')
|
|
209
|
+
if m.get('floatingIp') is not None:
|
|
210
|
+
self.floating_ip = m.get('floatingIp')
|
|
211
|
+
if m.get('internalIp') is not None:
|
|
212
|
+
self.internal_ip = m.get('internalIp')
|
|
213
|
+
if m.get('status') is not None:
|
|
214
|
+
self.status = m.get('status')
|
|
215
|
+
if m.get('payment') is not None:
|
|
216
|
+
self.payment = m.get('payment')
|
|
217
|
+
if m.get('cpuCount') is not None:
|
|
218
|
+
self.cpu_count = m.get('cpuCount')
|
|
219
|
+
if m.get('memoryCapacityInGB') is not None:
|
|
220
|
+
self.memory_capacity_in_gb = m.get('memoryCapacityInGB')
|
|
221
|
+
if m.get('instanceType') is not None:
|
|
222
|
+
self.instance_type = m.get('instanceType')
|
|
223
|
+
if m.get('sysDiskInGB') is not None:
|
|
224
|
+
self.sys_disk_in_gb = m.get('sysDiskInGB')
|
|
225
|
+
if m.get('createTime') is not None:
|
|
226
|
+
self.create_time = m.get('createTime')
|
|
227
|
+
if m.get('eip') is not None:
|
|
228
|
+
self.eip = AsEip().from_dict(m.get('eip'))
|
|
229
|
+
if m.get('subnetType') is not None:
|
|
230
|
+
self.subnet_type = m.get('subnetType')
|
|
231
|
+
if m.get('isProtected') is not None:
|
|
232
|
+
self.is_protected = m.get('isProtected')
|
|
233
|
+
if m.get('nodeType') is not None:
|
|
234
|
+
self.node_type = m.get('nodeType')
|
|
235
|
+
if m.get('tags') is not None:
|
|
236
|
+
self.tags = [TagInfo().from_dict(i) for i in m.get('tags')]
|
|
237
|
+
if m.get('groupId') is not None:
|
|
238
|
+
self.group_id = m.get('groupId')
|
|
239
|
+
if m.get('isManaged') is not None:
|
|
240
|
+
self.is_managed = m.get('isManaged')
|
|
241
|
+
if m.get('internalSpec') is not None:
|
|
242
|
+
self.internal_spec = m.get('internalSpec')
|
|
243
|
+
if m.get('logicalZone') is not None:
|
|
244
|
+
self.logical_zone = m.get('logicalZone')
|
|
245
|
+
return self
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NodeInfo information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
from baiducloud_python_sdk_as.models.billing_info import BillingInfo
|
|
8
|
+
|
|
9
|
+
from baiducloud_python_sdk_as.models.ephemeral_disk import EphemeralDisk
|
|
10
|
+
|
|
11
|
+
from baiducloud_python_sdk_as.models.cds_info import CdsInfo
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class NodeInfo(AbstractModel):
|
|
15
|
+
"""
|
|
16
|
+
NodeInfo
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
spec=None,
|
|
22
|
+
cpu_count=None,
|
|
23
|
+
memory_capacity_in_gb=None,
|
|
24
|
+
sys_disk_type=None,
|
|
25
|
+
sys_disk_in_gb=None,
|
|
26
|
+
billing=None,
|
|
27
|
+
bid_model=None,
|
|
28
|
+
bid_price=None,
|
|
29
|
+
ephemeral_disks=None,
|
|
30
|
+
instance_type=None,
|
|
31
|
+
gpu_card=None,
|
|
32
|
+
gpu_count=None,
|
|
33
|
+
fpga_card=None,
|
|
34
|
+
fpga_count=None,
|
|
35
|
+
contains_fpga=None,
|
|
36
|
+
kunlun_card=None,
|
|
37
|
+
kunlun_count=None,
|
|
38
|
+
image_type=None,
|
|
39
|
+
image_id=None,
|
|
40
|
+
image_name=None,
|
|
41
|
+
os_type=None,
|
|
42
|
+
os_name=None,
|
|
43
|
+
os_version=None,
|
|
44
|
+
os_arch=None,
|
|
45
|
+
security_group_id=None,
|
|
46
|
+
admin_pass=None,
|
|
47
|
+
admin_pass_type=None,
|
|
48
|
+
security_group_name=None,
|
|
49
|
+
total_count=None,
|
|
50
|
+
asp_id=None,
|
|
51
|
+
cds=None,
|
|
52
|
+
zone_subnet=None,
|
|
53
|
+
user_data=None,
|
|
54
|
+
priorities=None,
|
|
55
|
+
template_id=None,
|
|
56
|
+
):
|
|
57
|
+
"""
|
|
58
|
+
Initialize NodeInfo instance.
|
|
59
|
+
|
|
60
|
+
:param spec: 套餐规格
|
|
61
|
+
:type spec: str (optional)
|
|
62
|
+
|
|
63
|
+
:param cpu_count: CPU数量
|
|
64
|
+
:type cpu_count: int (optional)
|
|
65
|
+
|
|
66
|
+
:param memory_capacity_in_gb: 磁盘容量
|
|
67
|
+
:type memory_capacity_in_gb: int (optional)
|
|
68
|
+
|
|
69
|
+
:param sys_disk_type: 系统盘类型
|
|
70
|
+
:type sys_disk_type: str (optional)
|
|
71
|
+
|
|
72
|
+
:param sys_disk_in_gb: 系统盘大小
|
|
73
|
+
:type sys_disk_in_gb: int (optional)
|
|
74
|
+
|
|
75
|
+
:param billing: billing attribute
|
|
76
|
+
:type billing: BillingInfo (optional)
|
|
77
|
+
|
|
78
|
+
:param bid_model: 抢占式实例释放策略:市场价释放-market,自定义释放价格-custom
|
|
79
|
+
:type bid_model: str (optional)
|
|
80
|
+
|
|
81
|
+
:param bid_price: 自定义释放时,价格值
|
|
82
|
+
:type bid_price: str (optional)
|
|
83
|
+
|
|
84
|
+
:param ephemeral_disks: 本地盘信息
|
|
85
|
+
:type ephemeral_disks: List[EphemeralDisk] (optional)
|
|
86
|
+
|
|
87
|
+
:param instance_type: 实例类型
|
|
88
|
+
:type instance_type: str (optional)
|
|
89
|
+
|
|
90
|
+
:param gpu_card: gpu卡属性
|
|
91
|
+
:type gpu_card: str (optional)
|
|
92
|
+
|
|
93
|
+
:param gpu_count: gpu数量
|
|
94
|
+
:type gpu_count: int (optional)
|
|
95
|
+
|
|
96
|
+
:param fpga_card: fpga卡属性
|
|
97
|
+
:type fpga_card: str (optional)
|
|
98
|
+
|
|
99
|
+
:param fpga_count: fpga卡数量
|
|
100
|
+
:type fpga_count: int (optional)
|
|
101
|
+
|
|
102
|
+
:param contains_fpga: 是否包含fpga卡
|
|
103
|
+
:type contains_fpga: bool (optional)
|
|
104
|
+
|
|
105
|
+
:param kunlun_card: 昆仑卡属性
|
|
106
|
+
:type kunlun_card: str (optional)
|
|
107
|
+
|
|
108
|
+
:param kunlun_count: 昆仑卡数量
|
|
109
|
+
:type kunlun_count: int (optional)
|
|
110
|
+
|
|
111
|
+
:param image_type: 实例镜像类型
|
|
112
|
+
:type image_type: str (optional)
|
|
113
|
+
|
|
114
|
+
:param image_id: 实例镜像ID
|
|
115
|
+
:type image_id: str (optional)
|
|
116
|
+
|
|
117
|
+
:param image_name: 实例镜像名称
|
|
118
|
+
:type image_name: str (optional)
|
|
119
|
+
|
|
120
|
+
:param os_type: 操作系统类型
|
|
121
|
+
:type os_type: str (optional)
|
|
122
|
+
|
|
123
|
+
:param os_name: 操作系统名称
|
|
124
|
+
:type os_name: str (optional)
|
|
125
|
+
|
|
126
|
+
:param os_version: 操作系统版本
|
|
127
|
+
:type os_version: str (optional)
|
|
128
|
+
|
|
129
|
+
:param os_arch: 操作系统架构
|
|
130
|
+
:type os_arch: str (optional)
|
|
131
|
+
|
|
132
|
+
:param security_group_id: 安全组ID
|
|
133
|
+
:type security_group_id: str (optional)
|
|
134
|
+
|
|
135
|
+
:param admin_pass: 密码
|
|
136
|
+
:type admin_pass: str (optional)
|
|
137
|
+
|
|
138
|
+
:param admin_pass_type: 密码类型: \"0\"(随机); \"1\"(用户自定义)
|
|
139
|
+
:type admin_pass_type: str (optional)
|
|
140
|
+
|
|
141
|
+
:param security_group_name: 安全组名称
|
|
142
|
+
:type security_group_name: str (optional)
|
|
143
|
+
|
|
144
|
+
:param total_count: 总数量
|
|
145
|
+
:type total_count: int (optional)
|
|
146
|
+
|
|
147
|
+
:param asp_id: 子网类型
|
|
148
|
+
:type asp_id: str (optional)
|
|
149
|
+
|
|
150
|
+
:param cds: 本地存储信息
|
|
151
|
+
:type cds: List[CdsInfo] (optional)
|
|
152
|
+
|
|
153
|
+
:param zone_subnet: zone_subnet attribute
|
|
154
|
+
:type zone_subnet: str (optional)
|
|
155
|
+
|
|
156
|
+
:param user_data: 用户高级配置能力
|
|
157
|
+
:type user_data: str (optional)
|
|
158
|
+
|
|
159
|
+
:param priorities: 模板顺序
|
|
160
|
+
:type priorities: int (optional)
|
|
161
|
+
|
|
162
|
+
:param template_id: 所属模板的ID
|
|
163
|
+
:type template_id: str (optional)
|
|
164
|
+
"""
|
|
165
|
+
super().__init__()
|
|
166
|
+
self.spec = spec
|
|
167
|
+
self.cpu_count = cpu_count
|
|
168
|
+
self.memory_capacity_in_gb = memory_capacity_in_gb
|
|
169
|
+
self.sys_disk_type = sys_disk_type
|
|
170
|
+
self.sys_disk_in_gb = sys_disk_in_gb
|
|
171
|
+
self.billing = billing
|
|
172
|
+
self.bid_model = bid_model
|
|
173
|
+
self.bid_price = bid_price
|
|
174
|
+
self.ephemeral_disks = ephemeral_disks
|
|
175
|
+
self.instance_type = instance_type
|
|
176
|
+
self.gpu_card = gpu_card
|
|
177
|
+
self.gpu_count = gpu_count
|
|
178
|
+
self.fpga_card = fpga_card
|
|
179
|
+
self.fpga_count = fpga_count
|
|
180
|
+
self.contains_fpga = contains_fpga
|
|
181
|
+
self.kunlun_card = kunlun_card
|
|
182
|
+
self.kunlun_count = kunlun_count
|
|
183
|
+
self.image_type = image_type
|
|
184
|
+
self.image_id = image_id
|
|
185
|
+
self.image_name = image_name
|
|
186
|
+
self.os_type = os_type
|
|
187
|
+
self.os_name = os_name
|
|
188
|
+
self.os_version = os_version
|
|
189
|
+
self.os_arch = os_arch
|
|
190
|
+
self.security_group_id = security_group_id
|
|
191
|
+
self.admin_pass = admin_pass
|
|
192
|
+
self.admin_pass_type = admin_pass_type
|
|
193
|
+
self.security_group_name = security_group_name
|
|
194
|
+
self.total_count = total_count
|
|
195
|
+
self.asp_id = asp_id
|
|
196
|
+
self.cds = cds
|
|
197
|
+
self.zone_subnet = zone_subnet
|
|
198
|
+
self.user_data = user_data
|
|
199
|
+
self.priorities = priorities
|
|
200
|
+
self.template_id = template_id
|
|
201
|
+
|
|
202
|
+
def to_dict(self):
|
|
203
|
+
"""
|
|
204
|
+
Convert the model instance to a dictionary representation.
|
|
205
|
+
|
|
206
|
+
Nested model objects are recursively converted to dictionaries.
|
|
207
|
+
|
|
208
|
+
:return: Dictionary representation of the model
|
|
209
|
+
:rtype: dict
|
|
210
|
+
"""
|
|
211
|
+
_map = super().to_dict()
|
|
212
|
+
if _map is not None:
|
|
213
|
+
return _map
|
|
214
|
+
result = dict()
|
|
215
|
+
if self.spec is not None:
|
|
216
|
+
result['spec'] = self.spec
|
|
217
|
+
if self.cpu_count is not None:
|
|
218
|
+
result['cpuCount'] = self.cpu_count
|
|
219
|
+
if self.memory_capacity_in_gb is not None:
|
|
220
|
+
result['memoryCapacityInGB'] = self.memory_capacity_in_gb
|
|
221
|
+
if self.sys_disk_type is not None:
|
|
222
|
+
result['sysDiskType'] = self.sys_disk_type
|
|
223
|
+
if self.sys_disk_in_gb is not None:
|
|
224
|
+
result['sysDiskInGB'] = self.sys_disk_in_gb
|
|
225
|
+
if self.billing is not None:
|
|
226
|
+
result['billing'] = self.billing.to_dict()
|
|
227
|
+
if self.bid_model is not None:
|
|
228
|
+
result['bidModel'] = self.bid_model
|
|
229
|
+
if self.bid_price is not None:
|
|
230
|
+
result['bidPrice'] = self.bid_price
|
|
231
|
+
if self.ephemeral_disks is not None:
|
|
232
|
+
result['ephemeralDisks'] = [i.to_dict() for i in self.ephemeral_disks]
|
|
233
|
+
if self.instance_type is not None:
|
|
234
|
+
result['instanceType'] = self.instance_type
|
|
235
|
+
if self.gpu_card is not None:
|
|
236
|
+
result['gpuCard'] = self.gpu_card
|
|
237
|
+
if self.gpu_count is not None:
|
|
238
|
+
result['gpuCount'] = self.gpu_count
|
|
239
|
+
if self.fpga_card is not None:
|
|
240
|
+
result['fpgaCard'] = self.fpga_card
|
|
241
|
+
if self.fpga_count is not None:
|
|
242
|
+
result['fpgaCount'] = self.fpga_count
|
|
243
|
+
if self.contains_fpga is not None:
|
|
244
|
+
result['containsFpga'] = self.contains_fpga
|
|
245
|
+
if self.kunlun_card is not None:
|
|
246
|
+
result['kunlunCard'] = self.kunlun_card
|
|
247
|
+
if self.kunlun_count is not None:
|
|
248
|
+
result['kunlunCount'] = self.kunlun_count
|
|
249
|
+
if self.image_type is not None:
|
|
250
|
+
result['imageType'] = self.image_type
|
|
251
|
+
if self.image_id is not None:
|
|
252
|
+
result['imageId'] = self.image_id
|
|
253
|
+
if self.image_name is not None:
|
|
254
|
+
result['imageName'] = self.image_name
|
|
255
|
+
if self.os_type is not None:
|
|
256
|
+
result['osType'] = self.os_type
|
|
257
|
+
if self.os_name is not None:
|
|
258
|
+
result['osName'] = self.os_name
|
|
259
|
+
if self.os_version is not None:
|
|
260
|
+
result['osVersion'] = self.os_version
|
|
261
|
+
if self.os_arch is not None:
|
|
262
|
+
result['osArch'] = self.os_arch
|
|
263
|
+
if self.security_group_id is not None:
|
|
264
|
+
result['securityGroupId'] = self.security_group_id
|
|
265
|
+
if self.admin_pass is not None:
|
|
266
|
+
result['adminPass'] = self.admin_pass
|
|
267
|
+
if self.admin_pass_type is not None:
|
|
268
|
+
result['adminPassType'] = self.admin_pass_type
|
|
269
|
+
if self.security_group_name is not None:
|
|
270
|
+
result['securityGroupName'] = self.security_group_name
|
|
271
|
+
if self.total_count is not None:
|
|
272
|
+
result['totalCount'] = self.total_count
|
|
273
|
+
if self.asp_id is not None:
|
|
274
|
+
result['aspId'] = self.asp_id
|
|
275
|
+
if self.cds is not None:
|
|
276
|
+
result['cds'] = [i.to_dict() for i in self.cds]
|
|
277
|
+
if self.zone_subnet is not None:
|
|
278
|
+
result['zoneSubnet'] = self.zone_subnet
|
|
279
|
+
if self.user_data is not None:
|
|
280
|
+
result['userData'] = self.user_data
|
|
281
|
+
if self.priorities is not None:
|
|
282
|
+
result['priorities'] = self.priorities
|
|
283
|
+
if self.template_id is not None:
|
|
284
|
+
result['templateId'] = self.template_id
|
|
285
|
+
return result
|
|
286
|
+
|
|
287
|
+
def from_dict(self, m):
|
|
288
|
+
"""
|
|
289
|
+
Populate the model instance from a dictionary.
|
|
290
|
+
|
|
291
|
+
Nested dictionaries are recursively converted to model objects.
|
|
292
|
+
|
|
293
|
+
:param m: Dictionary containing model data
|
|
294
|
+
:type m: dict
|
|
295
|
+
|
|
296
|
+
:return: Self reference for method chaining
|
|
297
|
+
:rtype: NodeInfo
|
|
298
|
+
|
|
299
|
+
:raises TypeError: If input is not a dictionary type
|
|
300
|
+
:raises ValueError: If nested model conversion fails
|
|
301
|
+
"""
|
|
302
|
+
m = m or dict()
|
|
303
|
+
if m.get('spec') is not None:
|
|
304
|
+
self.spec = m.get('spec')
|
|
305
|
+
if m.get('cpuCount') is not None:
|
|
306
|
+
self.cpu_count = m.get('cpuCount')
|
|
307
|
+
if m.get('memoryCapacityInGB') is not None:
|
|
308
|
+
self.memory_capacity_in_gb = m.get('memoryCapacityInGB')
|
|
309
|
+
if m.get('sysDiskType') is not None:
|
|
310
|
+
self.sys_disk_type = m.get('sysDiskType')
|
|
311
|
+
if m.get('sysDiskInGB') is not None:
|
|
312
|
+
self.sys_disk_in_gb = m.get('sysDiskInGB')
|
|
313
|
+
if m.get('billing') is not None:
|
|
314
|
+
self.billing = BillingInfo().from_dict(m.get('billing'))
|
|
315
|
+
if m.get('bidModel') is not None:
|
|
316
|
+
self.bid_model = m.get('bidModel')
|
|
317
|
+
if m.get('bidPrice') is not None:
|
|
318
|
+
self.bid_price = m.get('bidPrice')
|
|
319
|
+
if m.get('ephemeralDisks') is not None:
|
|
320
|
+
self.ephemeral_disks = [EphemeralDisk().from_dict(i) for i in m.get('ephemeralDisks')]
|
|
321
|
+
if m.get('instanceType') is not None:
|
|
322
|
+
self.instance_type = m.get('instanceType')
|
|
323
|
+
if m.get('gpuCard') is not None:
|
|
324
|
+
self.gpu_card = m.get('gpuCard')
|
|
325
|
+
if m.get('gpuCount') is not None:
|
|
326
|
+
self.gpu_count = m.get('gpuCount')
|
|
327
|
+
if m.get('fpgaCard') is not None:
|
|
328
|
+
self.fpga_card = m.get('fpgaCard')
|
|
329
|
+
if m.get('fpgaCount') is not None:
|
|
330
|
+
self.fpga_count = m.get('fpgaCount')
|
|
331
|
+
if m.get('containsFpga') is not None:
|
|
332
|
+
self.contains_fpga = m.get('containsFpga')
|
|
333
|
+
if m.get('kunlunCard') is not None:
|
|
334
|
+
self.kunlun_card = m.get('kunlunCard')
|
|
335
|
+
if m.get('kunlunCount') is not None:
|
|
336
|
+
self.kunlun_count = m.get('kunlunCount')
|
|
337
|
+
if m.get('imageType') is not None:
|
|
338
|
+
self.image_type = m.get('imageType')
|
|
339
|
+
if m.get('imageId') is not None:
|
|
340
|
+
self.image_id = m.get('imageId')
|
|
341
|
+
if m.get('imageName') is not None:
|
|
342
|
+
self.image_name = m.get('imageName')
|
|
343
|
+
if m.get('osType') is not None:
|
|
344
|
+
self.os_type = m.get('osType')
|
|
345
|
+
if m.get('osName') is not None:
|
|
346
|
+
self.os_name = m.get('osName')
|
|
347
|
+
if m.get('osVersion') is not None:
|
|
348
|
+
self.os_version = m.get('osVersion')
|
|
349
|
+
if m.get('osArch') is not None:
|
|
350
|
+
self.os_arch = m.get('osArch')
|
|
351
|
+
if m.get('securityGroupId') is not None:
|
|
352
|
+
self.security_group_id = m.get('securityGroupId')
|
|
353
|
+
if m.get('adminPass') is not None:
|
|
354
|
+
self.admin_pass = m.get('adminPass')
|
|
355
|
+
if m.get('adminPassType') is not None:
|
|
356
|
+
self.admin_pass_type = m.get('adminPassType')
|
|
357
|
+
if m.get('securityGroupName') is not None:
|
|
358
|
+
self.security_group_name = m.get('securityGroupName')
|
|
359
|
+
if m.get('totalCount') is not None:
|
|
360
|
+
self.total_count = m.get('totalCount')
|
|
361
|
+
if m.get('aspId') is not None:
|
|
362
|
+
self.asp_id = m.get('aspId')
|
|
363
|
+
if m.get('cds') is not None:
|
|
364
|
+
self.cds = [CdsInfo().from_dict(i) for i in m.get('cds')]
|
|
365
|
+
if m.get('zoneSubnet') is not None:
|
|
366
|
+
self.zone_subnet = m.get('zoneSubnet')
|
|
367
|
+
if m.get('userData') is not None:
|
|
368
|
+
self.user_data = m.get('userData')
|
|
369
|
+
if m.get('priorities') is not None:
|
|
370
|
+
self.priorities = m.get('priorities')
|
|
371
|
+
if m.get('templateId') is not None:
|
|
372
|
+
self.template_id = m.get('templateId')
|
|
373
|
+
return self
|