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,70 @@
1
+ """
2
+ Request entity for AttachVolumeResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_bcc.models.volume_attachment_model import VolumeAttachmentModel
7
+
8
+
9
+ class AttachVolumeResponse(BceResponse):
10
+ """
11
+ AttachVolumeResponse
12
+ """
13
+
14
+ def __init__(self, volume_attachment=None, warning_list=None):
15
+ """
16
+ Initialize AttachVolumeResponse response.
17
+
18
+ :param volume_attachment: volume_attachment field
19
+ :type volume_attachment: VolumeAttachmentModel (optional)
20
+
21
+ :param warning_list: 挂载磁盘产生的warning信息
22
+ :type warning_list: List[str] (optional)
23
+ """
24
+ super().__init__()
25
+ self.volume_attachment = volume_attachment
26
+ self.warning_list = warning_list
27
+
28
+ def to_dict(self):
29
+ """
30
+ Convert the response instance to a dictionary representation.
31
+
32
+ Includes metadata from the parent BceResponse class.
33
+ Nested model objects are recursively converted to dictionaries.
34
+
35
+ :return: Dictionary representation of the response
36
+ :rtype: dict
37
+ """
38
+ _map = super().to_dict()
39
+ if _map is not None:
40
+ return _map
41
+ result = dict()
42
+ if self.metadata is not None:
43
+ result['metadata'] = dict(self.metadata)
44
+ if self.volume_attachment is not None:
45
+ result['volumeAttachment'] = self.volume_attachment.to_dict()
46
+ if self.warning_list is not None:
47
+ result['warningList'] = self.warning_list
48
+ return result
49
+
50
+ def from_dict(self, m):
51
+ """
52
+ Populate the response instance from a dictionary.
53
+
54
+ Nested dictionaries are recursively converted to model objects.
55
+
56
+ :param m: Dictionary containing response data
57
+ :type m: dict
58
+
59
+ :return: Self reference for method chaining
60
+ :rtype: AttachVolumeResponse
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('volumeAttachment') is not None:
67
+ self.volume_attachment = VolumeAttachmentModel().from_dict(m.get('volumeAttachment'))
68
+ if m.get('warningList') is not None:
69
+ self.warning_list = m.get('warningList')
70
+ return self
@@ -0,0 +1,98 @@
1
+ """
2
+ AutoSnapshotPolicyInfo information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class AutoSnapshotPolicyInfo(AbstractModel):
9
+ """
10
+ AutoSnapshotPolicyInfo
11
+ """
12
+
13
+ def __init__(self, id=None, name=None, time_points=None, repeat_weekdays=None, retention_days=None, status=None):
14
+ """
15
+ Initialize AutoSnapshotPolicyInfo instance.
16
+
17
+ :param id: 快照策略ID
18
+ :type id: str (optional)
19
+
20
+ :param name: 快照策略名称
21
+ :type name: str (optional)
22
+
23
+ :param time_points: 自动快照策略中设置的执行时间点
24
+ :type time_points: List[int] (optional)
25
+
26
+ :param repeat_weekdays: 自动快照策略中设置的执行日期
27
+ :type repeat_weekdays: List[int] (optional)
28
+
29
+ :param retention_days: 保留天数
30
+ :type retention_days: int (optional)
31
+
32
+ :param status: 快照策略状态
33
+ :type status: str (optional)
34
+ """
35
+ super().__init__()
36
+ self.id = id
37
+ self.name = name
38
+ self.time_points = time_points
39
+ self.repeat_weekdays = repeat_weekdays
40
+ self.retention_days = retention_days
41
+ self.status = status
42
+
43
+ def to_dict(self):
44
+ """
45
+ Convert the model instance to a dictionary representation.
46
+
47
+ Nested model objects are recursively converted to dictionaries.
48
+
49
+ :return: Dictionary representation of the model
50
+ :rtype: dict
51
+ """
52
+ _map = super().to_dict()
53
+ if _map is not None:
54
+ return _map
55
+ result = dict()
56
+ if self.id is not None:
57
+ result['id'] = self.id
58
+ if self.name is not None:
59
+ result['name'] = self.name
60
+ if self.time_points is not None:
61
+ result['timePoints'] = self.time_points
62
+ if self.repeat_weekdays is not None:
63
+ result['repeatWeekdays'] = self.repeat_weekdays
64
+ if self.retention_days is not None:
65
+ result['retentionDays'] = self.retention_days
66
+ if self.status is not None:
67
+ result['status'] = self.status
68
+ return result
69
+
70
+ def from_dict(self, m):
71
+ """
72
+ Populate the model instance from a dictionary.
73
+
74
+ Nested dictionaries are recursively converted to model objects.
75
+
76
+ :param m: Dictionary containing model data
77
+ :type m: dict
78
+
79
+ :return: Self reference for method chaining
80
+ :rtype: AutoSnapshotPolicyInfo
81
+
82
+ :raises TypeError: If input is not a dictionary type
83
+ :raises ValueError: If nested model conversion fails
84
+ """
85
+ m = m or dict()
86
+ if m.get('id') is not None:
87
+ self.id = m.get('id')
88
+ if m.get('name') is not None:
89
+ self.name = m.get('name')
90
+ if m.get('timePoints') is not None:
91
+ self.time_points = m.get('timePoints')
92
+ if m.get('repeatWeekdays') is not None:
93
+ self.repeat_weekdays = m.get('repeatWeekdays')
94
+ if m.get('retentionDays') is not None:
95
+ self.retention_days = m.get('retentionDays')
96
+ if m.get('status') is not None:
97
+ self.status = m.get('status')
98
+ return self
@@ -0,0 +1,151 @@
1
+ """
2
+ AutoSnapshotPolicyModel information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class AutoSnapshotPolicyModel(AbstractModel):
9
+ """
10
+ AutoSnapshotPolicyModel
11
+ """
12
+
13
+ def __init__(
14
+ self,
15
+ id=None,
16
+ name=None,
17
+ time_points=None,
18
+ repeat_weekdays=None,
19
+ status=None,
20
+ retention_days=None,
21
+ created_time=None,
22
+ updated_time=None,
23
+ deleted_time=None,
24
+ last_execute_time=None,
25
+ volume_count=None,
26
+ ):
27
+ """
28
+ Initialize AutoSnapshotPolicyModel instance.
29
+
30
+ :param id: 自动快照策略ID(查询磁盘详情返回)
31
+ :type id: str (optional)
32
+
33
+ :param name: name attribute
34
+ :type name: str (optional)
35
+
36
+ :param time_points: time_points attribute
37
+ :type time_points: List[int] (optional)
38
+
39
+ :param repeat_weekdays: repeat_weekdays attribute
40
+ :type repeat_weekdays: List[int] (optional)
41
+
42
+ :param status: 快照状态, 有active(运行)、deleted(删除)、paused(暂停)三种状态(查询磁盘详情返回)
43
+ :type status: str (optional)
44
+
45
+ :param retention_days: 指定自动快照的保留时间, 单位为天。-1: 永久保存 1~65536: 指定保存天数。(查询磁盘详情返回)
46
+ :type retention_days: int (optional)
47
+
48
+ :param created_time: 自动快照策略的创建时间, 符合BCE规范的日期格式 (自该字段起, 及之后字段, 在volume的接口中没有返回)
49
+ :type created_time: str (optional)
50
+
51
+ :param updated_time: 自动快照策略的最近更新时间, 符合BCE规范的日期格式
52
+ :type updated_time: str (optional)
53
+
54
+ :param deleted_time: 自动快照策略的删除时间, 符合BCE规范的日期格式
55
+ :type deleted_time: str (optional)
56
+
57
+ :param last_execute_time: 自动快照策略的最后执行时间, 符合BCE规范的日期格式
58
+ :type last_execute_time: str (optional)
59
+
60
+ :param volume_count: 关联磁盘数量
61
+ :type volume_count: int (optional)
62
+ """
63
+ super().__init__()
64
+ self.id = id
65
+ self.name = name
66
+ self.time_points = time_points
67
+ self.repeat_weekdays = repeat_weekdays
68
+ self.status = status
69
+ self.retention_days = retention_days
70
+ self.created_time = created_time
71
+ self.updated_time = updated_time
72
+ self.deleted_time = deleted_time
73
+ self.last_execute_time = last_execute_time
74
+ self.volume_count = volume_count
75
+
76
+ def to_dict(self):
77
+ """
78
+ Convert the model instance to a dictionary representation.
79
+
80
+ Nested model objects are recursively converted to dictionaries.
81
+
82
+ :return: Dictionary representation of the model
83
+ :rtype: dict
84
+ """
85
+ _map = super().to_dict()
86
+ if _map is not None:
87
+ return _map
88
+ result = dict()
89
+ if self.id is not None:
90
+ result['id'] = self.id
91
+ if self.name is not None:
92
+ result['name'] = self.name
93
+ if self.time_points is not None:
94
+ result['timePoints'] = self.time_points
95
+ if self.repeat_weekdays is not None:
96
+ result['repeatWeekdays'] = self.repeat_weekdays
97
+ if self.status is not None:
98
+ result['status'] = self.status
99
+ if self.retention_days is not None:
100
+ result['retentionDays'] = self.retention_days
101
+ if self.created_time is not None:
102
+ result['createdTime'] = self.created_time
103
+ if self.updated_time is not None:
104
+ result['updatedTime'] = self.updated_time
105
+ if self.deleted_time is not None:
106
+ result['deletedTime'] = self.deleted_time
107
+ if self.last_execute_time is not None:
108
+ result['lastExecuteTime'] = self.last_execute_time
109
+ if self.volume_count is not None:
110
+ result['volumeCount'] = self.volume_count
111
+ return result
112
+
113
+ def from_dict(self, m):
114
+ """
115
+ Populate the model instance from a dictionary.
116
+
117
+ Nested dictionaries are recursively converted to model objects.
118
+
119
+ :param m: Dictionary containing model data
120
+ :type m: dict
121
+
122
+ :return: Self reference for method chaining
123
+ :rtype: AutoSnapshotPolicyModel
124
+
125
+ :raises TypeError: If input is not a dictionary type
126
+ :raises ValueError: If nested model conversion fails
127
+ """
128
+ m = m or dict()
129
+ if m.get('id') is not None:
130
+ self.id = m.get('id')
131
+ if m.get('name') is not None:
132
+ self.name = m.get('name')
133
+ if m.get('timePoints') is not None:
134
+ self.time_points = m.get('timePoints')
135
+ if m.get('repeatWeekdays') is not None:
136
+ self.repeat_weekdays = m.get('repeatWeekdays')
137
+ if m.get('status') is not None:
138
+ self.status = m.get('status')
139
+ if m.get('retentionDays') is not None:
140
+ self.retention_days = m.get('retentionDays')
141
+ if m.get('createdTime') is not None:
142
+ self.created_time = m.get('createdTime')
143
+ if m.get('updatedTime') is not None:
144
+ self.updated_time = m.get('updatedTime')
145
+ if m.get('deletedTime') is not None:
146
+ self.deleted_time = m.get('deletedTime')
147
+ if m.get('lastExecuteTime') is not None:
148
+ self.last_execute_time = m.get('lastExecuteTime')
149
+ if m.get('volumeCount') is not None:
150
+ self.volume_count = m.get('volumeCount')
151
+ return self
@@ -0,0 +1,68 @@
1
+ """
2
+ Billing information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_bcc.models.reservation import Reservation
8
+
9
+
10
+ class Billing(AbstractModel):
11
+ """
12
+ Billing
13
+ """
14
+
15
+ def __init__(self, payment_timing=None, reservation=None):
16
+ """
17
+ Initialize Billing instance.
18
+
19
+ :param payment_timing: payment_timing attribute
20
+ :type payment_timing: str (optional)
21
+
22
+ :param reservation: reservation attribute
23
+ :type reservation: Reservation (optional)
24
+ """
25
+ super().__init__()
26
+ self.payment_timing = payment_timing
27
+ self.reservation = reservation
28
+
29
+ def to_dict(self):
30
+ """
31
+ Convert the model instance to a dictionary representation.
32
+
33
+ Nested model objects are recursively converted to dictionaries.
34
+
35
+ :return: Dictionary representation of the model
36
+ :rtype: dict
37
+ """
38
+ _map = super().to_dict()
39
+ if _map is not None:
40
+ return _map
41
+ result = dict()
42
+ if self.payment_timing is not None:
43
+ result['paymentTiming'] = self.payment_timing
44
+ if self.reservation is not None:
45
+ result['reservation'] = self.reservation.to_dict()
46
+ return result
47
+
48
+ def from_dict(self, m):
49
+ """
50
+ Populate the model instance from a dictionary.
51
+
52
+ Nested dictionaries are recursively converted to model objects.
53
+
54
+ :param m: Dictionary containing model data
55
+ :type m: dict
56
+
57
+ :return: Self reference for method chaining
58
+ :rtype: Billing
59
+
60
+ :raises TypeError: If input is not a dictionary type
61
+ :raises ValueError: If nested model conversion fails
62
+ """
63
+ m = m or dict()
64
+ if m.get('paymentTiming') is not None:
65
+ self.payment_timing = m.get('paymentTiming')
66
+ if m.get('reservation') is not None:
67
+ self.reservation = Reservation().from_dict(m.get('reservation'))
68
+ return self
@@ -0,0 +1,67 @@
1
+ """
2
+ Request entity for BindTagVolumeRequest 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
+
8
+
9
+ class BindTagVolumeRequest(AbstractModel):
10
+ """
11
+ Request entity for BindTagVolumeRequest operation.
12
+
13
+ This class encapsulates all parameters for the API request.
14
+ """
15
+
16
+ def __init__(self, volume_id, change_tags):
17
+ """
18
+ Initialize BindTagVolumeRequest request entity.
19
+
20
+ :param volume_id: volume_id parameter
21
+ :type volume_id: str (required)
22
+
23
+ :param change_tags: 待绑定的标签列表,绑定的标签如果之前不存在,将自动创建该标签
24
+ :type change_tags: List[TagModel] (required)
25
+ """
26
+ super().__init__()
27
+ self.volume_id = volume_id
28
+ self.change_tags = change_tags
29
+
30
+ def to_dict(self):
31
+ """
32
+ Convert the request entity to a dictionary representation.
33
+
34
+ Nested model objects are recursively converted to dictionaries.
35
+
36
+ :return: Dictionary representation of the request
37
+ :rtype: dict
38
+ """
39
+ _map = super().to_dict()
40
+ if _map is not None:
41
+ return _map
42
+ result = dict()
43
+ if self.change_tags is not None:
44
+ result['changeTags'] = [i.to_dict() for i in self.change_tags]
45
+ return result
46
+
47
+ def from_dict(self, m):
48
+ """
49
+ Populate the request entity from a dictionary.
50
+
51
+ Nested dictionaries are recursively converted to model objects.
52
+
53
+ :param m: Dictionary containing request data
54
+ :type m: dict
55
+
56
+ :return: Self reference for method chaining
57
+ :rtype: BindTagVolumeRequest
58
+
59
+ :raises TypeError: If input is not a dictionary or field type mismatch
60
+ :raises ValueError: If nested model conversion fails
61
+ """
62
+ m = m or dict()
63
+ if m.get('volumeId') is not None:
64
+ self.volume_id = m.get('volumeId')
65
+ if m.get('changeTags') is not None:
66
+ self.change_tags = [TagModel().from_dict(i) for i in m.get('changeTags')]
67
+ return self
@@ -0,0 +1,90 @@
1
+ """
2
+ CdsPrices information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class CdsPrices(AbstractModel):
9
+ """
10
+ CdsPrices
11
+ """
12
+
13
+ def __init__(self, storage_type=None, cds_size_in_gb=None, price=None, spec_price=None, unit=None):
14
+ """
15
+ Initialize CdsPrices instance.
16
+
17
+ :param storage_type: 磁盘存储类型(查询CDS价格返回)
18
+ :type storage_type: str (optional)
19
+
20
+ :param cds_size_in_gb: 磁盘容量(查询CDS价格返回)
21
+ :type cds_size_in_gb: int (optional)
22
+
23
+ :param price: 价格(查询CDS价格返回)
24
+ :type price: float (optional)
25
+
26
+ :param spec_price: 实例规格的原始标价(查询CDS价格返回)
27
+ :type spec_price: float (optional)
28
+
29
+ :param unit: 计费单位(查询CDS价格返回)
30
+ :type unit: str (optional)
31
+ """
32
+ super().__init__()
33
+ self.storage_type = storage_type
34
+ self.cds_size_in_gb = cds_size_in_gb
35
+ self.price = price
36
+ self.spec_price = spec_price
37
+ self.unit = unit
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.storage_type is not None:
53
+ result['storageType'] = self.storage_type
54
+ if self.cds_size_in_gb is not None:
55
+ result['cdsSizeInGB'] = self.cds_size_in_gb
56
+ if self.price is not None:
57
+ result['price'] = self.price
58
+ if self.spec_price is not None:
59
+ result['specPrice'] = self.spec_price
60
+ if self.unit is not None:
61
+ result['unit'] = self.unit
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: CdsPrices
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('storageType') is not None:
81
+ self.storage_type = m.get('storageType')
82
+ if m.get('cdsSizeInGB') is not None:
83
+ self.cds_size_in_gb = m.get('cdsSizeInGB')
84
+ if m.get('price') is not None:
85
+ self.price = m.get('price')
86
+ if m.get('specPrice') is not None:
87
+ self.spec_price = m.get('specPrice')
88
+ if m.get('unit') is not None:
89
+ self.unit = m.get('unit')
90
+ return self