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.
Files changed (49) hide show
  1. baiducloud_python_sdk_bcc/__init__.py +5 -0
  2. baiducloud_python_sdk_bcc/api/__init__.py +0 -0
  3. baiducloud_python_sdk_bcc/api/bcc_client.py +554 -0
  4. baiducloud_python_sdk_bcc/models/__init__.py +44 -0
  5. baiducloud_python_sdk_bcc/models/attach_volume_request.py +82 -0
  6. baiducloud_python_sdk_bcc/models/attach_volume_response.py +70 -0
  7. baiducloud_python_sdk_bcc/models/auto_snapshot_policy_info.py +98 -0
  8. baiducloud_python_sdk_bcc/models/auto_snapshot_policy_model.py +151 -0
  9. baiducloud_python_sdk_bcc/models/billing.py +68 -0
  10. baiducloud_python_sdk_bcc/models/bind_tag_volume_request.py +67 -0
  11. baiducloud_python_sdk_bcc/models/cds_prices.py +90 -0
  12. baiducloud_python_sdk_bcc/models/create_volume_request.py +264 -0
  13. baiducloud_python_sdk_bcc/models/create_volume_response.py +77 -0
  14. baiducloud_python_sdk_bcc/models/detach_volume_request.py +66 -0
  15. baiducloud_python_sdk_bcc/models/disk_info.py +74 -0
  16. baiducloud_python_sdk_bcc/models/get_cds_price_request.py +117 -0
  17. baiducloud_python_sdk_bcc/models/get_cds_price_response.py +62 -0
  18. baiducloud_python_sdk_bcc/models/get_disk_quota_request.py +58 -0
  19. baiducloud_python_sdk_bcc/models/get_disk_quota_response.py +78 -0
  20. baiducloud_python_sdk_bcc/models/get_volume_request.py +58 -0
  21. baiducloud_python_sdk_bcc/models/get_volume_resize_progress_request.py +58 -0
  22. baiducloud_python_sdk_bcc/models/get_volume_resize_progress_response.py +61 -0
  23. baiducloud_python_sdk_bcc/models/get_volume_response.py +62 -0
  24. baiducloud_python_sdk_bcc/models/group_info.py +66 -0
  25. baiducloud_python_sdk_bcc/models/list_volumes_request.py +117 -0
  26. baiducloud_python_sdk_bcc/models/list_volumes_response.py +94 -0
  27. baiducloud_python_sdk_bcc/models/modify_cds_attribute_request.py +90 -0
  28. baiducloud_python_sdk_bcc/models/modify_volume_charge_type_request.py +75 -0
  29. baiducloud_python_sdk_bcc/models/purchase_reserved_volume_request.py +75 -0
  30. baiducloud_python_sdk_bcc/models/purchase_reserved_volume_response.py +61 -0
  31. baiducloud_python_sdk_bcc/models/release_volume_request.py +90 -0
  32. baiducloud_python_sdk_bcc/models/rename_volume_request.py +66 -0
  33. baiducloud_python_sdk_bcc/models/reservation.py +66 -0
  34. baiducloud_python_sdk_bcc/models/resize_volume_request.py +82 -0
  35. baiducloud_python_sdk_bcc/models/resize_volume_response.py +61 -0
  36. baiducloud_python_sdk_bcc/models/rollback_volume_request.py +66 -0
  37. baiducloud_python_sdk_bcc/models/storage_type.py +53 -0
  38. baiducloud_python_sdk_bcc/models/tag_model.py +66 -0
  39. baiducloud_python_sdk_bcc/models/unbind_tag_volume_request.py +67 -0
  40. baiducloud_python_sdk_bcc/models/volume_attachment_model.py +82 -0
  41. baiducloud_python_sdk_bcc/models/volume_model.py +417 -0
  42. baiducloud_python_sdk_bcc/models/volume_multi_attach_info.py +82 -0
  43. baiducloud_python_sdk_bcc/models/volume_status.py +45 -0
  44. baiducloud_python_sdk_bcc/models/volume_type.py +20 -0
  45. baiducloud_python_sdk_bcc-0.0.1.dist-info/LICENSE +177 -0
  46. baiducloud_python_sdk_bcc-0.0.1.dist-info/METADATA +76 -0
  47. baiducloud_python_sdk_bcc-0.0.1.dist-info/RECORD +49 -0
  48. baiducloud_python_sdk_bcc-0.0.1.dist-info/WHEEL +5 -0
  49. baiducloud_python_sdk_bcc-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,417 @@
