baiducloud-python-sdk-vpc 0.0.3__py2.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 (45) hide show
  1. baiducloud_python_sdk_vpc/__init__.py +1 -0
  2. baiducloud_python_sdk_vpc/api/__init__.py +0 -0
  3. baiducloud_python_sdk_vpc/api/vpc_client.py +225 -0
  4. baiducloud_python_sdk_vpc/models/__init__.py +0 -0
  5. baiducloud_python_sdk_vpc/models/close_vpc_relay_request.py +24 -0
  6. baiducloud_python_sdk_vpc/models/create_a_reserved_network_segment_request.py +41 -0
  7. baiducloud_python_sdk_vpc/models/create_a_reserved_network_segment_response.py +27 -0
  8. baiducloud_python_sdk_vpc/models/create_subnet_request.py +70 -0
  9. baiducloud_python_sdk_vpc/models/create_subnet_response.py +27 -0
  10. baiducloud_python_sdk_vpc/models/create_vpc_request.py +50 -0
  11. baiducloud_python_sdk_vpc/models/create_vpc_response.py +27 -0
  12. baiducloud_python_sdk_vpc/models/delete_reserved_network_segment_request.py +24 -0
  13. baiducloud_python_sdk_vpc/models/delete_subnet_request.py +24 -0
  14. baiducloud_python_sdk_vpc/models/delete_vpc_request.py +24 -0
  15. baiducloud_python_sdk_vpc/models/enable_vpc_relay_request.py +24 -0
  16. baiducloud_python_sdk_vpc/models/ip_reserve.py +57 -0
  17. baiducloud_python_sdk_vpc/models/query_specified_subnet_request.py +21 -0
  18. baiducloud_python_sdk_vpc/models/query_specified_subnet_response.py +28 -0
  19. baiducloud_python_sdk_vpc/models/query_specified_vpc_request.py +21 -0
  20. baiducloud_python_sdk_vpc/models/query_specified_vpc_response.py +28 -0
  21. baiducloud_python_sdk_vpc/models/query_subnet_list_request.py +36 -0
  22. baiducloud_python_sdk_vpc/models/query_subnet_list_response.py +51 -0
  23. baiducloud_python_sdk_vpc/models/query_the_ip_addresses_occupied_by_products_within_vpc_request.py +33 -0
  24. baiducloud_python_sdk_vpc/models/query_the_ip_addresses_occupied_by_products_within_vpc_response.py +46 -0
  25. baiducloud_python_sdk_vpc/models/query_the_reserved_network_segment_list_request.py +27 -0
  26. baiducloud_python_sdk_vpc/models/query_the_reserved_network_segment_list_response.py +51 -0
  27. baiducloud_python_sdk_vpc/models/query_vpc_intranet_ip_request.py +27 -0
  28. baiducloud_python_sdk_vpc/models/query_vpc_intranet_ip_response.py +31 -0
  29. baiducloud_python_sdk_vpc/models/query_vpc_list_request.py +30 -0
  30. baiducloud_python_sdk_vpc/models/query_vpc_list_response.py +51 -0
  31. baiducloud_python_sdk_vpc/models/resource_ip.py +32 -0
  32. baiducloud_python_sdk_vpc/models/show_vpc_model.py +82 -0
  33. baiducloud_python_sdk_vpc/models/subnet.py +87 -0
  34. baiducloud_python_sdk_vpc/models/subnet_detail.py +87 -0
  35. baiducloud_python_sdk_vpc/models/tag_model.py +32 -0
  36. baiducloud_python_sdk_vpc/models/update_subnet_request.py +39 -0
  37. baiducloud_python_sdk_vpc/models/update_vpc_request.py +44 -0
  38. baiducloud_python_sdk_vpc/models/vpc.py +72 -0
  39. baiducloud_python_sdk_vpc/models/vpc_private_ip_address.py +42 -0
  40. baiducloud_python_sdk_vpc/setup.py +70 -0
  41. baiducloud_python_sdk_vpc-0.0.3.dist-info/LICENSE +177 -0
  42. baiducloud_python_sdk_vpc-0.0.3.dist-info/METADATA +74 -0
  43. baiducloud_python_sdk_vpc-0.0.3.dist-info/RECORD +45 -0
  44. baiducloud_python_sdk_vpc-0.0.3.dist-info/WHEEL +6 -0
  45. baiducloud_python_sdk_vpc-0.0.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ SDK_VERSION = b'0.0.3'
