baiducloud-python-sdk-bcc 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_bcc/__init__.py +5 -0
- baiducloud_python_sdk_bcc/api/__init__.py +0 -0
- baiducloud_python_sdk_bcc/api/bcc_client.py +554 -0
- baiducloud_python_sdk_bcc/models/__init__.py +44 -0
- baiducloud_python_sdk_bcc/models/attach_volume_request.py +82 -0
- baiducloud_python_sdk_bcc/models/attach_volume_response.py +70 -0
- baiducloud_python_sdk_bcc/models/auto_snapshot_policy_info.py +98 -0
- baiducloud_python_sdk_bcc/models/auto_snapshot_policy_model.py +151 -0
- baiducloud_python_sdk_bcc/models/billing.py +68 -0
- baiducloud_python_sdk_bcc/models/bind_tag_volume_request.py +67 -0
- baiducloud_python_sdk_bcc/models/cds_prices.py +90 -0
- baiducloud_python_sdk_bcc/models/create_volume_request.py +264 -0
- baiducloud_python_sdk_bcc/models/create_volume_response.py +77 -0
- baiducloud_python_sdk_bcc/models/detach_volume_request.py +66 -0
- baiducloud_python_sdk_bcc/models/disk_info.py +74 -0
- baiducloud_python_sdk_bcc/models/get_cds_price_request.py +117 -0
- baiducloud_python_sdk_bcc/models/get_cds_price_response.py +62 -0
- baiducloud_python_sdk_bcc/models/get_disk_quota_request.py +58 -0
- baiducloud_python_sdk_bcc/models/get_disk_quota_response.py +78 -0
- baiducloud_python_sdk_bcc/models/get_volume_request.py +58 -0
- baiducloud_python_sdk_bcc/models/get_volume_resize_progress_request.py +58 -0
- baiducloud_python_sdk_bcc/models/get_volume_resize_progress_response.py +61 -0
- baiducloud_python_sdk_bcc/models/get_volume_response.py +62 -0
- baiducloud_python_sdk_bcc/models/group_info.py +66 -0
- baiducloud_python_sdk_bcc/models/list_volumes_request.py +117 -0
- baiducloud_python_sdk_bcc/models/list_volumes_response.py +94 -0
- baiducloud_python_sdk_bcc/models/modify_cds_attribute_request.py +90 -0
- baiducloud_python_sdk_bcc/models/modify_volume_charge_type_request.py +75 -0
- baiducloud_python_sdk_bcc/models/purchase_reserved_volume_request.py +75 -0
- baiducloud_python_sdk_bcc/models/purchase_reserved_volume_response.py +61 -0
- baiducloud_python_sdk_bcc/models/release_volume_request.py +90 -0
- baiducloud_python_sdk_bcc/models/rename_volume_request.py +66 -0
- baiducloud_python_sdk_bcc/models/reservation.py +66 -0
- baiducloud_python_sdk_bcc/models/resize_volume_request.py +82 -0
- baiducloud_python_sdk_bcc/models/resize_volume_response.py +61 -0
- baiducloud_python_sdk_bcc/models/rollback_volume_request.py +66 -0
- baiducloud_python_sdk_bcc/models/storage_type.py +53 -0
- baiducloud_python_sdk_bcc/models/tag_model.py +66 -0
- baiducloud_python_sdk_bcc/models/unbind_tag_volume_request.py +67 -0
- baiducloud_python_sdk_bcc/models/volume_attachment_model.py +82 -0
- baiducloud_python_sdk_bcc/models/volume_model.py +417 -0
- baiducloud_python_sdk_bcc/models/volume_multi_attach_info.py +82 -0
- baiducloud_python_sdk_bcc/models/volume_status.py +45 -0
- baiducloud_python_sdk_bcc/models/volume_type.py +20 -0
- baiducloud_python_sdk_bcc-0.0.1.dist-info/LICENSE +177 -0
- baiducloud_python_sdk_bcc-0.0.1.dist-info/METADATA +76 -0
- baiducloud_python_sdk_bcc-0.0.1.dist-info/RECORD +49 -0
- baiducloud_python_sdk_bcc-0.0.1.dist-info/WHEEL +5 -0
- baiducloud_python_sdk_bcc-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for CreateVolumeRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
from baiducloud_python_sdk_bcc.models.tag_model import TagModel
|
|
7
|
+
from baiducloud_python_sdk_bcc.models.billing import Billing
|
|
8
|
+
from baiducloud_python_sdk_bcc.models.auto_snapshot_policy_model import AutoSnapshotPolicyModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CreateVolumeRequest(AbstractModel):
|
|
12
|
+
"""
|
|
13
|
+
Request entity for CreateVolumeRequest operation.
|
|
14
|
+
|
|
15
|
+
This class encapsulates all parameters for the API request.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
def __init__(
|
|
19
|
+
self,
|
|
20
|
+
billing,
|
|
21
|
+
zone_name=None,
|
|
22
|
+
storage_type=None,
|
|
23
|
+
cds_size_in_gb=None,
|
|
24
|
+
cds_extra_io=None,
|
|
25
|
+
snapshot_id=None,
|
|
26
|
+
share_snapshot_id=None,
|
|
27
|
+
enable_delete_protection=None,
|
|
28
|
+
instance_id=None,
|
|
29
|
+
encrypt_key=None,
|
|
30
|
+
name=None,
|
|
31
|
+
description=None,
|
|
32
|
+
renew_time_unit=None,
|
|
33
|
+
renew_time=None,
|
|
34
|
+
relation_tag=None,
|
|
35
|
+
tags=None,
|
|
36
|
+
res_group_id=None,
|
|
37
|
+
cluster_id=None,
|
|
38
|
+
charge_type=None,
|
|
39
|
+
auto_snapshot_policy=None,
|
|
40
|
+
delete_with_instance=None,
|
|
41
|
+
delete_auto_snapshot=None,
|
|
42
|
+
purchase_count=None,
|
|
43
|
+
):
|
|
44
|
+
"""
|
|
45
|
+
Initialize CreateVolumeRequest request entity.
|
|
46
|
+
|
|
47
|
+
:param zone_name: 指定可用区信息,默认为空,由系统自动选择。
|
|
48
|
+
:type zone_name: str (optional)
|
|
49
|
+
|
|
50
|
+
:param storage_type: storage_type parameter
|
|
51
|
+
:type storage_type: str (optional)
|
|
52
|
+
|
|
53
|
+
:param cds_size_in_gb: 增强型SSD_PL1、增强型SSD_PL2、增强型SSD_PL3,支持购买额外IO性能
|
|
54
|
+
:type cds_size_in_gb: int (optional)
|
|
55
|
+
|
|
56
|
+
:param cds_extra_io: 磁盘的额外IO性能配置
|
|
57
|
+
:type cds_extra_io: int (optional)
|
|
58
|
+
|
|
59
|
+
:param snapshot_id: 快照ID,支持从快照创建磁盘。当此参数存在时且不为空时,cdsSizeInGB参数将被忽略,此时非必需。
|
|
60
|
+
:type snapshot_id: str (optional)
|
|
61
|
+
|
|
62
|
+
:param share_snapshot_id: 共享快照ID,支持从共享快照创建磁盘。当此参数存在时且不为空时,cdsSizeInGB参数将被忽略,此时非必需。
|
|
63
|
+
:type share_snapshot_id: str (optional)
|
|
64
|
+
|
|
65
|
+
:param enable_delete_protection: 是否开启磁盘释放保护
|
|
66
|
+
:type enable_delete_protection: str (optional)
|
|
67
|
+
|
|
68
|
+
:param instance_id: instance_id parameter
|
|
69
|
+
:type instance_id: str (optional)
|
|
70
|
+
|
|
71
|
+
:param encrypt_key: KMS密钥ID。
|
|
72
|
+
:type encrypt_key: str (optional)
|
|
73
|
+
|
|
74
|
+
:param name: 磁盘新的名称,自定义镜像名称,支持大小写字母、数字、中文以及-_ /.特殊字符,必须以字母开头,长度1-65。
|
|
75
|
+
:type name: str (optional)
|
|
76
|
+
|
|
77
|
+
:param description: description parameter
|
|
78
|
+
:type description: str (optional)
|
|
79
|
+
|
|
80
|
+
:param renew_time_unit: renew_time_unit parameter
|
|
81
|
+
:type renew_time_unit: str (optional)
|
|
82
|
+
|
|
83
|
+
:param renew_time: renew_time parameter
|
|
84
|
+
:type renew_time: int (optional)
|
|
85
|
+
|
|
86
|
+
:param relation_tag: 待创建CDS指定的标签是否需要和已有标签键进行关联,默认为false。注意值为true时要保证该标签键已存在
|
|
87
|
+
:type relation_tag: bool (optional)
|
|
88
|
+
|
|
89
|
+
:param tags: 待绑定的标签列表
|
|
90
|
+
:type tags: List[TagModel] (optional)
|
|
91
|
+
|
|
92
|
+
:param res_group_id: 资源组ID
|
|
93
|
+
:type res_group_id: str (optional)
|
|
94
|
+
|
|
95
|
+
:param billing: billing parameter
|
|
96
|
+
:type billing: Billing (required)
|
|
97
|
+
|
|
98
|
+
:param cluster_id: CDS专属集群ID
|
|
99
|
+
:type cluster_id: str (optional)
|
|
100
|
+
|
|
101
|
+
:param charge_type: charge_type parameter
|
|
102
|
+
:type charge_type: str (optional)
|
|
103
|
+
|
|
104
|
+
:param auto_snapshot_policy: auto_snapshot_policy parameter
|
|
105
|
+
:type auto_snapshot_policy: AutoSnapshotPolicyModel (optional)
|
|
106
|
+
|
|
107
|
+
:param delete_with_instance: delete_with_instance parameter
|
|
108
|
+
:type delete_with_instance: bool (optional)
|
|
109
|
+
|
|
110
|
+
:param delete_auto_snapshot: 是否删除已有的自动快照
|
|
111
|
+
:type delete_auto_snapshot: bool (optional)
|
|
112
|
+
|
|
113
|
+
:param purchase_count: 批量创建的CDS磁盘的个数,必须为大于0的整数,单次创建不能超过5个。可选参数,缺省为1
|
|
114
|
+
:type purchase_count: int (optional)
|
|
115
|
+
"""
|
|
116
|
+
super().__init__()
|
|
117
|
+
self.zone_name = zone_name
|
|
118
|
+
self.storage_type = storage_type
|
|
119
|
+
self.cds_size_in_gb = cds_size_in_gb
|
|
120
|
+
self.cds_extra_io = cds_extra_io
|
|
121
|
+
self.snapshot_id = snapshot_id
|
|
122
|
+
self.share_snapshot_id = share_snapshot_id
|
|
123
|
+
self.enable_delete_protection = enable_delete_protection
|
|
124
|
+
self.instance_id = instance_id
|
|
125
|
+
self.encrypt_key = encrypt_key
|
|
126
|
+
self.name = name
|
|
127
|
+
self.description = description
|
|
128
|
+
self.renew_time_unit = renew_time_unit
|
|
129
|
+
self.renew_time = renew_time
|
|
130
|
+
self.relation_tag = relation_tag
|
|
131
|
+
self.tags = tags
|
|
132
|
+
self.res_group_id = res_group_id
|
|
133
|
+
self.billing = billing
|
|
134
|
+
self.cluster_id = cluster_id
|
|
135
|
+
self.charge_type = charge_type
|
|
136
|
+
self.auto_snapshot_policy = auto_snapshot_policy
|
|
137
|
+
self.delete_with_instance = delete_with_instance
|
|
138
|
+
self.delete_auto_snapshot = delete_auto_snapshot
|
|
139
|
+
self.purchase_count = purchase_count
|
|
140
|
+
|
|
141
|
+
def to_dict(self):
|
|
142
|
+
"""
|
|
143
|
+
Convert the request entity to a dictionary representation.
|
|
144
|
+
|
|
145
|
+
Nested model objects are recursively converted to dictionaries.
|
|
146
|
+
|
|
147
|
+
:return: Dictionary representation of the request
|
|
148
|
+
:rtype: dict
|
|
149
|
+
"""
|
|
150
|
+
_map = super().to_dict()
|
|
151
|
+
if _map is not None:
|
|
152
|
+
return _map
|
|
153
|
+
result = dict()
|
|
154
|
+
if self.zone_name is not None:
|
|
155
|
+
result['zoneName'] = self.zone_name
|
|
156
|
+
if self.storage_type is not None:
|
|
157
|
+
result['storageType'] = self.storage_type
|
|
158
|
+
if self.cds_size_in_gb is not None:
|
|
159
|
+
result['cdsSizeInGB'] = self.cds_size_in_gb
|
|
160
|
+
if self.cds_extra_io is not None:
|
|
161
|
+
result['cdsExtraIo'] = self.cds_extra_io
|
|
162
|
+
if self.snapshot_id is not None:
|
|
163
|
+
result['snapshotId'] = self.snapshot_id
|
|
164
|
+
if self.share_snapshot_id is not None:
|
|
165
|
+
result['shareSnapshotId'] = self.share_snapshot_id
|
|
166
|
+
if self.enable_delete_protection is not None:
|
|
167
|
+
result['enableDeleteProtection'] = self.enable_delete_protection
|
|
168
|
+
if self.instance_id is not None:
|
|
169
|
+
result['instanceId'] = self.instance_id
|
|
170
|
+
if self.encrypt_key is not None:
|
|
171
|
+
result['encryptKey'] = self.encrypt_key
|
|
172
|
+
if self.name is not None:
|
|
173
|
+
result['name'] = self.name
|
|
174
|
+
if self.description is not None:
|
|
175
|
+
result['description'] = self.description
|
|
176
|
+
if self.renew_time_unit is not None:
|
|
177
|
+
result['renewTimeUnit'] = self.renew_time_unit
|
|
178
|
+
if self.renew_time is not None:
|
|
179
|
+
result['renewTime'] = self.renew_time
|
|
180
|
+
if self.relation_tag is not None:
|
|
181
|
+
result['relationTag'] = self.relation_tag
|
|
182
|
+
if self.tags is not None:
|
|
183
|
+
result['tags'] = [i.to_dict() for i in self.tags]
|
|
184
|
+
if self.res_group_id is not None:
|
|
185
|
+
result['resGroupId'] = self.res_group_id
|
|
186
|
+
if self.billing is not None:
|
|
187
|
+
result['billing'] = self.billing.to_dict()
|
|
188
|
+
if self.cluster_id is not None:
|
|
189
|
+
result['clusterId'] = self.cluster_id
|
|
190
|
+
if self.charge_type is not None:
|
|
191
|
+
result['chargeType'] = self.charge_type
|
|
192
|
+
if self.auto_snapshot_policy is not None:
|
|
193
|
+
result['autoSnapshotPolicy'] = self.auto_snapshot_policy.to_dict()
|
|
194
|
+
if self.delete_with_instance is not None:
|
|
195
|
+
result['deleteWithInstance'] = self.delete_with_instance
|
|
196
|
+
if self.delete_auto_snapshot is not None:
|
|
197
|
+
result['deleteAutoSnapshot'] = self.delete_auto_snapshot
|
|
198
|
+
if self.purchase_count is not None:
|
|
199
|
+
result['purchaseCount'] = self.purchase_count
|
|
200
|
+
return result
|
|
201
|
+
|
|
202
|
+
def from_dict(self, m):
|
|
203
|
+
"""
|
|
204
|
+
Populate the request entity from a dictionary.
|
|
205
|
+
|
|
206
|
+
Nested dictionaries are recursively converted to model objects.
|
|
207
|
+
|
|
208
|
+
:param m: Dictionary containing request data
|
|
209
|
+
:type m: dict
|
|
210
|
+
|
|
211
|
+
:return: Self reference for method chaining
|
|
212
|
+
:rtype: CreateVolumeRequest
|
|
213
|
+
|
|
214
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
215
|
+
:raises ValueError: If nested model conversion fails
|
|
216
|
+
"""
|
|
217
|
+
m = m or dict()
|
|
218
|
+
if m.get('zoneName') is not None:
|
|
219
|
+
self.zone_name = m.get('zoneName')
|
|
220
|
+
if m.get('storageType') is not None:
|
|
221
|
+
self.storage_type = m.get('storageType')
|
|
222
|
+
if m.get('cdsSizeInGB') is not None:
|
|
223
|
+
self.cds_size_in_gb = m.get('cdsSizeInGB')
|
|
224
|
+
if m.get('cdsExtraIo') is not None:
|
|
225
|
+
self.cds_extra_io = m.get('cdsExtraIo')
|
|
226
|
+
if m.get('snapshotId') is not None:
|
|
227
|
+
self.snapshot_id = m.get('snapshotId')
|
|
228
|
+
if m.get('shareSnapshotId') is not None:
|
|
229
|
+
self.share_snapshot_id = m.get('shareSnapshotId')
|
|
230
|
+
if m.get('enableDeleteProtection') is not None:
|
|
231
|
+
self.enable_delete_protection = m.get('enableDeleteProtection')
|
|
232
|
+
if m.get('instanceId') is not None:
|
|
233
|
+
self.instance_id = m.get('instanceId')
|
|
234
|
+
if m.get('encryptKey') is not None:
|
|
235
|
+
self.encrypt_key = m.get('encryptKey')
|
|
236
|
+
if m.get('name') is not None:
|
|
237
|
+
self.name = m.get('name')
|
|
238
|
+
if m.get('description') is not None:
|
|
239
|
+
self.description = m.get('description')
|
|
240
|
+
if m.get('renewTimeUnit') is not None:
|
|
241
|
+
self.renew_time_unit = m.get('renewTimeUnit')
|
|
242
|
+
if m.get('renewTime') is not None:
|
|
243
|
+
self.renew_time = m.get('renewTime')
|
|
244
|
+
if m.get('relationTag') is not None:
|
|
245
|
+
self.relation_tag = m.get('relationTag')
|
|
246
|
+
if m.get('tags') is not None:
|
|
247
|
+
self.tags = [TagModel().from_dict(i) for i in m.get('tags')]
|
|
248
|
+
if m.get('resGroupId') is not None:
|
|
249
|
+
self.res_group_id = m.get('resGroupId')
|
|
250
|
+
if m.get('billing') is not None:
|
|
251
|
+
self.billing = Billing().from_dict(m.get('billing'))
|
|
252
|
+
if m.get('clusterId') is not None:
|
|
253
|
+
self.cluster_id = m.get('clusterId')
|
|
254
|
+
if m.get('chargeType') is not None:
|
|
255
|
+
self.charge_type = m.get('chargeType')
|
|
256
|
+
if m.get('autoSnapshotPolicy') is not None:
|
|
257
|
+
self.auto_snapshot_policy = AutoSnapshotPolicyModel().from_dict(m.get('autoSnapshotPolicy'))
|
|
258
|
+
if m.get('deleteWithInstance') is not None:
|
|
259
|
+
self.delete_with_instance = m.get('deleteWithInstance')
|
|
260
|
+
if m.get('deleteAutoSnapshot') is not None:
|
|
261
|
+
self.delete_auto_snapshot = m.get('deleteAutoSnapshot')
|
|
262
|
+
if m.get('purchaseCount') is not None:
|
|
263
|
+
self.purchase_count = m.get('purchaseCount')
|
|
264
|
+
return self
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for CreateVolumeResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CreateVolumeResponse(BceResponse):
|
|
9
|
+
"""
|
|
10
|
+
CreateVolumeResponse
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, order_id=None, volume_ids=None, warning_list=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize CreateVolumeResponse response.
|
|
16
|
+
|
|
17
|
+
:param order_id: 订单id
|
|
18
|
+
:type order_id: str (optional)
|
|
19
|
+
|
|
20
|
+
:param volume_ids: 磁盘ID,符合BCE规范,必须是一个定长字符串,且只允许包含大小写字母、数字、连字号(-)和下划线(_)。
|
|
21
|
+
:type volume_ids: List[str] (optional)
|
|
22
|
+
|
|
23
|
+
:param warning_list: 挂载磁盘产生的warning信息
|
|
24
|
+
:type warning_list: List[str] (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.order_id = order_id
|
|
28
|
+
self.volume_ids = volume_ids
|
|
29
|
+
self.warning_list = warning_list
|
|
30
|
+
|
|
31
|
+
def to_dict(self):
|
|
32
|
+
"""
|
|
33
|
+
Convert the response instance to a dictionary representation.
|
|
34
|
+
|
|
35
|
+
Includes metadata from the parent BceResponse class.
|
|
36
|
+
Nested model objects are recursively converted to dictionaries.
|
|
37
|
+
|
|
38
|
+
:return: Dictionary representation of the response
|
|
39
|
+
:rtype: dict
|
|
40
|
+
"""
|
|
41
|
+
_map = super().to_dict()
|
|
42
|
+
if _map is not None:
|
|
43
|
+
return _map
|
|
44
|
+
result = dict()
|
|
45
|
+
if self.metadata is not None:
|
|
46
|
+
result['metadata'] = dict(self.metadata)
|
|
47
|
+
if self.order_id is not None:
|
|
48
|
+
result['orderId'] = self.order_id
|
|
49
|
+
if self.volume_ids is not None:
|
|
50
|
+
result['volumeIds'] = self.volume_ids
|
|
51
|
+
if self.warning_list is not None:
|
|
52
|
+
result['warningList'] = self.warning_list
|
|
53
|
+
return result
|
|
54
|
+
|
|
55
|
+
def from_dict(self, m):
|
|
56
|
+
"""
|
|
57
|
+
Populate the response instance from a dictionary.
|
|
58
|
+
|
|
59
|
+
Nested dictionaries are recursively converted to model objects.
|
|
60
|
+
|
|
61
|
+
:param m: Dictionary containing response data
|
|
62
|
+
:type m: dict
|
|
63
|
+
|
|
64
|
+
:return: Self reference for method chaining
|
|
65
|
+
:rtype: CreateVolumeResponse
|
|
66
|
+
|
|
67
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
68
|
+
:raises ValueError: If nested model conversion fails
|
|
69
|
+
"""
|
|
70
|
+
m = m or dict()
|
|
71
|
+
if m.get('orderId') is not None:
|
|
72
|
+
self.order_id = m.get('orderId')
|
|
73
|
+
if m.get('volumeIds') is not None:
|
|
74
|
+
self.volume_ids = m.get('volumeIds')
|
|
75
|
+
if m.get('warningList') is not None:
|
|
76
|
+
self.warning_list = m.get('warningList')
|
|
77
|
+
return self
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for DetachVolumeRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DetachVolumeRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for DetachVolumeRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, volume_id, instance_id):
|
|
16
|
+
"""
|
|
17
|
+
Initialize DetachVolumeRequest request entity.
|
|
18
|
+
|
|
19
|
+
:param volume_id: volume_id parameter
|
|
20
|
+
:type volume_id: str (required)
|
|
21
|
+
|
|
22
|
+
:param instance_id: 所挂载的实例ID
|
|
23
|
+
:type instance_id: str (required)
|
|
24
|
+
"""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.volume_id = volume_id
|
|
27
|
+
self.instance_id = instance_id
|
|
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.instance_id is not None:
|
|
43
|
+
result['instanceId'] = self.instance_id
|
|
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: DetachVolumeRequest
|
|
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('volumeId') is not None:
|
|
63
|
+
self.volume_id = m.get('volumeId')
|
|
64
|
+
if m.get('instanceId') is not None:
|
|
65
|
+
self.instance_id = m.get('instanceId')
|
|
66
|
+
return self
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
DiskInfo information
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DiskInfo(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
DiskInfo
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, storage_type=None, max_disk_size=None, min_disk_size=None):
|
|
14
|
+
"""
|
|
15
|
+
Initialize DiskInfo instance.
|
|
16
|
+
|
|
17
|
+
:param storage_type: storage_type attribute
|
|
18
|
+
:type storage_type: str (optional)
|
|
19
|
+
|
|
20
|
+
:param max_disk_size: 最大单盘可创建磁盘容量
|
|
21
|
+
:type max_disk_size: int (optional)
|
|
22
|
+
|
|
23
|
+
:param min_disk_size: 最小单盘创建磁盘容量
|
|
24
|
+
:type min_disk_size: int (optional)
|
|
25
|
+
"""
|
|
26
|
+
super().__init__()
|
|
27
|
+
self.storage_type = storage_type
|
|
28
|
+
self.max_disk_size = max_disk_size
|
|
29
|
+
self.min_disk_size = min_disk_size
|
|
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.storage_type is not None:
|
|
45
|
+
result['storageType'] = self.storage_type
|
|
46
|
+
if self.max_disk_size is not None:
|
|
47
|
+
result['maxDiskSize'] = self.max_disk_size
|
|
48
|
+
if self.min_disk_size is not None:
|
|
49
|
+
result['minDiskSize'] = self.min_disk_size
|
|
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: DiskInfo
|
|
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('storageType') is not None:
|
|
69
|
+
self.storage_type = m.get('storageType')
|
|
70
|
+
if m.get('maxDiskSize') is not None:
|
|
71
|
+
self.max_disk_size = m.get('maxDiskSize')
|
|
72
|
+
if m.get('minDiskSize') is not None:
|
|
73
|
+
self.min_disk_size = m.get('minDiskSize')
|
|
74
|
+
return self
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetCdsPriceRequest information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GetCdsPriceRequest(AbstractModel):
|
|
9
|
+
"""
|
|
10
|
+
Request entity for GetCdsPriceRequest operation.
|
|
11
|
+
|
|
12
|
+
This class encapsulates all parameters for the API request.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(
|
|
16
|
+
self,
|
|
17
|
+
storage_type,
|
|
18
|
+
cds_size_in_gb,
|
|
19
|
+
payment_timing,
|
|
20
|
+
zone_name,
|
|
21
|
+
purchase_count=None,
|
|
22
|
+
purchase_length=None,
|
|
23
|
+
cds_extra_io=None,
|
|
24
|
+
):
|
|
25
|
+
"""
|
|
26
|
+
Initialize GetCdsPriceRequest request entity.
|
|
27
|
+
|
|
28
|
+
:param storage_type: storage_type parameter
|
|
29
|
+
:type storage_type: str (required)
|
|
30
|
+
|
|
31
|
+
:param cds_size_in_gb: CDS磁盘容量
|
|
32
|
+
:type cds_size_in_gb: int (required)
|
|
33
|
+
|
|
34
|
+
:param payment_timing: 付费方式,包括Postpaid(后付费),Prepaid(预付费)两种
|
|
35
|
+
:type payment_timing: str (required)
|
|
36
|
+
|
|
37
|
+
:param zone_name: 可用区名称
|
|
38
|
+
:type zone_name: str (required)
|
|
39
|
+
|
|
40
|
+
:param purchase_count: 任意数量CDS的总价格,必须为大于0的整数,可选参数,缺省为1
|
|
41
|
+
:type purchase_count: int (optional)
|
|
42
|
+
|
|
43
|
+
:param purchase_length: 时长,可选值[1,2,3,4,5,6,7,8,9,12,24,36],单位:月
|
|
44
|
+
:type purchase_length: int (optional)
|
|
45
|
+
|
|
46
|
+
:param cds_extra_io: 增强型SSD_PL1、增强型SSD_PL2、增强型SSD_PL3,支持购买额外IO性能
|
|
47
|
+
:type cds_extra_io: int (optional)
|
|
48
|
+
"""
|
|
49
|
+
super().__init__()
|
|
50
|
+
self.storage_type = storage_type
|
|
51
|
+
self.cds_size_in_gb = cds_size_in_gb
|
|
52
|
+
self.payment_timing = payment_timing
|
|
53
|
+
self.zone_name = zone_name
|
|
54
|
+
self.purchase_count = purchase_count
|
|
55
|
+
self.purchase_length = purchase_length
|
|
56
|
+
self.cds_extra_io = cds_extra_io
|
|
57
|
+
|
|
58
|
+
def to_dict(self):
|
|
59
|
+
"""
|
|
60
|
+
Convert the request entity to a dictionary representation.
|
|
61
|
+
|
|
62
|
+
Nested model objects are recursively converted to dictionaries.
|
|
63
|
+
|
|
64
|
+
:return: Dictionary representation of the request
|
|
65
|
+
:rtype: dict
|
|
66
|
+
"""
|
|
67
|
+
_map = super().to_dict()
|
|
68
|
+
if _map is not None:
|
|
69
|
+
return _map
|
|
70
|
+
result = dict()
|
|
71
|
+
if self.storage_type is not None:
|
|
72
|
+
result['storageType'] = self.storage_type
|
|
73
|
+
if self.cds_size_in_gb is not None:
|
|
74
|
+
result['cdsSizeInGB'] = self.cds_size_in_gb
|
|
75
|
+
if self.payment_timing is not None:
|
|
76
|
+
result['paymentTiming'] = self.payment_timing
|
|
77
|
+
if self.zone_name is not None:
|
|
78
|
+
result['zoneName'] = self.zone_name
|
|
79
|
+
if self.purchase_count is not None:
|
|
80
|
+
result['purchaseCount'] = self.purchase_count
|
|
81
|
+
if self.purchase_length is not None:
|
|
82
|
+
result['purchaseLength'] = self.purchase_length
|
|
83
|
+
if self.cds_extra_io is not None:
|
|
84
|
+
result['cdsExtraIo'] = self.cds_extra_io
|
|
85
|
+
return result
|
|
86
|
+
|
|
87
|
+
def from_dict(self, m):
|
|
88
|
+
"""
|
|
89
|
+
Populate the request entity from a dictionary.
|
|
90
|
+
|
|
91
|
+
Nested dictionaries are recursively converted to model objects.
|
|
92
|
+
|
|
93
|
+
:param m: Dictionary containing request data
|
|
94
|
+
:type m: dict
|
|
95
|
+
|
|
96
|
+
:return: Self reference for method chaining
|
|
97
|
+
:rtype: GetCdsPriceRequest
|
|
98
|
+
|
|
99
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
100
|
+
:raises ValueError: If nested model conversion fails
|
|
101
|
+
"""
|
|
102
|
+
m = m or dict()
|
|
103
|
+
if m.get('storageType') is not None:
|
|
104
|
+
self.storage_type = m.get('storageType')
|
|
105
|
+
if m.get('cdsSizeInGB') is not None:
|
|
106
|
+
self.cds_size_in_gb = m.get('cdsSizeInGB')
|
|
107
|
+
if m.get('paymentTiming') is not None:
|
|
108
|
+
self.payment_timing = m.get('paymentTiming')
|
|
109
|
+
if m.get('zoneName') is not None:
|
|
110
|
+
self.zone_name = m.get('zoneName')
|
|
111
|
+
if m.get('purchaseCount') is not None:
|
|
112
|
+
self.purchase_count = m.get('purchaseCount')
|
|
113
|
+
if m.get('purchaseLength') is not None:
|
|
114
|
+
self.purchase_length = m.get('purchaseLength')
|
|
115
|
+
if m.get('cdsExtraIo') is not None:
|
|
116
|
+
self.cds_extra_io = m.get('cdsExtraIo')
|
|
117
|
+
return self
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Request entity for GetCdsPriceResponse information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
6
|
+
from baiducloud_python_sdk_bcc.models.cds_prices import CdsPrices
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class GetCdsPriceResponse(BceResponse):
|
|
10
|
+
"""
|
|
11
|
+
GetCdsPriceResponse
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, price=None):
|
|
15
|
+
"""
|
|
16
|
+
Initialize GetCdsPriceResponse response.
|
|
17
|
+
|
|
18
|
+
:param price: 查询CDS对应价格信息
|
|
19
|
+
:type price: List[CdsPrices] (optional)
|
|
20
|
+
"""
|
|
21
|
+
super().__init__()
|
|
22
|
+
self.price = price
|
|
23
|
+
|
|
24
|
+
def to_dict(self):
|
|
25
|
+
"""
|
|
26
|
+
Convert the response instance to a dictionary representation.
|
|
27
|
+
|
|
28
|
+
Includes metadata from the parent BceResponse class.
|
|
29
|
+
Nested model objects are recursively converted to dictionaries.
|
|
30
|
+
|
|
31
|
+
:return: Dictionary representation of the response
|
|
32
|
+
:rtype: dict
|
|
33
|
+
"""
|
|
34
|
+
_map = super().to_dict()
|
|
35
|
+
if _map is not None:
|
|
36
|
+
return _map
|
|
37
|
+
result = dict()
|
|
38
|
+
if self.metadata is not None:
|
|
39
|
+
result['metadata'] = dict(self.metadata)
|
|
40
|
+
if self.price is not None:
|
|
41
|
+
result['price'] = [i.to_dict() for i in self.price]
|
|
42
|
+
return result
|
|
43
|
+
|
|
44
|
+
def from_dict(self, m):
|
|
45
|
+
"""
|
|
46
|
+
Populate the response instance from a dictionary.
|
|
47
|
+
|
|
48
|
+
Nested dictionaries are recursively converted to model objects.
|
|
49
|
+
|
|
50
|
+
:param m: Dictionary containing response data
|
|
51
|
+
:type m: dict
|
|
52
|
+
|
|
53
|
+
:return: Self reference for method chaining
|
|
54
|
+
:rtype: GetCdsPriceResponse
|
|
55
|
+
|
|
56
|
+
:raises TypeError: If input is not a dictionary or field type mismatch
|
|
57
|
+
:raises ValueError: If nested model conversion fails
|
|
58
|
+
"""
|
|
59
|
+
m = m or dict()
|
|
60
|
+
if m.get('price') is not None:
|
|
61
|
+
self.price = [CdsPrices().from_dict(i) for i in m.get('price')]
|
|
62
|
+
return self
|