1
+ """
2
+ VolumeModel information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_bcc.models.tag_model import TagModel
8
+
9
+ from baiducloud_python_sdk_bcc.models.volume_attachment_model import VolumeAttachmentModel
10
+
11
+ from baiducloud_python_sdk_bcc.models.volume_multi_attach_info import VolumeMultiAttachInfo
12
+
13
+ from baiducloud_python_sdk_bcc.models.group_info import GroupInfo
14
+
15
+ from baiducloud_python_sdk_bcc.models.auto_snapshot_policy_model import AutoSnapshotPolicyModel
16
+
17
+ from baiducloud_python_sdk_bcc.models.auto_snapshot_policy_info import AutoSnapshotPolicyInfo
18
+
19
+
20
+ class VolumeModel(AbstractModel):
21
+ """
22
+ VolumeModel
23
+ """
24
+
25
+ def __init__(
26
+ self,
27
+ id=None,
28
+ disk_category=None,
29
+ product_category=None,
30
+ name=None,
31
+ disk_size_in_gb=None,
32
+ cds_extra_io=None,
33
+ failure_status=None,
34
+ create_time=None,
35
+ expire_time=None,
36
+ status=None,
37
+ share_snapshot_id=None,
38
+ enable_delete_protection=None,
39
+ ebc_disk_size=None,
40
+ enable_auto_renew=None,
41
+ auto_renew_time=None,
42
+ tags=None,
43
+ type=None,
44
+ storage_type=None,
45
+ is_system_volume=None,
46
+ description=None,
47
+ payment_timing=None,
48
+ zone_name=None,
49
+ cluster_id=None,
50
+ encrypted=None,
51
+ delete_with_instance=None,
52
+ delete_auto_snapshot=None,
53
+ attachments=None,
54
+ multi_attach_infos=None,
55
+ desc=None,
56
+ region_id=None,
57
+ source_snapshot_id=None,
58
+ snapshot_num=None,
59
+ res_group_infos=None,
60
+ auto_snapshot_policy=None,
61
+ auto_snapshot_policy_infos=None,
62
+ encrypt_key=None,
63
+ encrypt_key_spec=None,
64
+ multi_attach=None,
65
+ volume_id=None,
66
+ ):
67
+ """
68
+ Initialize VolumeModel instance.
69
+
70
+ :param id: 磁盘ID(查询磁盘列表、查询磁盘详情返回)
71
+ :type id: str (optional)
72
+
73
+ :param disk_category: disk_category attribute
74
+ :type disk_category: str (optional)
75
+
76
+ :param product_category: 挂载的实例服务类别,可选值包含BCC/HPAS(查询磁盘列表、查询磁盘详情返回)
77
+ :type product_category: str (optional)
78
+
79
+ :param name: 磁盘名称(查询磁盘列表、查询磁盘详情返回)
80
+ :type name: str (optional)
81
+
82
+ :param disk_size_in_gb: 磁盘大小,单位是GB(查询磁盘列表、查询磁盘详情返回、查询实例列表、查询指定实例详情)
83
+ :type disk_size_in_gb: int (optional)
84
+
85
+ :param cds_extra_io: 额外性能(查询磁盘列表、查询磁盘详情返回)
86
+ :type cds_extra_io: int (optional)
87
+
88
+ :param failure_status: 失败状态信息(查询磁盘列表、查询磁盘详情返回)
89
+ :type failure_status: str (optional)
90
+
91
+ :param create_time: 创建日期,符合BCE日期规范(查询磁盘列表、查询磁盘详情返回)
92
+ :type create_time: str (optional)
93
+
94
+ :param expire_time: 过期时间(查询磁盘列表、查询磁盘详情返回)
95
+ :type expire_time: str (optional)
96
+
97
+ :param status: 磁盘状态(查询磁盘列表、查询磁盘详情返回)
98
+ :type status: str (optional)
99
+
100
+ :param share_snapshot_id: share_snapshot_id attribute
101
+ :type share_snapshot_id: str (optional)
102
+
103
+ :param enable_delete_protection: 是否开启磁盘释放保护(查询磁盘列表、查询磁盘详情返回)
104
+ :type enable_delete_protection: bool (optional)
105
+
106
+ :param ebc_disk_size: EBC磁盘大小(查询磁盘列表返回)
107
+ :type ebc_disk_size: int (optional)
108
+
109
+ :param enable_auto_renew: 是否自动续费(查询磁盘列表、查询磁盘详情返回)
110
+ :type enable_auto_renew: bool (optional)
111
+
112
+ :param auto_renew_time: 自动续费时间(查询磁盘列表、查询磁盘详情返回)
113
+ :type auto_renew_time: int (optional)
114
+
115
+ :param tags: 磁盘当前配置的标签(查询磁盘列表、查询磁盘详情返回)
116
+ :type tags: List[TagModel] (optional)
117
+
118
+ :param type: 磁盘类型(查询磁盘列表、查询磁盘详情返回)
119
+ :type type: str (optional)
120
+
121
+ :param storage_type: storage_type attribute
122
+ :type storage_type: str (optional)
123
+
124
+ :param is_system_volume: 是否为系统盘(查询磁盘列表、查询磁盘详情返回、查询实例列表、查询指定实例详情)
125
+ :type is_system_volume: bool (optional)
126
+
127
+ :param description: 描述信息(查询磁盘列表返回)
128
+ :type description: str (optional)
129
+
130
+ :param payment_timing: 付费方式,包括Postpaid(按量付费),Prepaid(包年包月)两种。(查询磁盘列表、查询磁盘详情返回)
131
+ :type payment_timing: str (optional)
132
+
133
+ :param zone_name: 可用区信息(查询磁盘列表、查询磁盘详情返回)
134
+ :type zone_name: str (optional)
135
+
136
+ :param cluster_id: CDS专属集群ID(查询磁盘列表、查询磁盘详情返回)
137
+ :type cluster_id: str (optional)
138
+
139
+ :param encrypted: 是否加密(查询磁盘列表、查询磁盘详情返回)
140
+ :type encrypted: bool (optional)
141
+
142
+ :param delete_with_instance: 磁盘随实例删除,仅后付费类型的数据盘返回(查询磁盘列表、查询磁盘详情返回)
143
+ :type delete_with_instance: bool (optional)
144
+
145
+ :param delete_auto_snapshot: 自动快照随磁盘删除,任何类型的磁盘都会返回(查询磁盘列表、查询磁盘详情返回)
146
+ :type delete_auto_snapshot: bool (optional)
147
+
148
+ :param attachments: 挂载设备信息列表,磁盘未挂载时该值为空。(查询磁盘列表、查询磁盘详情返回)
149
+ :type attachments: List[VolumeAttachmentModel] (optional)
150
+
151
+ :param multi_attach_infos: 多挂载信息列表(查询磁盘列表、查询磁盘详情返回)
152
+ :type multi_attach_infos: List[VolumeMultiAttachInfo] (optional)
153
+
154
+ :param desc: 描述信息(查询磁盘详情返回)
155
+ :type desc: str (optional)
156
+
157
+ :param region_id: 所在region(查询磁盘详情返回)
158
+ :type region_id: str (optional)
159
+
160
+ :param source_snapshot_id: 创建磁盘所用的快照id(查询磁盘详情返回)
161
+ :type source_snapshot_id: str (optional)
162
+
163
+ :param snapshot_num: 磁盘当前具有的快照数量(查询磁盘详情返回)
164
+ :type snapshot_num: str (optional)
165
+
166
+ :param res_group_infos: 磁盘当前绑定的资源组(查询磁盘详情返回)
167
+ :type res_group_infos: List[GroupInfo] (optional)
168
+
169
+ :param auto_snapshot_policy: auto_snapshot_policy attribute
170
+ :type auto_snapshot_policy: AutoSnapshotPolicyModel (optional)
171
+
172
+ :param auto_snapshot_policy_infos: 快照策略信息列表(查询磁盘详情返回)
173
+ :type auto_snapshot_policy_infos: List[AutoSnapshotPolicyInfo] (optional)
174
+
175
+ :param encrypt_key: 加密密钥(查询磁盘详情返回)
176
+ :type encrypt_key: str (optional)
177
+
178
+ :param encrypt_key_spec: 加密密钥规格(查询磁盘详情返回)
179
+ :type encrypt_key_spec: str (optional)
180
+
181
+ :param multi_attach: 是否支持多挂载(查询指定实例详情)
182
+ :type multi_attach: bool (optional)
183
+
184
+ :param volume_id: 磁盘ID(查询实例列表、查询指定实例详情)
185
+ :type volume_id: str (optional)
186
+ """
187
+ super().__init__()
188
+ self.id = id
189
+ self.disk_category = disk_category
190
+ self.product_category = product_category
191
+ self.name = name
192
+ self.disk_size_in_gb = disk_size_in_gb
193
+ self.cds_extra_io = cds_extra_io
194
+ self.failure_status = failure_status
195
+ self.create_time = create_time
196
+ self.expire_time = expire_time
197
+ self.status = status
198
+ self.share_snapshot_id = share_snapshot_id
199
+ self.enable_delete_protection = enable_delete_protection
200
+ self.ebc_disk_size = ebc_disk_size
201
+ self.enable_auto_renew = enable_auto_renew
202
+ self.auto_renew_time = auto_renew_time
203
+ self.tags = tags
204
+ self.type = type
205
+ self.storage_type = storage_type
206
+ self.is_system_volume = is_system_volume
207
+ self.description = description
208
+ self.payment_timing = payment_timing
209
+ self.zone_name = zone_name
210
+ self.cluster_id = cluster_id
211
+ self.encrypted = encrypted
212
+ self.delete_with_instance = delete_with_instance
213
+ self.delete_auto_snapshot = delete_auto_snapshot
214
+ self.attachments = attachments
215
+ self.multi_attach_infos = multi_attach_infos
216
+ self.desc = desc
217
+ self.region_id = region_id
218
+ self.source_snapshot_id = source_snapshot_id
219
+ self.snapshot_num = snapshot_num
220
+ self.res_group_infos = res_group_infos
221
+ self.auto_snapshot_policy = auto_snapshot_policy
222
+ self.auto_snapshot_policy_infos = auto_snapshot_policy_infos
223
+ self.encrypt_key = encrypt_key
224
+ self.encrypt_key_spec = encrypt_key_spec
225
+ self.multi_attach = multi_attach
226
+ self.volume_id = volume_id
227
+
228
+ def to_dict(self):
229
+ """
230
+ Convert the model instance to a dictionary representation.
231
+
232
+ Nested model objects are recursively converted to dictionaries.
233
+
234
+ :return: Dictionary representation of the model
235
+ :rtype: dict
236
+ """
237
+ _map = super().to_dict()
238
+ if _map is not None:
239
+ return _map
240
+ result = dict()
241
+ if self.id is not None:
242
+ result['id'] = self.id
243
+ if self.disk_category is not None:
244
+ result['diskCategory'] = self.disk_category
245
+ if self.product_category is not None:
246
+ result['productCategory'] = self.product_category
247
+ if self.name is not None:
248
+ result['name'] = self.name
249
+ if self.disk_size_in_gb is not None:
250
+ result['diskSizeInGB'] = self.disk_size_in_gb
251
+ if self.cds_extra_io is not None:
252
+ result['cdsExtraIo'] = self.cds_extra_io
253
+ if self.failure_status is not None:
254
+ result['failureStatus'] = self.failure_status
255
+ if self.create_time is not None:
256
+ result['createTime'] = self.create_time
257
+ if self.expire_time is not None:
258
+ result['expireTime'] = self.expire_time
259
+ if self.status is not None:
260
+ result['status'] = self.status
261
+ if self.share_snapshot_id is not None:
262
+ result['shareSnapshotId'] = self.share_snapshot_id
263
+ if self.enable_delete_protection is not None:
264
+ result['enableDeleteProtection'] = self.enable_delete_protection
265
+ if self.ebc_disk_size is not None:
266
+ result['ebcDiskSize'] = self.ebc_disk_size
267
+ if self.enable_auto_renew is not None:
268
+ result['enableAutoRenew'] = self.enable_auto_renew
269
+ if self.auto_renew_time is not None:
270
+ result['autoRenewTime'] = self.auto_renew_time
271
+ if self.tags is not None:
272
+ result['tags'] = [i.to_dict() for i in self.tags]
273
+ if self.type is not None:
274
+ result['type'] = self.type
275
+ if self.storage_type is not None:
276
+ result['storageType'] = self.storage_type
277
+ if self.is_system_volume is not None:
278
+ result['isSystemVolume'] = self.is_system_volume
279
+ if self.description is not None:
280
+ result['description'] = self.description
281
+ if self.payment_timing is not None:
282
+ result['paymentTiming'] = self.payment_timing
283
+ if self.zone_name is not None:
284
+ result['zoneName'] = self.zone_name
285
+ if self.cluster_id is not None:
286
+ result['clusterId'] = self.cluster_id
287
+ if self.encrypted is not None:
288
+ result['encrypted'] = self.encrypted
289
+ if self.delete_with_instance is not None:
290
+ result['deleteWithInstance'] = self.delete_with_instance
291
+ if self.delete_auto_snapshot is not None:
292
+ result['deleteAutoSnapshot'] = self.delete_auto_snapshot
293
+ if self.attachments is not None:
294
+ result['attachments'] = [i.to_dict() for i in self.attachments]
295
+ if self.multi_attach_infos is not None:
296
+ result['multiAttachInfos'] = [i.to_dict() for i in self.multi_attach_infos]
297
+ if self.desc is not None:
298
+ result['desc'] = self.desc
299
+ if self.region_id is not None:
300
+ result['regionId'] = self.region_id
301
+ if self.source_snapshot_id is not None:
302
+ result['sourceSnapshotId'] = self.source_snapshot_id
303
+ if self.snapshot_num is not None:
304
+ result['snapshotNum'] = self.snapshot_num
305
+ if self.res_group_infos is not None:
306
+ result['resGroupInfos'] = [i.to_dict() for i in self.res_group_infos]
307
+ if self.auto_snapshot_policy is not None:
308
+ result['autoSnapshotPolicy'] = self.auto_snapshot_policy.to_dict()
309
+ if self.auto_snapshot_policy_infos is not None:
310
+ result['autoSnapshotPolicyInfos'] = [i.to_dict() for i in self.auto_snapshot_policy_infos]
311
+ if self.encrypt_key is not None:
312
+ result['encryptKey'] = self.encrypt_key
313
+ if self.encrypt_key_spec is not None:
314
+ result['encryptKeySpec'] = self.encrypt_key_spec
315
+ if self.multi_attach is not None:
316
+ result['multiAttach'] = self.multi_attach
317
+ if self.volume_id is not None:
318
+ result['volumeId'] = self.volume_id
319
+ return result
320
+
321
+ def from_dict(self, m):
322
+ """
323
+ Populate the model instance from a dictionary.
324
+
325
+ Nested dictionaries are recursively converted to model objects.
326
+
327
+ :param m: Dictionary containing model data
328
+ :type m: dict
329
+
330
+ :return: Self reference for method chaining
331
+ :rtype: VolumeModel
332
+
333
+ :raises TypeError: If input is not a dictionary type
334
+ :raises ValueError: If nested model conversion fails
335
+ """
336
+ m = m or dict()
337
+ if m.get('id') is not None:
338
+ self.id = m.get('id')
339
+ if m.get('diskCategory') is not None:
340
+ self.disk_category = m.get('diskCategory')
341
+ if m.get('productCategory') is not None:
342
+ self.product_category = m.get('productCategory')
343
+ if m.get('name') is not None:
344
+ self.name = m.get('name')
345
+ if m.get('diskSizeInGB') is not None:
346
+ self.disk_size_in_gb = m.get('diskSizeInGB')
347
+ if m.get('cdsExtraIo') is not None:
348
+ self.cds_extra_io = m.get('cdsExtraIo')
349
+ if m.get('failureStatus') is not None:
350
+ self.failure_status = m.get('failureStatus')
351
+ if m.get('createTime') is not None:
352
+ self.create_time = m.get('createTime')
353
+ if m.get('expireTime') is not None:
354
+ self.expire_time = m.get('expireTime')
355
+ if m.get('status') is not None:
356
+ self.status = m.get('status')
357
+ if m.get('shareSnapshotId') is not None:
358
+ self.share_snapshot_id = m.get('shareSnapshotId')
359
+ if m.get('enableDeleteProtection') is not None:
360
+ self.enable_delete_protection = m.get('enableDeleteProtection')
361
+ if m.get('ebcDiskSize') is not None:
362
+ self.ebc_disk_size = m.get('ebcDiskSize')
363
+ if m.get('enableAutoRenew') is not None:
364
+ self.enable_auto_renew = m.get('enableAutoRenew')
365
+ if m.get('autoRenewTime') is not None:
366
+ self.auto_renew_time = m.get('autoRenewTime')
367
+ if m.get('tags') is not None:
368
+ self.tags = [TagModel().from_dict(i) for i in m.get('tags')]
369
+ if m.get('type') is not None:
370
+ self.type = m.get('type')
371
+ if m.get('storageType') is not None:
372
+ self.storage_type = m.get('storageType')
373
+ if m.get('isSystemVolume') is not None:
374
+ self.is_system_volume = m.get('isSystemVolume')
375
+ if m.get('description') is not None:
376
+ self.description = m.get('description')
377
+ if m.get('paymentTiming') is not None:
378
+ self.payment_timing = m.get('paymentTiming')
379
+ if m.get('zoneName') is not None:
380
+ self.zone_name = m.get('zoneName')
381
+ if m.get('clusterId') is not None:
382
+ self.cluster_id = m.get('clusterId')
383
+ if m.get('encrypted') is not None:
384
+ self.encrypted = m.get('encrypted')
385
+ if m.get('deleteWithInstance') is not None:
386
+ self.delete_with_instance = m.get('deleteWithInstance')
387
+ if m.get('deleteAutoSnapshot') is not None:
388
+ self.delete_auto_snapshot = m.get('deleteAutoSnapshot')
389
+ if m.get('attachments') is not None:
390
+ self.attachments = [VolumeAttachmentModel().from_dict(i) for i in m.get('attachments')]
391
+ if m.get('multiAttachInfos') is not None:
392
+ self.multi_attach_infos = [VolumeMultiAttachInfo().from_dict(i) for i in m.get('multiAttachInfos')]
393
+ if m.get('desc') is not None:
394
+ self.desc = m.get('desc')
395
+ if m.get('regionId') is not None:
396
+ self.region_id = m.get('regionId')
397
+ if m.get('sourceSnapshotId') is not None:
398
+ self.source_snapshot_id = m.get('sourceSnapshotId')
399
+ if m.get('snapshotNum') is not None:
400
+ self.snapshot_num = m.get('snapshotNum')
401
+ if m.get('resGroupInfos') is not None:
402
+ self.res_group_infos = [GroupInfo().from_dict(i) for i in m.get('resGroupInfos')]
403
+ if m.get('autoSnapshotPolicy') is not None:
404
+ self.auto_snapshot_policy = AutoSnapshotPolicyModel().from_dict(m.get('autoSnapshotPolicy'))
405
+ if m.get('autoSnapshotPolicyInfos') is not None:
406
+ self.auto_snapshot_policy_infos = [
407
+ AutoSnapshotPolicyInfo().from_dict(i) for i in m.get('autoSnapshotPolicyInfos')
408
+ ]
409
+ if m.get('encryptKey') is not None:
410
+ self.encrypt_key = m.get('encryptKey')
411
+ if m.get('encryptKeySpec') is not None:
412
+ self.encrypt_key_spec = m.get('encryptKeySpec')
413
+ if m.get('multiAttach') is not None:
414
+ self.multi_attach = m.get('multiAttach')
415
+ if m.get('volumeId') is not None:
416
+ self.volume_id = m.get('volumeId')
417
+ return self
@@ -0,0 +1,82 @@
1
+ """
2
+ VolumeMultiAttachInfo information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class VolumeMultiAttachInfo(AbstractModel):
9
+ """
10
+ VolumeMultiAttachInfo
11
+ """
12
+
13
+ def __init__(self, volume_id=None, serial=None, instance_id=None, status=None):
14
+ """
15
+ Initialize VolumeMultiAttachInfo instance.
16
+
17
+ :param volume_id: 磁盘ID
18
+ :type volume_id: str (optional)
19
+
20
+ :param serial: 磁盘序列号
21
+ :type serial: str (optional)
22
+
23
+ :param instance_id: 实例ID
24
+ :type instance_id: str (optional)
25
+
26
+ :param status: 状态
27
+ :type status: str (optional)
28
+ """
29
+ super().__init__()
30
+ self.volume_id = volume_id
31
+ self.serial = serial
32
+ self.instance_id = instance_id
33
+ self.status = status
34
+
35
+ def to_dict(self):
36
+ """
37
+ Convert the model instance to a dictionary representation.
38
+
39
+ Nested model objects are recursively converted to dictionaries.
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.volume_id is not None:
49
+ result['volumeId'] = self.volume_id
50
+ if self.serial is not None:
51
+ result['serial'] = self.serial
52
+ if self.instance_id is not None:
53
+ result['instanceId'] = self.instance_id
54
+ if self.status is not None:
55
+ result['status'] = self.status
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: VolumeMultiAttachInfo
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('volumeId') is not None:
75
+ self.volume_id = m.get('volumeId')
76
+ if m.get('serial') is not None:
77
+ self.serial = m.get('serial')
78
+ if m.get('instanceId') is not None:
79
+ self.instance_id = m.get('instanceId')
80
+ if m.get('status') is not None:
81
+ self.status = m.get('status')
82
+ return self
@@ -0,0 +1,45 @@
1
+ """
2
+ VolumeStatus information
3
+ """
4
+
5
+
6
+ class VolumeStatus:
7
+ """
8
+ Enum class for VolumeStatus
9
+ """
10
+
11
+ CREATING = 'Creating'
12
+ AVAILABLE = 'Available'
13
+ ATTACHING = 'Attaching'
14
+ NOTAVAILABLE = 'NotAvailable'
15
+ INUSE = 'InUse'
16
+ DETACHING = 'Detaching'
17
+ DELETING = 'Deleting'
18
+ DELETED = 'Deleted'
19
+ SCALING = 'Scaling'
20
+ EXPIRED = 'Expired'
21
+ ERROR = 'Error'
22
+ SNAPSHOTPROCESSING = 'SnapshotProcessing'
23
+ IMAGEPROCESSING = 'ImageProcessing'
24
+ RECHARGING = 'Recharging'
25
+
26
+ @staticmethod
27
+ def is_valid(value):
28
+ """Check if the value is valid for this enum"""
29
+ valid_values = [
30
+ 'Creating',
31
+ 'Available',
32
+ 'Attaching',
33
+ 'NotAvailable',
34
+ 'InUse',
35
+ 'Detaching',
36
+ 'Deleting',
37
+ 'Deleted',
38
+ 'Scaling',
39
+ 'Expired',
40
+ 'Error',
41
+ 'SnapshotProcessing',
42
+ 'ImageProcessing',
43
+ 'Recharging',
44
+ ]
45
+ return value in valid_values
@@ -0,0 +1,20 @@
1
+ """
2
+ VolumeType information
3
+ """
4
+
5
+
6
+ class VolumeType:
7
+ """
8
+ Enum class for VolumeType
9
+ Allowed values: SYSTEM, EPHEMERAL, CDS
10
+ """
11
+
12
+ SYSTEM = 'System'
13
+ EPHEMERAL = 'Ephemeral'
14
+ CDS = 'Cds'
15
+
16
+ @staticmethod
17
+ def is_valid(value):
18
+ """Check if the value is valid for this enum"""
19
+ valid_values = ['System', 'Ephemeral', 'Cds']
20
+ return value in valid_values