File without changes
@@ -0,0 +1,225 @@
1
+ import copy
2
+ import logging
3
+ import uuid
4
+
5
+ from baiducloud_python_sdk_core import utils, bce_base_client
6
+ from baiducloud_python_sdk_core.auth import bce_v1_signer
7
+ from baiducloud_python_sdk_core.bce_base_client import BceBaseClient
8
+ from baiducloud_python_sdk_core.http import bce_http_client
9
+ from baiducloud_python_sdk_core.http import handler
10
+ from baiducloud_python_sdk_core.http import http_methods
11
+ from baiducloud_python_sdk_vpc.models.create_a_reserved_network_segment_response import CreateAReservedNetworkSegmentResponse
12
+ from baiducloud_python_sdk_vpc.models.create_subnet_response import CreateSubnetResponse
13
+ from baiducloud_python_sdk_vpc.models.create_vpc_response import CreateVpcResponse
14
+ from baiducloud_python_sdk_vpc.models.query_specified_subnet_response import QuerySpecifiedSubnetResponse
15
+ from baiducloud_python_sdk_vpc.models.query_specified_vpc_response import QuerySpecifiedVpcResponse
16
+ from baiducloud_python_sdk_vpc.models.query_subnet_list_response import QuerySubnetListResponse
17
+ from baiducloud_python_sdk_vpc.models.query_the_ip_addresses_occupied_by_products_within_vpc_response import QueryTheIpAddressesOccupiedByProductsWithinVpcResponse
18
+ from baiducloud_python_sdk_vpc.models.query_the_reserved_network_segment_list_response import QueryTheReservedNetworkSegmentListResponse
19
+ from baiducloud_python_sdk_vpc.models.query_vpc_intranet_ip_response import QueryVpcIntranetIpResponse
20
+ from baiducloud_python_sdk_vpc.models.query_vpc_list_response import QueryVpcListResponse
21
+
22
+ _logger = logging.getLogger(__name__)
23
+
24
+
25
+ class VpcClient(BceBaseClient):
26
+
27
+ VERSION_V1 = b'/v1'
28
+
29
+ CONSTANT_VPC = b'vpc'
30
+
31
+ CONSTANT_SHUTDOWN_RELAY = b'shutdownRelay'
32
+
33
+ CONSTANT_RESOURCE_IP = b'resourceIp'
34
+
35
+ CONSTANT_SUBNET = b'subnet'
36
+
37
+ CONSTANT_IPRESERVE = b'ipreserve'
38
+
39
+ CONSTANT_OPEN_RELAY = b'openRelay'
40
+
41
+ CONSTANT_PRIVATE_IP_ADDRESS_INFO = b'privateIpAddressInfo'
42
+
43
+ def __init__(self, config=None):
44
+ bce_base_client.BceBaseClient.__init__(self, config)
45
+
46
+ def close_vpc_relay(self, request, config=None):
47
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, VpcClient.CONSTANT_SHUTDOWN_RELAY, request.vpc_id)
48
+ params = {
49
+ 'clientToken' : request.client_token,
50
+ }
51
+ return self._send_request(http_methods.PUT, path=path
52
+ , params=params, config=config)
53
+
54
+ def create_a_reserved_network_segment(self, request, config=None):
55
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET, VpcClient.CONSTANT_IPRESERVE)
56
+ params = {
57
+ 'clientToken' : request.client_token,
58
+ }
59
+ return self._send_request(http_methods.POST, path=path
60
+ , body=request.to_json_string(), params=params, config=config, model=CreateAReservedNetworkSegmentResponse)
61
+
62
+ def create_subnet(self, request, config=None):
63
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET)
64
+ params = {
65
+ 'clientToken' : request.client_token,
66
+ }
67
+ return self._send_request(http_methods.POST, path=path
68
+ , body=request.to_json_string(), params=params, config=config, model=CreateSubnetResponse)
69
+
70
+ def create_vpc(self, request, config=None):
71
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC)
72
+ params = {
73
+ 'clientToken' : request.client_token,
74
+ }
75
+ return self._send_request(http_methods.POST, path=path
76
+ , body=request.to_json_string(), params=params, config=config, model=CreateVpcResponse)
77
+
78
+ def delete_reserved_network_segment(self, request, config=None):
79
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET, VpcClient.CONSTANT_IPRESERVE, request.ip_reserve_id)
80
+ params = {
81
+ 'clientToken' : request.client_token,
82
+ }
83
+ return self._send_request(http_methods.DELETE, path=path
84
+ , params=params, config=config)
85
+
86
+ def delete_subnet(self, request, config=None):
87
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET, request.subnet_id)
88
+ params = {
89
+ 'clientToken' : request.client_token,
90
+ }
91
+ return self._send_request(http_methods.DELETE, path=path
92
+ , params=params, config=config)
93
+
94
+ def delete_vpc(self, request, config=None):
95
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, request.vpc_id)
96
+ params = {
97
+ 'clientToken' : request.client_token,
98
+ }
99
+ return self._send_request(http_methods.DELETE, path=path
100
+ , params=params, config=config)
101
+
102
+ def enable_vpc_relay(self, request, config=None):
103
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, VpcClient.CONSTANT_OPEN_RELAY, request.vpc_id)
104
+ params = {
105
+ 'clientToken' : request.client_token,
106
+ }
107
+ return self._send_request(http_methods.PUT, path=path
108
+ , params=params, config=config)
109
+
110
+ def query_specified_subnet(self, request, config=None):
111
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET, request.subnet_id)
112
+ return self._send_request(http_methods.GET, path=path
113
+ , config=config, model=QuerySpecifiedSubnetResponse)
114
+
115
+ def query_specified_vpc(self, request, config=None):
116
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, request.vpc_id)
117
+ return self._send_request(http_methods.GET, path=path
118
+ , config=config, model=QuerySpecifiedVpcResponse)
119
+
120
+ def query_subnet_list(self, request, config=None):
121
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET)
122
+ params = {
123
+ 'marker' : request.marker,
124
+ 'maxKeys' : request.max_keys,
125
+ 'vpcId' : request.vpc_id,
126
+ 'zoneName' : request.zone_name,
127
+ 'subnetType' : request.subnet_type,
128
+ 'subnetIds' : request.subnet_ids,
129
+ }
130
+ return self._send_request(http_methods.GET, path=path
131
+ , params=params, config=config, model=QuerySubnetListResponse)
132
+
133
+ def query_the_ip_addresses_occupied_by_products_within_vpc(self, request, config=None):
134
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, VpcClient.CONSTANT_RESOURCE_IP)
135
+ params = {
136
+ 'vpcId' : request.vpc_id,
137
+ 'subnetId' : request.subnet_id,
138
+ 'resourceType' : request.resource_type,
139
+ 'pageNo' : request.page_no,
140
+ 'pageSize' : request.page_size,
141
+ }
142
+ return self._send_request(http_methods.GET, path=path
143
+ , params=params, config=config, model=QueryTheIpAddressesOccupiedByProductsWithinVpcResponse)
144
+
145
+ def query_the_reserved_network_segment_list(self, request, config=None):
146
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET, VpcClient.CONSTANT_IPRESERVE)
147
+ params = {
148
+ 'subnetId' : request.subnet_id,
149
+ 'marker' : request.marker,
150
+ 'maxKeys' : request.max_keys,
151
+ }
152
+ return self._send_request(http_methods.GET, path=path
153
+ , params=params, config=config, model=QueryTheReservedNetworkSegmentListResponse)
154
+
155
+ def query_vpc_intranet_ip(self, request, config=None):
156
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, request.vpc_id, VpcClient.CONSTANT_PRIVATE_IP_ADDRESS_INFO)
157
+ params = {
158
+ 'privateIpAddresses' : ','.join(request.private_ip_addresses) if request.private_ip_addresses else None,
159
+ 'privateIpRange' : request.private_ip_range,
160
+ }
161
+ return self._send_request(http_methods.GET, path=path
162
+ , params=params, config=config, model=QueryVpcIntranetIpResponse)
163
+
164
+ def query_vpc_list(self, request, config=None):
165
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC)
166
+ params = {
167
+ 'marker' : request.marker,
168
+ 'maxKeys' : request.max_keys,
169
+ 'isDefault' : request.is_default,
170
+ 'vpcIds' : request.vpc_ids,
171
+ }
172
+ return self._send_request(http_methods.GET, path=path
173
+ , params=params, config=config, model=QueryVpcListResponse)
174
+
175
+ def update_subnet(self, request, config=None):
176
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_SUBNET, request.subnet_id)
177
+ params = {
178
+ 'modifyAttribute' : None,
179
+ 'clientToken' : request.client_token,
180
+ }
181
+ return self._send_request(http_methods.PUT, path=path
182
+ , body=request.to_json_string(), params=params, config=config)
183
+
184
+ def update_vpc(self, request, config=None):
185
+ path = utils.append_uri(VpcClient.VERSION_V1, VpcClient.CONSTANT_VPC, request.vpc_id)
186
+ params = {
187
+ 'modifyAttribute' : None,
188
+ 'clientToken' : request.client_token,
189
+ }
190
+ return self._send_request(http_methods.PUT, path=path
191
+ , body=request.to_json_string(), params=params, config=config)
192
+
193
+
194
+
195
+ @staticmethod
196
+ def _generate_default_client_token():
197
+ """
198
+ default client token by uuid1
199
+ """
200
+ return uuid.uuid1()
201
+
202
+ def _merge_config(self, config=None):
203
+ """
204
+ :param config:
205
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
206
+ """
207
+ if config is None:
208
+ return self.config
209
+ else:
210
+ new_config = copy.copy(self.config)
211
+ new_config.merge_non_none_values(config)
212
+ return new_config
213
+
214
+ def _send_request(self, http_method, path,
215
+ body=None, headers=None, params=None,
216
+ config=None, body_parser=None, model=None):
217
+ config = self._merge_config(config)
218
+ if body_parser is None:
219
+ body_parser = handler.parse_json
220
+ if headers is None:
221
+ headers = {b'Accept': b'*/*', b'Content-Type':
222
+ b'application/json;charset=utf-8'}
223
+ return bce_http_client.send_request(
224
+ config, bce_v1_signer.sign, [handler.parse_error, body_parser],
225
+ http_method, path, body, headers, params, model=model)
File without changes
@@ -0,0 +1,24 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+
3
+ class CloseVpcRelayRequest(AbstractModel):
4
+
5
+ def __init__(self, vpc_id, client_token=None):
6
+ super().__init__()
7
+ self.vpc_id = vpc_id
8
+ self.client_token = client_token
9
+
10
+ def to_dict(self):
11
+ _map = super().to_dict()
12
+ if _map is not None:
13
+ return _map
14
+ result = dict()
15
+ return result
16
+
17
+
18
+ def from_dict(self, m):
19
+ m = m or dict()
20
+ if m.get('vpcId') is not None:
21
+ self.vpc_id = m.get('vpcId')
22
+ if m.get('clientToken') is not None:
23
+ self.client_token = m.get('clientToken')
24
+ return self
@@ -0,0 +1,41 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+
3
+ class CreateAReservedNetworkSegmentRequest(AbstractModel):
4
+
5
+ def __init__(self, subnet_id, ip_cidr, ip_version, client_token=None, description=None):
6
+ super().__init__()
7
+ self.client_token = client_token
8
+ self.subnet_id = subnet_id
9
+ self.ip_cidr = ip_cidr
10
+ self.ip_version = ip_version
11
+ self.description = description
12
+
13
+ def to_dict(self):
14
+ _map = super().to_dict()
15
+ if _map is not None:
16
+ return _map
17
+ result = dict()
18
+ if self.subnet_id is not None:
19
+ result['subnetId'] = self.subnet_id
20
+ if self.ip_cidr is not None:
21
+ result['ipCidr'] = self.ip_cidr
22
+ if self.ip_version is not None:
23
+ result['ipVersion'] = self.ip_version
24
+ if self.description is not None:
25
+ result['description'] = self.description
26
+ return result
27
+
28
+
29
+ def from_dict(self, m):
30
+ m = m or dict()
31
+ if m.get('clientToken') is not None:
32
+ self.client_token = m.get('clientToken')
33
+ if m.get('subnetId') is not None:
34
+ self.subnet_id = m.get('subnetId')
35
+ if m.get('ipCidr') is not None:
36
+ self.ip_cidr = m.get('ipCidr')
37
+ if m.get('ipVersion') is not None:
38
+ self.ip_version = m.get('ipVersion')
39
+ if m.get('description') is not None:
40
+ self.description = m.get('description')
41
+ return self
@@ -0,0 +1,27 @@
1
+ from baiducloud_python_sdk_core.bce_response import BceResponse
2
+
3
+ class CreateAReservedNetworkSegmentResponse(BceResponse):
4
+ """
5
+ CreateAReservedNetworkSegmentResponse
6
+ """
7
+ def __init__(self, ip_reserve_id=None):
8
+ super().__init__()
9
+ self.ip_reserve_id = ip_reserve_id
10
+
11
+ def to_dict(self):
12
+ _map = super().to_dict()
13
+ if _map is not None:
14
+ return _map
15
+ result = dict()
16
+ if self.metadata is not None:
17
+ result['metadata'] = self.metadata
18
+ if self.ip_reserve_id is not None:
19
+ result['ipReserveId'] = self.ip_reserve_id
20
+ return result
21
+
22
+
23
+ def from_dict(self, m):
24
+ m = m or dict()
25
+ if m.get('ipReserveId') is not None:
26
+ self.ip_reserve_id = m.get('ipReserveId')
27
+ return self
@@ -0,0 +1,70 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+ from baiducloud_python_sdk_vpc.models.tag_model import TagModel
3
+
4
+ class CreateSubnetRequest(AbstractModel):
5
+
6
+ def __init__(self, name, zone_name, cidr, vpc_id, client_token=None, enable_ipv6=None, vpc_secondary_cidr=None, subnet_type=None, description=None, tags=None):
7
+ super().__init__()
8
+ self.client_token = client_token
9
+ self.name = name
10
+ self.enable_ipv6 = enable_ipv6
11
+ self.zone_name = zone_name
12
+ self.cidr = cidr
13
+ self.vpc_id = vpc_id
14
+ self.vpc_secondary_cidr = vpc_secondary_cidr
15
+ self.subnet_type = subnet_type
16
+ self.description = description
17
+ self.tags = tags
18
+
19
+ def to_dict(self):
20
+ _map = super().to_dict()
21
+ if _map is not None:
22
+ return _map
23
+ result = dict()
24
+ if self.name is not None:
25
+ result['name'] = self.name
26
+ if self.enable_ipv6 is not None:
27
+ result['enableIpv6'] = self.enable_ipv6
28
+ if self.zone_name is not None:
29
+ result['zoneName'] = self.zone_name
30
+ if self.cidr is not None:
31
+ result['cidr'] = self.cidr
32
+ if self.vpc_id is not None:
33
+ result['vpcId'] = self.vpc_id
34
+ if self.vpc_secondary_cidr is not None:
35
+ result['vpcSecondaryCidr'] = self.vpc_secondary_cidr
36
+ if self.subnet_type is not None:
37
+ result['subnetType'] = self.subnet_type
38
+ if self.description is not None:
39
+ result['description'] = self.description
40
+ if self.tags is not None:
41
+ result['tags'] = [i.to_dict() for i in self.tags]
42
+ return result
43
+
44
+
45
+ def from_dict(self, m):
46
+ m = m or dict()
47
+ if m.get('clientToken') is not None:
48
+ self.client_token = m.get('clientToken')
49
+ if m.get('name') is not None:
50
+ self.name = m.get('name')
51
+ if m.get('enableIpv6') is not None:
52
+ self.enable_ipv6 = m.get('enableIpv6')
53
+ if m.get('zoneName') is not None:
54
+ self.zone_name = m.get('zoneName')
55
+ if m.get('cidr') is not None:
56
+ self.cidr = m.get('cidr')
57
+ if m.get('vpcId') is not None:
58
+ self.vpc_id = m.get('vpcId')
59
+ if m.get('vpcSecondaryCidr') is not None:
60
+ self.vpc_secondary_cidr = m.get('vpcSecondaryCidr')
61
+ if m.get('subnetType') is not None:
62
+ self.subnet_type = m.get('subnetType')
63
+ if m.get('description') is not None:
64
+ self.description = m.get('description')
65
+ if m.get('tags') is not None:
66
+ self.tags = [
67
+ TagModel().from_dict(i)
68
+ for i in m.get('tags')
69
+ ]
70
+ return self
@@ -0,0 +1,27 @@
1
+ from baiducloud_python_sdk_core.bce_response import BceResponse
2
+
3
+ class CreateSubnetResponse(BceResponse):
4
+ """
5
+ CreateSubnetResponse
6
+ """
7
+ def __init__(self, subnet_id=None):
8
+ super().__init__()
9
+ self.subnet_id = subnet_id
10
+
11
+ def to_dict(self):
12
+ _map = super().to_dict()
13
+ if _map is not None:
14
+ return _map
15
+ result = dict()
16
+ if self.metadata is not None:
17
+ result['metadata'] = self.metadata
18
+ if self.subnet_id is not None:
19
+ result['subnetId'] = self.subnet_id
20
+ return result
21
+
22
+
23
+ def from_dict(self, m):
24
+ m = m or dict()
25
+ if m.get('subnetId') is not None:
26
+ self.subnet_id = m.get('subnetId')
27
+ return self
@@ -0,0 +1,50 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+ from baiducloud_python_sdk_vpc.models.tag_model import TagModel
3
+
4
+ class CreateVpcRequest(AbstractModel):
5
+
6
+ def __init__(self, name, cidr, client_token=None, description=None, enable_ipv6=None, tags=None):
7
+ super().__init__()
8
+ self.client_token = client_token
9
+ self.name = name
10
+ self.description = description
11
+ self.cidr = cidr
12
+ self.enable_ipv6 = enable_ipv6
13
+ self.tags = tags
14
+
15
+ def to_dict(self):
16
+ _map = super().to_dict()
17
+ if _map is not None:
18
+ return _map
19
+ result = dict()
20
+ if self.name is not None:
21
+ result['name'] = self.name
22
+ if self.description is not None:
23
+ result['description'] = self.description
24
+ if self.cidr is not None:
25
+ result['cidr'] = self.cidr
26
+ if self.enable_ipv6 is not None:
27
+ result['enableIpv6'] = self.enable_ipv6
28
+ if self.tags is not None:
29
+ result['tags'] = [i.to_dict() for i in self.tags]
30
+ return result
31
+
32
+
33
+ def from_dict(self, m):
34
+ m = m or dict()
35
+ if m.get('clientToken') is not None:
36
+ self.client_token = m.get('clientToken')
37
+ if m.get('name') is not None:
38
+ self.name = m.get('name')
39
+ if m.get('description') is not None:
40
+ self.description = m.get('description')
41
+ if m.get('cidr') is not None:
42
+ self.cidr = m.get('cidr')
43
+ if m.get('enableIpv6') is not None:
44
+ self.enable_ipv6 = m.get('enableIpv6')
45
+ if m.get('tags') is not None:
46
+ self.tags = [
47
+ TagModel().from_dict(i)
48
+ for i in m.get('tags')
49
+ ]
50
+ return self
@@ -0,0 +1,27 @@
1
+ from baiducloud_python_sdk_core.bce_response import BceResponse
2
+
3
+ class CreateVpcResponse(BceResponse):
4
+ """
5
+ CreateVpcResponse
6
+ """
7
+ def __init__(self, vpc_id=None):
8
+ super().__init__()
9
+ self.vpc_id = vpc_id
10
+
11
+ def to_dict(self):
12
+ _map = super().to_dict()
13
+ if _map is not None:
14
+ return _map
15
+ result = dict()
16
+ if self.metadata is not None:
17
+ result['metadata'] = self.metadata
18
+ if self.vpc_id is not None:
19
+ result['vpcId'] = self.vpc_id
20
+ return result
21
+
22
+
23
+ def from_dict(self, m):
24
+ m = m or dict()
25
+ if m.get('vpcId') is not None:
26
+ self.vpc_id = m.get('vpcId')
27
+ return self
@@ -0,0 +1,24 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+
3
+ class DeleteReservedNetworkSegmentRequest(AbstractModel):
4
+
5
+ def __init__(self, ip_reserve_id, client_token=None):
6
+ super().__init__()
7
+ self.ip_reserve_id = ip_reserve_id
8
+ self.client_token = client_token
9
+
10
+ def to_dict(self):
11
+ _map = super().to_dict()
12
+ if _map is not None:
13
+ return _map
14
+ result = dict()
15
+ return result
16
+
17
+
18
+ def from_dict(self, m):
19
+ m = m or dict()
20
+ if m.get('ipReserveId') is not None:
21
+ self.ip_reserve_id = m.get('ipReserveId')
22
+ if m.get('clientToken') is not None:
23
+ self.client_token = m.get('clientToken')
24
+ return self
@@ -0,0 +1,24 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+
3
+ class DeleteSubnetRequest(AbstractModel):
4
+
5
+ def __init__(self, subnet_id, client_token=None):
6
+ super().__init__()
7
+ self.subnet_id = subnet_id
8
+ self.client_token = client_token
9
+
10
+ def to_dict(self):
11
+ _map = super().to_dict()
12
+ if _map is not None:
13
+ return _map
14
+ result = dict()
15
+ return result
16
+
17
+
18
+ def from_dict(self, m):
19
+ m = m or dict()
20
+ if m.get('subnetId') is not None:
21
+ self.subnet_id = m.get('subnetId')
22
+ if m.get('clientToken') is not None:
23
+ self.client_token = m.get('clientToken')
24
+ return self
@@ -0,0 +1,24 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+
3
+ class DeleteVpcRequest(AbstractModel):
4
+
5
+ def __init__(self, vpc_id, client_token=None):
6
+ super().__init__()
7
+ self.vpc_id = vpc_id
8
+ self.client_token = client_token
9
+
10
+ def to_dict(self):
11
+ _map = super().to_dict()
12
+ if _map is not None:
13
+ return _map
14
+ result = dict()
15
+ return result
16
+
17
+
18
+ def from_dict(self, m):
19
+ m = m or dict()
20
+ if m.get('vpcId') is not None:
21
+ self.vpc_id = m.get('vpcId')
22
+ if m.get('clientToken') is not None:
23
+ self.client_token = m.get('clientToken')
24
+ return self
@@ -0,0 +1,24 @@
1
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
2
+
3
+ class EnableVpcRelayRequest(AbstractModel):
4
+
5
+ def __init__(self, vpc_id, client_token=None):
6
+ super().__init__()
7
+ self.vpc_id = vpc_id
8
+ self.client_token = client_token
9
+
10
+ def to_dict(self):
11
+ _map = super().to_dict()
12
+ if _map is not None:
13
+ return _map
14
+ result = dict()
15
+ return result
16
+
17
+
18
+ def from_dict(self, m):
19
+ m = m or dict()
20
+ if m.get('vpcId') is not None:
21
+ self.vpc_id = m.get('vpcId')
22
+ if m.get('clientToken') is not None:
23
+ self.client_token = m.get('clientToken')
24
+ return self
@@ -0,0 +1,57 @@
1
+
2
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
3
+
4
+
5
+ class IpReserve(AbstractModel):
6
+ """
7
+ IpReserve
8
+ """
9
+ def __init__(self, ip_reserve_id=None, subnet_id=None, ip_cidr=None, ip_version=None, description=None, created_time=None, updated_time=None):
10
+ super().__init__()
11
+ self.ip_reserve_id = ip_reserve_id
12
+ self.subnet_id = subnet_id
13
+ self.ip_cidr = ip_cidr
14
+ self.ip_version = ip_version
15
+ self.description = description
16
+ self.created_time = created_time
17
+ self.updated_time = updated_time
18
+
19
+ def to_dict(self):
20
+ _map = super().to_dict()
21
+ if _map is not None:
22
+ return _map
23
+ result = dict()
24
+ if self.ip_reserve_id is not None:
25
+ result['ipReserveId'] = self.ip_reserve_id
26
+ if self.subnet_id is not None:
27
+ result['subnetId'] = self.subnet_id
28
+ if self.ip_cidr is not None:
29
+ result['ipCidr'] = self.ip_cidr
30
+ if self.ip_version is not None:
31
+ result['ipVersion'] = self.ip_version
32
+ if self.description is not None:
33
+ result['description'] = self.description
34
+ if self.created_time is not None:
35
+ result['createdTime'] = self.created_time
36
+ if self.updated_time is not None:
37
+ result['updatedTime'] = self.updated_time
38
+ return result
39
+
40
+
41
+ def from_dict(self, m):
42
+ m = m or dict()
43
+ if m.get('ipReserveId') is not None:
44
+ self.ip_reserve_id = m.get('ipReserveId')
45
+ if m.get('subnetId') is not None:
46
+ self.subnet_id = m.get('subnetId')
47
+ if m.get('ipCidr') is not None:
48
+ self.ip_cidr = m.get('ipCidr')
49
+ if m.get('ipVersion') is not None:
50
+ self.ip_version = m.get('ipVersion')
51
+ if m.get('description') is not None:
52
+ self.description = m.get('description')
53
+ if m.get('createdTime') is not None:
54
+ self.created_time = m.get('createdTime')
55
+ if m.get('updatedTime') is not None:
56
+ self.updated_time = m.get('updatedTime')
57
+ return self