baiducloud-python-sdk-pfs 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.
@@ -0,0 +1,174 @@
1
+ """
2
+ Request entity for DescPfsResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_pfs.models.subnet_detail import SubnetDetail
7
+ from baiducloud_python_sdk_pfs.models.tag import Tag
8
+
9
+
10
+ class DescPfsResponse(BceResponse):
11
+ """
12
+ DescPfsResponse
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ capacity=None,
18
+ create_time=None,
19
+ description=None,
20
+ endpoint=None,
21
+ instance_id=None,
22
+ instance_status=None,
23
+ instance_type=None,
24
+ name=None,
25
+ payment_timing=None,
26
+ subnet_model=None,
27
+ usage=None,
28
+ vpc_id=None,
29
+ tags=None,
30
+ ):
31
+ """
32
+ Initialize DescPfsResponse response.
33
+
34
+ :param capacity: PFS实例最大容量(单位GB)
35
+ :type capacity: int (optional)
36
+
37
+ :param create_time: PFS实例创建时间
38
+ :type create_time: str (optional)
39
+
40
+ :param description: PFS实例描述信息
41
+ :type description: str (optional)
42
+
43
+ :param endpoint: PFS连接地址,仅basic、plus、base、baseX类型实例有该参数
44
+ :type endpoint: str (optional)
45
+
46
+ :param instance_id: 实例ID
47
+ :type instance_id: str (optional)
48
+
49
+ :param instance_status: instance_status field
50
+ :type instance_status: str (optional)
51
+
52
+ :param instance_type: 实例类型
53
+ :type instance_type: str (optional)
54
+
55
+ :param name: 实例名称
56
+ :type name: str (optional)
57
+
58
+ :param payment_timing: 付款方式
59
+ :type payment_timing: str (optional)
60
+
61
+ :param subnet_model: subnet_model field
62
+ :type subnet_model: SubnetDetail (optional)
63
+
64
+ :param usage: PFS实例使用量(单位GB)
65
+ :type usage: int (optional)
66
+
67
+ :param vpc_id: PFS所在VPCID
68
+ :type vpc_id: str (optional)
69
+
70
+ :param tags: PFS绑定的标签
71
+ :type tags: List[Tag] (optional)
72
+ """
73
+ super().__init__()
74
+ self.capacity = capacity
75
+ self.create_time = create_time
76
+ self.description = description
77
+ self.endpoint = endpoint
78
+ self.instance_id = instance_id
79
+ self.instance_status = instance_status
80
+ self.instance_type = instance_type
81
+ self.name = name
82
+ self.payment_timing = payment_timing
83
+ self.subnet_model = subnet_model
84
+ self.usage = usage
85
+ self.vpc_id = vpc_id
86
+ self.tags = tags
87
+
88
+ def to_dict(self):
89
+ """
90
+ Convert the response instance to a dictionary representation.
91
+
92
+ Includes metadata from the parent BceResponse class.
93
+ Nested model objects are recursively converted to dictionaries.
94
+
95
+ :return: Dictionary representation of the response
96
+ :rtype: dict
97
+ """
98
+ _map = super().to_dict()
99
+ if _map is not None:
100
+ return _map
101
+ result = dict()
102
+ if self.metadata is not None:
103
+ result['metadata'] = dict(self.metadata)
104
+ if self.capacity is not None:
105
+ result['capacity'] = self.capacity
106
+ if self.create_time is not None:
107
+ result['createTime'] = self.create_time
108
+ if self.description is not None:
109
+ result['description'] = self.description
110
+ if self.endpoint is not None:
111
+ result['endpoint'] = self.endpoint
112
+ if self.instance_id is not None:
113
+ result['instanceId'] = self.instance_id
114
+ if self.instance_status is not None:
115
+ result['instanceStatus'] = self.instance_status
116
+ if self.instance_type is not None:
117
+ result['instanceType'] = self.instance_type
118
+ if self.name is not None:
119
+ result['name'] = self.name
120
+ if self.payment_timing is not None:
121
+ result['paymentTiming'] = self.payment_timing
122
+ if self.subnet_model is not None:
123
+ result['subnetModel'] = self.subnet_model.to_dict()
124
+ if self.usage is not None:
125
+ result['usage'] = self.usage
126
+ if self.vpc_id is not None:
127
+ result['vpcId'] = self.vpc_id
128
+ if self.tags is not None:
129
+ result['tags'] = [i.to_dict() for i in self.tags]
130
+ return result
131
+
132
+ def from_dict(self, m):
133
+ """
134
+ Populate the response instance from a dictionary.
135
+
136
+ Nested dictionaries are recursively converted to model objects.
137
+
138
+ :param m: Dictionary containing response data
139
+ :type m: dict
140
+
141
+ :return: Self reference for method chaining
142
+ :rtype: DescPfsResponse
143
+
144
+ :raises TypeError: If input is not a dictionary or field type mismatch
145
+ :raises ValueError: If nested model conversion fails
146
+ """
147
+ m = m or dict()
148
+ if m.get('capacity') is not None:
149
+ self.capacity = m.get('capacity')
150
+ if m.get('createTime') is not None:
151
+ self.create_time = m.get('createTime')
152
+ if m.get('description') is not None:
153
+ self.description = m.get('description')
154
+ if m.get('endpoint') is not None:
155
+ self.endpoint = m.get('endpoint')
156
+ if m.get('instanceId') is not None:
157
+ self.instance_id = m.get('instanceId')
158
+ if m.get('instanceStatus') is not None:
159
+ self.instance_status = m.get('instanceStatus')
160
+ if m.get('instanceType') is not None:
161
+ self.instance_type = m.get('instanceType')
162
+ if m.get('name') is not None:
163
+ self.name = m.get('name')
164
+ if m.get('paymentTiming') is not None:
165
+ self.payment_timing = m.get('paymentTiming')
166
+ if m.get('subnetModel') is not None:
167
+ self.subnet_model = SubnetDetail().from_dict(m.get('subnetModel'))
168
+ if m.get('usage') is not None:
169
+ self.usage = m.get('usage')
170
+ if m.get('vpcId') is not None:
171
+ self.vpc_id = m.get('vpcId')
172
+ if m.get('tags') is not None:
173
+ self.tags = [Tag().from_dict(i) for i in m.get('tags')]
174
+ return self
@@ -0,0 +1,162 @@
1
+ """
2
+ InstanceModel information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+ from baiducloud_python_sdk_pfs.models.subnet_detail import SubnetDetail
8
+
9
+
10
+ class InstanceModel(AbstractModel):
11
+ """
12
+ InstanceModel
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ capacity=None,
18
+ create_time=None,
19
+ description=None,
20
+ endpoint=None,
21
+ instance_id=None,
22
+ instance_status=None,
23
+ instance_type=None,
24
+ name=None,
25
+ payment_timing=None,
26
+ subnet_model=None,
27
+ usage=None,
28
+ vpc_id=None,
29
+ ):
30
+ """
31
+ Initialize InstanceModel instance.
32
+
33
+ :param capacity: PFS实例最大容量(单位GB)
34
+ :type capacity: int (optional)
35
+
36
+ :param create_time: PFS实例创建时间
37
+ :type create_time: str (optional)
38
+
39
+ :param description: PFS实例描述信息
40
+ :type description: str (optional)
41
+
42
+ :param endpoint: PFS连接地址,仅basic、plus、base、baseX类型实例有该参数
43
+ :type endpoint: str (optional)
44
+
45
+ :param instance_id: 实例ID
46
+ :type instance_id: str (optional)
47
+
48
+ :param instance_status: instance_status attribute
49
+ :type instance_status: str (optional)
50
+
51
+ :param instance_type: 实例类型
52
+ :type instance_type: str (optional)
53
+
54
+ :param name: 实例名称
55
+ :type name: str (optional)
56
+
57
+ :param payment_timing: 付款方式
58
+ :type payment_timing: str (optional)
59
+
60
+ :param subnet_model: subnet_model attribute
61
+ :type subnet_model: SubnetDetail (optional)
62
+
63
+ :param usage: PFS实例使用量(单位GB)
64
+ :type usage: int (optional)
65
+
66
+ :param vpc_id: PFS所在VPCID
67
+ :type vpc_id: str (optional)
68
+ """
69
+ super().__init__()
70
+ self.capacity = capacity
71
+ self.create_time = create_time
72
+ self.description = description
73
+ self.endpoint = endpoint
74
+ self.instance_id = instance_id
75
+ self.instance_status = instance_status
76
+ self.instance_type = instance_type
77
+ self.name = name
78
+ self.payment_timing = payment_timing
79
+ self.subnet_model = subnet_model
80
+ self.usage = usage
81
+ self.vpc_id = vpc_id
82
+
83
+ def to_dict(self):
84
+ """
85
+ Convert the model instance to a dictionary representation.
86
+
87
+ Nested model objects are recursively converted to dictionaries.
88
+
89
+ :return: Dictionary representation of the model
90
+ :rtype: dict
91
+ """
92
+ _map = super().to_dict()
93
+ if _map is not None:
94
+ return _map
95
+ result = dict()
96
+ if self.capacity is not None:
97
+ result['capacity'] = self.capacity
98
+ if self.create_time is not None:
99
+ result['createTime'] = self.create_time
100
+ if self.description is not None:
101
+ result['description'] = self.description
102
+ if self.endpoint is not None:
103
+ result['endpoint'] = self.endpoint
104
+ if self.instance_id is not None:
105
+ result['instanceId'] = self.instance_id
106
+ if self.instance_status is not None:
107
+ result['instanceStatus'] = self.instance_status
108
+ if self.instance_type is not None:
109
+ result['instanceType'] = self.instance_type
110
+ if self.name is not None:
111
+ result['name'] = self.name
112
+ if self.payment_timing is not None:
113
+ result['paymentTiming'] = self.payment_timing
114
+ if self.subnet_model is not None:
115
+ result['subnetModel'] = self.subnet_model.to_dict()
116
+ if self.usage is not None:
117
+ result['usage'] = self.usage
118
+ if self.vpc_id is not None:
119
+ result['vpcId'] = self.vpc_id
120
+ return result
121
+
122
+ def from_dict(self, m):
123
+ """
124
+ Populate the model instance from a dictionary.
125
+
126
+ Nested dictionaries are recursively converted to model objects.
127
+
128
+ :param m: Dictionary containing model data
129
+ :type m: dict
130
+
131
+ :return: Self reference for method chaining
132
+ :rtype: InstanceModel
133
+
134
+ :raises TypeError: If input is not a dictionary type
135
+ :raises ValueError: If nested model conversion fails
136
+ """
137
+ m = m or dict()
138
+ if m.get('capacity') is not None:
139
+ self.capacity = m.get('capacity')
140
+ if m.get('createTime') is not None:
141
+ self.create_time = m.get('createTime')
142
+ if m.get('description') is not None:
143
+ self.description = m.get('description')
144
+ if m.get('endpoint') is not None:
145
+ self.endpoint = m.get('endpoint')
146
+ if m.get('instanceId') is not None:
147
+ self.instance_id = m.get('instanceId')
148
+ if m.get('instanceStatus') is not None:
149
+ self.instance_status = m.get('instanceStatus')
150
+ if m.get('instanceType') is not None:
151
+ self.instance_type = m.get('instanceType')
152
+ if m.get('name') is not None:
153
+ self.name = m.get('name')
154
+ if m.get('paymentTiming') is not None:
155
+ self.payment_timing = m.get('paymentTiming')
156
+ if m.get('subnetModel') is not None:
157
+ self.subnet_model = SubnetDetail().from_dict(m.get('subnetModel'))
158
+ if m.get('usage') is not None:
159
+ self.usage = m.get('usage')
160
+ if m.get('vpcId') is not None:
161
+ self.vpc_id = m.get('vpcId')
162
+ return self
@@ -0,0 +1,70 @@
1
+ """
2
+ Request entity for ListPfsRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ListPfsRequest(AbstractModel):
9
+ """
10
+ Request entity for ListPfsRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(self, max_keys=None, marker=None, filter_tag=None):
16
+ """
17
+ Initialize ListPfsRequest request entity.
18
+
19
+ :param max_keys: max_keys parameter
20
+ :type max_keys: int (optional)
21
+
22
+ :param marker: marker parameter
23
+ :type marker: str (optional)
24
+
25
+ :param filter_tag: filter_tag parameter
26
+ :type filter_tag: str (optional)
27
+ """
28
+ super().__init__()
29
+ self.max_keys = max_keys
30
+ self.marker = marker
31
+ self.filter_tag = filter_tag
32
+
33
+ def to_dict(self):
34
+ """
35
+ Convert the request entity to a dictionary representation.
36
+
37
+ Nested model objects are recursively converted to dictionaries.
38
+
39
+ :return: Dictionary representation of the request
40
+ :rtype: dict
41
+ """
42
+ _map = super().to_dict()
43
+ if _map is not None:
44
+ return _map
45
+ result = dict()
46
+ return result
47
+
48
+ def from_dict(self, m):
49
+ """
50
+ Populate the request entity from a dictionary.
51
+
52
+ Nested dictionaries are recursively converted to model objects.
53
+
54
+ :param m: Dictionary containing request data
55
+ :type m: dict
56
+
57
+ :return: Self reference for method chaining
58
+ :rtype: ListPfsRequest
59
+
60
+ :raises TypeError: If input is not a dictionary or field type mismatch
61
+ :raises ValueError: If nested model conversion fails
62
+ """
63
+ m = m or dict()
64
+ if m.get('maxKeys') is not None:
65
+ self.max_keys = m.get('maxKeys')
66
+ if m.get('marker') is not None:
67
+ self.marker = m.get('marker')
68
+ if m.get('filterTag') is not None:
69
+ self.filter_tag = m.get('filterTag')
70
+ return self
@@ -0,0 +1,94 @@
1
+ """
2
+ Request entity for ListPfsResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_pfs.models.instance_model import InstanceModel
7
+
8
+
9
+ class ListPfsResponse(BceResponse):
10
+ """
11
+ ListPfsResponse
12
+ """
13
+
14
+ def __init__(self, is_truncated=None, marker=None, max_keys=None, next_marker=None, result=None):
15
+ """
16
+ Initialize ListPfsResponse response.
17
+
18
+ :param is_truncated: True表示数据未全部返回,False表示数据全部返回
19
+ :type is_truncated: bool (optional)
20
+
21
+ :param marker: marker field
22
+ :type marker: str (optional)
23
+
24
+ :param max_keys: 请求返回的result个数
25
+ :type max_keys: int (optional)
26
+
27
+ :param next_marker: 下次请求需要传递的marker值
28
+ :type next_marker: str (optional)
29
+
30
+ :param result: PFS实例详细信息
31
+ :type result: List[InstanceModel] (optional)
32
+ """
33
+ super().__init__()
34
+ self.is_truncated = is_truncated
35
+ self.marker = marker
36
+ self.max_keys = max_keys
37
+ self.next_marker = next_marker
38
+ self.result = result
39
+
40
+ def to_dict(self):
41
+ """
42
+ Convert the response instance to a dictionary representation.
43
+
44
+ Includes metadata from the parent BceResponse class.
45
+ Nested model objects are recursively converted to dictionaries.
46
+
47
+ :return: Dictionary representation of the response
48
+ :rtype: dict
49
+ """
50
+ _map = super().to_dict()
51
+ if _map is not None:
52
+ return _map
53
+ result = dict()
54
+ if self.metadata is not None:
55
+ result['metadata'] = dict(self.metadata)
56
+ if self.is_truncated is not None:
57
+ result['isTruncated'] = self.is_truncated
58
+ if self.marker is not None:
59
+ result['marker'] = self.marker
60
+ if self.max_keys is not None:
61
+ result['maxKeys'] = self.max_keys
62
+ if self.next_marker is not None:
63
+ result['nextMarker'] = self.next_marker
64
+ if self.result is not None:
65
+ result['result'] = [i.to_dict() for i in self.result]
66
+ return result
67
+
68
+ def from_dict(self, m):
69
+ """
70
+ Populate the response instance from a dictionary.
71
+
72
+ Nested dictionaries are recursively converted to model objects.
73
+
74
+ :param m: Dictionary containing response data
75
+ :type m: dict
76
+
77
+ :return: Self reference for method chaining
78
+ :rtype: ListPfsResponse
79
+
80
+ :raises TypeError: If input is not a dictionary or field type mismatch
81
+ :raises ValueError: If nested model conversion fails
82
+ """
83
+ m = m or dict()
84
+ if m.get('isTruncated') is not None:
85
+ self.is_truncated = m.get('isTruncated')
86
+ if m.get('marker') is not None:
87
+ self.marker = m.get('marker')
88
+ if m.get('maxKeys') is not None:
89
+ self.max_keys = m.get('maxKeys')
90
+ if m.get('nextMarker') is not None:
91
+ self.next_marker = m.get('nextMarker')
92
+ if m.get('result') is not None:
93
+ self.result = [InstanceModel().from_dict(i) for i in m.get('result')]
94
+ return self
@@ -0,0 +1,82 @@
1
+ """
2
+ SubnetDetail information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class SubnetDetail(AbstractModel):
9
+ """
10
+ SubnetDetail
11
+ """
12
+
13
+ def __init__(self, cidr=None, physical_zone=None, subnet_id=None, zone_name=None):
14
+ """
15
+ Initialize SubnetDetail instance.
16
+
17
+ :param cidr: 子网掩码
18
+ :type cidr: str (optional)
19
+
20
+ :param physical_zone: PFS实例所在物理Zone
21
+ :type physical_zone: str (optional)
22
+
23
+ :param subnet_id: 子网ID
24
+ :type subnet_id: str (optional)
25
+
26
+ :param zone_name: PFS实例所在逻辑Zone
27
+ :type zone_name: str (optional)
28
+ """
29
+ super().__init__()
30
+ self.cidr = cidr
31
+ self.physical_zone = physical_zone
32
+ self.subnet_id = subnet_id
33
+ self.zone_name = zone_name
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.cidr is not None:
49
+ result['cidr'] = self.cidr
50
+ if self.physical_zone is not None:
51
+ result['physicalZone'] = self.physical_zone
52
+ if self.subnet_id is not None:
53
+ result['subnetId'] = self.subnet_id
54
+ if self.zone_name is not None:
55
+ result['zoneName'] = self.zone_name
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: SubnetDetail
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('cidr') is not None:
75
+ self.cidr = m.get('cidr')
76
+ if m.get('physicalZone') is not None:
77
+ self.physical_zone = m.get('physicalZone')
78
+ if m.get('subnetId') is not None:
79
+ self.subnet_id = m.get('subnetId')
80
+ if m.get('zoneName') is not None:
81
+ self.zone_name = m.get('zoneName')
82
+ return self
@@ -0,0 +1,66 @@
1
+ """
2
+ Tag information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class Tag(AbstractModel):
9
+ """
10
+ Tag
11
+ """
12
+
13
+ def __init__(self, tag_key=None, tag_value=None):
14
+ """
15
+ Initialize Tag instance.
16
+
17
+ :param tag_key: 标签的键,可包含大小写字母、数字、中文以及-_ /.特殊字符,长度1–65
18
+ :type tag_key: str (optional)
19
+
20
+ :param tag_value: 标签的值,可包含大小写字母、数字、中文以及-_ /.特殊字符,长度0–65
21
+ :type tag_value: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.tag_key = tag_key
25
+ self.tag_value = tag_value
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the model instance to a dictionary representation.
30
+
31
+ Nested model objects are recursively converted to dictionaries.
32
+
33
+ :return: Dictionary representation of the model
34
+ :rtype: dict
35
+ """
36
+ _map = super().to_dict()
37
+ if _map is not None:
38
+ return _map
39
+ result = dict()
40
+ if self.tag_key is not None:
41
+ result['tagKey'] = self.tag_key
42
+ if self.tag_value is not None:
43
+ result['tagValue'] = self.tag_value
44
+ return result
45
+
46
+ def from_dict(self, m):
47
+ """
48
+ Populate the model instance from a dictionary.
49
+
50
+ Nested dictionaries are recursively converted to model objects.
51
+
52
+ :param m: Dictionary containing model data
53
+ :type m: dict
54
+
55
+ :return: Self reference for method chaining
56
+ :rtype: Tag
57
+
58
+ :raises TypeError: If input is not a dictionary type
59
+ :raises ValueError: If nested model conversion fails
60
+ """
61
+ m = m or dict()
62
+ if m.get('tagKey') is not None:
63
+ self.tag_key = m.get('tagKey')
64
+ if m.get('tagValue') is not None:
65
+ self.tag_value = m.get('tagValue')
66
+ return self