baiducloud-python-sdk-eip 0.0.1__tar.gz → 0.0.3__tar.gz
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_eip-0.0.1/baiducloud_python_sdk_eip.egg-info → baiducloud_python_sdk_eip-0.0.3}/PKG-INFO +2 -2
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/__init__.py +1 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/api/__init__.py +0 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/api/eip_client.py +297 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/__init__.py +0 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/add_tbsp_area_blocking_request.py +39 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/add_tbsp_ip_whitelist_request.py +34 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/add_tbsp_protocol_blocking_request.py +38 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/bandwidth_package_inquiry_request.py +33 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/bandwidth_package_inquiry_response.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/billing.py +39 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/bind_tbsp_protection_object_request.py +29 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/create_tbsp_request.py +56 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/create_tbsp_response.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/detail_tbsp_request.py +21 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/detail_tbsp_response.py +104 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/disable_tbsp_ip_clean_request.py +34 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/eip_inquiry_request.py +39 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/eip_inquiry_response.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/enable_tbsp_ip_clean_request.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_area_blocking_request.py +24 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_area_blocking_response.py +36 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_ip_clean_request.py +30 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_ip_clean_response.py +51 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_ip_whitelist_request.py +33 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_ip_whitelist_response.py +51 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_protocol_blocking_request.py +24 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_protocol_blocking_response.py +36 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_request.py +33 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/list_tbsp_response.py +51 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/modify_tbsp_ip_clean_threshold_request.py +44 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/modify_tbsp_ip_protect_level_request.py +34 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/remove_tbsp_area_blocking_request.py +30 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/remove_tbsp_ip_whitelist_request.py +30 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/remove_tbsp_protocol_blocking_request.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/renew_tbsp_request.py +34 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/reservation.py +32 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/resize_tbsp_request.py +29 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/shared_bandwidth_inquiry_request.py +39 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/shared_bandwidth_inquiry_response.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/shared_data_package_inquiry_request.py +41 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/shared_data_package_inquiry_response.py +27 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tag_model.py +32 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_area_blocking_model.py +47 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_attack_record_model.py +32 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_ip_clean_model.py +67 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_ip_model.py +32 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_ip_whitelist_model.py +37 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_model.py +107 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_protocol_blocking_model.py +37 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/tbsp_protocol_port_model.py +37 -0
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/unbind_tbsp_protection_object_request.py +29 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip.egg-info}/PKG-INFO +2 -2
- baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip.egg-info/SOURCES.txt +64 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/setup.py +2 -2
- baiducloud_python_sdk_eip-0.0.1/baiducloud_python_sdk_eip/__init__.py +0 -1
- baiducloud_python_sdk_eip-0.0.1/baiducloud_python_sdk_eip.egg-info/SOURCES.txt +0 -14
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/ChangeLog.md +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/LICENSE +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/MANIFEST.in +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/README-CN.md +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/README.md +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/baiducloud_python_sdk_eip/setup.py +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/baiducloud_python_sdk_eip.egg-info/dependency_links.txt +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/baiducloud_python_sdk_eip.egg-info/requires.txt +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/baiducloud_python_sdk_eip.egg-info/top_level.txt +0 -0
- {baiducloud_python_sdk_eip-0.0.1 → baiducloud_python_sdk_eip-0.0.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: baiducloud-python-sdk-eip
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: Baidu Cloud eipApi SDK Library for Python
|
|
5
5
|
Home-page: https://github.com/baidubce/baiducloud-python-sdk
|
|
6
6
|
Author: Baidu Cloud SDK
|
|
@@ -8,7 +8,7 @@ Author-email:
|
|
|
8
8
|
License: Apache License 2.0
|
|
9
9
|
Project-URL: Source, https://github.com/baidubce/baiducloud-python-sdk
|
|
10
10
|
Project-URL: Documentation, https://github.com/baidubce/baiducloud-python-sdk/tree/master/docs
|
|
11
|
-
Project-URL: Changelog, https://github.com/baidubce/baiducloud-python-sdk/blob/master/baiducloud-python-sdk-
|
|
11
|
+
Project-URL: Changelog, https://github.com/baidubce/baiducloud-python-sdk/blob/master/baiducloud-python-sdk-eip/ChangeLog.md
|
|
12
12
|
Keywords: baiducloud,eip
|
|
13
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SDK_VERSION = b'0.0.3'
|
|
File without changes
|
|
@@ -0,0 +1,297 @@
|
|
|
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_eip.models.bandwidth_package_inquiry_response import BandwidthPackageInquiryResponse
|
|
12
|
+
from baiducloud_python_sdk_eip.models.create_tbsp_response import CreateTbspResponse
|
|
13
|
+
from baiducloud_python_sdk_eip.models.detail_tbsp_response import DetailTbspResponse
|
|
14
|
+
from baiducloud_python_sdk_eip.models.eip_inquiry_response import EipInquiryResponse
|
|
15
|
+
from baiducloud_python_sdk_eip.models.list_tbsp_response import ListTbspResponse
|
|
16
|
+
from baiducloud_python_sdk_eip.models.list_tbsp_area_blocking_response import ListTbspAreaBlockingResponse
|
|
17
|
+
from baiducloud_python_sdk_eip.models.list_tbsp_ip_clean_response import ListTbspIpCleanResponse
|
|
18
|
+
from baiducloud_python_sdk_eip.models.list_tbsp_ip_whitelist_response import ListTbspIpWhitelistResponse
|
|
19
|
+
from baiducloud_python_sdk_eip.models.list_tbsp_protocol_blocking_response import ListTbspProtocolBlockingResponse
|
|
20
|
+
from baiducloud_python_sdk_eip.models.shared_bandwidth_inquiry_response import SharedBandwidthInquiryResponse
|
|
21
|
+
from baiducloud_python_sdk_eip.models.shared_data_package_inquiry_response import SharedDataPackageInquiryResponse
|
|
22
|
+
|
|
23
|
+
_logger = logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class EipClient(BceBaseClient):
|
|
27
|
+
|
|
28
|
+
VERSION_V1 = b'/v1'
|
|
29
|
+
|
|
30
|
+
CONSTANT_TBSP = b'tbsp'
|
|
31
|
+
|
|
32
|
+
CONSTANT_AREA_BLOCKING = b'areaBlocking'
|
|
33
|
+
|
|
34
|
+
CONSTANT_EIP = b'eip'
|
|
35
|
+
|
|
36
|
+
CONSTANT_PRICE = b'price'
|
|
37
|
+
|
|
38
|
+
CONSTANT_PROTOCOL_BLOCKING = b'protocolBlocking'
|
|
39
|
+
|
|
40
|
+
CONSTANT_EIPBP = b'eipbp'
|
|
41
|
+
|
|
42
|
+
CONSTANT_IP_PROTECT_LEVEL = b'ipProtectLevel'
|
|
43
|
+
|
|
44
|
+
CONSTANT_IP_CLEAN = b'ipClean'
|
|
45
|
+
|
|
46
|
+
CONSTANT_IP_WHITELIST = b'ipWhitelist'
|
|
47
|
+
|
|
48
|
+
CONSTANT_EIPTP = b'eiptp'
|
|
49
|
+
|
|
50
|
+
CONSTANT_EIPGROUP = b'eipgroup'
|
|
51
|
+
|
|
52
|
+
def __init__(self, config=None):
|
|
53
|
+
bce_base_client.BceBaseClient.__init__(self, config)
|
|
54
|
+
|
|
55
|
+
def add_tbsp_area_blocking(self, request, config=None):
|
|
56
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_AREA_BLOCKING)
|
|
57
|
+
params = {
|
|
58
|
+
'clientToken' : request.client_token,
|
|
59
|
+
}
|
|
60
|
+
return self._send_request(http_methods.POST, path=path
|
|
61
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
62
|
+
|
|
63
|
+
def add_tbsp_ip_whitelist(self, request, config=None):
|
|
64
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_WHITELIST)
|
|
65
|
+
params = {
|
|
66
|
+
'clientToken' : request.client_token,
|
|
67
|
+
}
|
|
68
|
+
return self._send_request(http_methods.POST, path=path
|
|
69
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
70
|
+
|
|
71
|
+
def add_tbsp_protocol_blocking(self, request, config=None):
|
|
72
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_PROTOCOL_BLOCKING)
|
|
73
|
+
params = {
|
|
74
|
+
'clientToken' : request.client_token,
|
|
75
|
+
}
|
|
76
|
+
return self._send_request(http_methods.POST, path=path
|
|
77
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
78
|
+
|
|
79
|
+
def bandwidth_package_inquiry(self, request, config=None):
|
|
80
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_EIPBP, EipClient.CONSTANT_PRICE)
|
|
81
|
+
return self._send_request(http_methods.POST, path=path
|
|
82
|
+
, body=request.to_json_string(), config=config, model=BandwidthPackageInquiryResponse)
|
|
83
|
+
|
|
84
|
+
def bind_tbsp_protection_object(self, request, config=None):
|
|
85
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id)
|
|
86
|
+
params = {
|
|
87
|
+
'bind' : None,
|
|
88
|
+
'clientToken' : request.client_token,
|
|
89
|
+
}
|
|
90
|
+
return self._send_request(http_methods.PUT, path=path
|
|
91
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
92
|
+
|
|
93
|
+
def create_tbsp(self, request, config=None):
|
|
94
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP)
|
|
95
|
+
params = {
|
|
96
|
+
'clientToken' : request.client_token,
|
|
97
|
+
}
|
|
98
|
+
return self._send_request(http_methods.POST, path=path
|
|
99
|
+
, body=request.to_json_string(), params=params, config=config, model=CreateTbspResponse)
|
|
100
|
+
|
|
101
|
+
def detail_tbsp(self, request, config=None):
|
|
102
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id)
|
|
103
|
+
return self._send_request(http_methods.GET, path=path
|
|
104
|
+
, config=config, model=DetailTbspResponse)
|
|
105
|
+
|
|
106
|
+
def disable_tbsp_ip_clean(self, request, config=None):
|
|
107
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_CLEAN)
|
|
108
|
+
params = {
|
|
109
|
+
'turnOffClean' : None,
|
|
110
|
+
'clientToken' : request.client_token,
|
|
111
|
+
}
|
|
112
|
+
return self._send_request(http_methods.PUT, path=path
|
|
113
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
114
|
+
|
|
115
|
+
def eip_inquiry(self, request, config=None):
|
|
116
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_EIP, EipClient.CONSTANT_PRICE)
|
|
117
|
+
return self._send_request(http_methods.POST, path=path
|
|
118
|
+
, body=request.to_json_string(), config=config, model=EipInquiryResponse)
|
|
119
|
+
|
|
120
|
+
def enable_tbsp_ip_clean(self, request, config=None):
|
|
121
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_CLEAN)
|
|
122
|
+
params = {
|
|
123
|
+
'turnOnClean' : None,
|
|
124
|
+
'clientToken' : request.client_token,
|
|
125
|
+
'ip' : request.ip,
|
|
126
|
+
}
|
|
127
|
+
return self._send_request(http_methods.PUT, path=path
|
|
128
|
+
, params=params, config=config)
|
|
129
|
+
|
|
130
|
+
def list_tbsp(self, request, config=None):
|
|
131
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP)
|
|
132
|
+
params = {
|
|
133
|
+
'id' : request.id,
|
|
134
|
+
'name' : request.name,
|
|
135
|
+
'status' : request.status,
|
|
136
|
+
'marker' : request.marker,
|
|
137
|
+
'maxKeys' : request.max_keys,
|
|
138
|
+
}
|
|
139
|
+
return self._send_request(http_methods.GET, path=path
|
|
140
|
+
, params=params, config=config, model=ListTbspResponse)
|
|
141
|
+
|
|
142
|
+
def list_tbsp_area_blocking(self, request, config=None):
|
|
143
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_AREA_BLOCKING)
|
|
144
|
+
params = {
|
|
145
|
+
'ip' : request.ip,
|
|
146
|
+
}
|
|
147
|
+
return self._send_request(http_methods.GET, path=path
|
|
148
|
+
, params=params, config=config, model=ListTbspAreaBlockingResponse)
|
|
149
|
+
|
|
150
|
+
def list_tbsp_ip_clean(self, request, config=None):
|
|
151
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_CLEAN)
|
|
152
|
+
params = {
|
|
153
|
+
'ip' : request.ip,
|
|
154
|
+
'marker' : request.marker,
|
|
155
|
+
'maxKeys' : request.max_keys,
|
|
156
|
+
}
|
|
157
|
+
return self._send_request(http_methods.GET, path=path
|
|
158
|
+
, params=params, config=config, model=ListTbspIpCleanResponse)
|
|
159
|
+
|
|
160
|
+
def list_tbsp_ip_whitelist(self, request, config=None):
|
|
161
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_WHITELIST)
|
|
162
|
+
params = {
|
|
163
|
+
'ip' : request.ip,
|
|
164
|
+
'ipCidr' : request.ip_cidr,
|
|
165
|
+
'marker' : request.marker,
|
|
166
|
+
'maxKeys' : request.max_keys,
|
|
167
|
+
}
|
|
168
|
+
return self._send_request(http_methods.GET, path=path
|
|
169
|
+
, params=params, config=config, model=ListTbspIpWhitelistResponse)
|
|
170
|
+
|
|
171
|
+
def list_tbsp_protocol_blocking(self, request, config=None):
|
|
172
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_PROTOCOL_BLOCKING)
|
|
173
|
+
params = {
|
|
174
|
+
'ip' : request.ip,
|
|
175
|
+
}
|
|
176
|
+
return self._send_request(http_methods.GET, path=path
|
|
177
|
+
, params=params, config=config, model=ListTbspProtocolBlockingResponse)
|
|
178
|
+
|
|
179
|
+
def modify_tbsp_ip_clean_threshold(self, request, config=None):
|
|
180
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_CLEAN)
|
|
181
|
+
params = {
|
|
182
|
+
'modifyThreshold' : None,
|
|
183
|
+
'clientToken' : request.client_token,
|
|
184
|
+
}
|
|
185
|
+
return self._send_request(http_methods.PUT, path=path
|
|
186
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
187
|
+
|
|
188
|
+
def modify_tbsp_ip_protect_level(self, request, config=None):
|
|
189
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_PROTECT_LEVEL)
|
|
190
|
+
params = {
|
|
191
|
+
'clientToken' : request.client_token,
|
|
192
|
+
}
|
|
193
|
+
return self._send_request(http_methods.PUT, path=path
|
|
194
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
195
|
+
|
|
196
|
+
def remove_tbsp_area_blocking(self, request, config=None):
|
|
197
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_AREA_BLOCKING)
|
|
198
|
+
params = {
|
|
199
|
+
'ip' : request.ip,
|
|
200
|
+
'blockType' : request.block_type,
|
|
201
|
+
'clientToken' : request.client_token,
|
|
202
|
+
}
|
|
203
|
+
return self._send_request(http_methods.DELETE, path=path
|
|
204
|
+
, params=params, config=config)
|
|
205
|
+
|
|
206
|
+
def remove_tbsp_ip_whitelist(self, request, config=None):
|
|
207
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_IP_WHITELIST)
|
|
208
|
+
params = {
|
|
209
|
+
'clientToken' : request.client_token,
|
|
210
|
+
'ip' : request.ip,
|
|
211
|
+
'whitelistId' : request.whitelist_id,
|
|
212
|
+
}
|
|
213
|
+
return self._send_request(http_methods.DELETE, path=path
|
|
214
|
+
, params=params, config=config)
|
|
215
|
+
|
|
216
|
+
def remove_tbsp_protocol_blocking(self, request, config=None):
|
|
217
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id, EipClient.CONSTANT_PROTOCOL_BLOCKING)
|
|
218
|
+
params = {
|
|
219
|
+
'ip' : request.ip,
|
|
220
|
+
'clientToken' : request.client_token,
|
|
221
|
+
}
|
|
222
|
+
return self._send_request(http_methods.DELETE, path=path
|
|
223
|
+
, params=params, config=config)
|
|
224
|
+
|
|
225
|
+
def renew_tbsp(self, request, config=None):
|
|
226
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id)
|
|
227
|
+
params = {
|
|
228
|
+
'purchaseReserved' : None,
|
|
229
|
+
'clientToken' : request.client_token,
|
|
230
|
+
}
|
|
231
|
+
return self._send_request(http_methods.PUT, path=path
|
|
232
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
233
|
+
|
|
234
|
+
def resize_tbsp(self, request, config=None):
|
|
235
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id)
|
|
236
|
+
params = {
|
|
237
|
+
'resize' : None,
|
|
238
|
+
'clientToken' : request.client_token,
|
|
239
|
+
}
|
|
240
|
+
return self._send_request(http_methods.PUT, path=path
|
|
241
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
242
|
+
|
|
243
|
+
def shared_bandwidth_inquiry(self, request, config=None):
|
|
244
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_EIPGROUP, EipClient.CONSTANT_PRICE)
|
|
245
|
+
return self._send_request(http_methods.POST, path=path
|
|
246
|
+
, body=request.to_json_string(), config=config, model=SharedBandwidthInquiryResponse)
|
|
247
|
+
|
|
248
|
+
def shared_data_package_inquiry(self, request, config=None):
|
|
249
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_EIPTP, EipClient.CONSTANT_PRICE)
|
|
250
|
+
params = {
|
|
251
|
+
'clientToken' : request.client_token,
|
|
252
|
+
}
|
|
253
|
+
return self._send_request(http_methods.POST, path=path
|
|
254
|
+
, body=request.to_json_string(), params=params, config=config, model=SharedDataPackageInquiryResponse)
|
|
255
|
+
|
|
256
|
+
def unbind_tbsp_protection_object(self, request, config=None):
|
|
257
|
+
path = utils.append_uri(EipClient.VERSION_V1, EipClient.CONSTANT_TBSP, request.id)
|
|
258
|
+
params = {
|
|
259
|
+
'unbind' : None,
|
|
260
|
+
'clientToken' : request.client_token,
|
|
261
|
+
}
|
|
262
|
+
return self._send_request(http_methods.PUT, path=path
|
|
263
|
+
, body=request.to_json_string(), params=params, config=config)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
@staticmethod
|
|
268
|
+
def _generate_default_client_token():
|
|
269
|
+
"""
|
|
270
|
+
default client token by uuid1
|
|
271
|
+
"""
|
|
272
|
+
return uuid.uuid1()
|
|
273
|
+
|
|
274
|
+
def _merge_config(self, config=None):
|
|
275
|
+
"""
|
|
276
|
+
:param config:
|
|
277
|
+
:type config: baiducloud_python_sdk_core.BceClientConfiguration
|
|
278
|
+
"""
|
|
279
|
+
if config is None:
|
|
280
|
+
return self.config
|
|
281
|
+
else:
|
|
282
|
+
new_config = copy.copy(self.config)
|
|
283
|
+
new_config.merge_non_none_values(config)
|
|
284
|
+
return new_config
|
|
285
|
+
|
|
286
|
+
def _send_request(self, http_method, path,
|
|
287
|
+
body=None, headers=None, params=None,
|
|
288
|
+
config=None, body_parser=None, model=None):
|
|
289
|
+
config = self._merge_config(config)
|
|
290
|
+
if body_parser is None:
|
|
291
|
+
body_parser = handler.parse_json
|
|
292
|
+
if headers is None:
|
|
293
|
+
headers = {b'Accept': b'*/*', b'Content-Type':
|
|
294
|
+
b'application/json;charset=utf-8'}
|
|
295
|
+
return bce_http_client.send_request(
|
|
296
|
+
config, bce_v1_signer.sign, [handler.parse_error, body_parser],
|
|
297
|
+
http_method, path, body, headers, params, model=model)
|
|
File without changes
|
baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/add_tbsp_area_blocking_request.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class AddTbspAreaBlockingRequest(AbstractModel):
|
|
4
|
+
|
|
5
|
+
def __init__(self, id, client_token=None, ip=None, block_time=None, block_type=None):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.id = id
|
|
8
|
+
self.client_token = client_token
|
|
9
|
+
self.ip = ip
|
|
10
|
+
self.block_time = block_time
|
|
11
|
+
self.block_type = block_type
|
|
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.ip is not None:
|
|
19
|
+
result['ip'] = self.ip
|
|
20
|
+
if self.block_time is not None:
|
|
21
|
+
result['blockTime'] = self.block_time
|
|
22
|
+
if self.block_type is not None:
|
|
23
|
+
result['blockType'] = self.block_type
|
|
24
|
+
return result
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def from_dict(self, m):
|
|
28
|
+
m = m or dict()
|
|
29
|
+
if m.get('id') is not None:
|
|
30
|
+
self.id = m.get('id')
|
|
31
|
+
if m.get('clientToken') is not None:
|
|
32
|
+
self.client_token = m.get('clientToken')
|
|
33
|
+
if m.get('ip') is not None:
|
|
34
|
+
self.ip = m.get('ip')
|
|
35
|
+
if m.get('blockTime') is not None:
|
|
36
|
+
self.block_time = m.get('blockTime')
|
|
37
|
+
if m.get('blockType') is not None:
|
|
38
|
+
self.block_type = m.get('blockType')
|
|
39
|
+
return self
|
baiducloud_python_sdk_eip-0.0.3/baiducloud_python_sdk_eip/models/add_tbsp_ip_whitelist_request.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class AddTbspIpWhitelistRequest(AbstractModel):
|
|
4
|
+
|
|
5
|
+
def __init__(self, id, client_token=None, ip=None, ip_cidr_list=None):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.id = id
|
|
8
|
+
self.client_token = client_token
|
|
9
|
+
self.ip = ip
|
|
10
|
+
self.ip_cidr_list = ip_cidr_list
|
|
11
|
+
|
|
12
|
+
def to_dict(self):
|
|
13
|
+
_map = super().to_dict()
|
|
14
|
+
if _map is not None:
|
|
15
|
+
return _map
|
|
16
|
+
result = dict()
|
|
17
|
+
if self.ip is not None:
|
|
18
|
+
result['ip'] = self.ip
|
|
19
|
+
if self.ip_cidr_list is not None:
|
|
20
|
+
result['ipCidrList'] = self.ip_cidr_list
|
|
21
|
+
return result
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def from_dict(self, m):
|
|
25
|
+
m = m or dict()
|
|
26
|
+
if m.get('id') is not None:
|
|
27
|
+
self.id = m.get('id')
|
|
28
|
+
if m.get('clientToken') is not None:
|
|
29
|
+
self.client_token = m.get('clientToken')
|
|
30
|
+
if m.get('ip') is not None:
|
|
31
|
+
self.ip = m.get('ip')
|
|
32
|
+
if m.get('ipCidrList') is not None:
|
|
33
|
+
self.ip_cidr_list = m.get('ipCidrList')
|
|
34
|
+
return self
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
from baiducloud_python_sdk_eip.models.tbsp_protocol_port_model import TbspProtocolPortModel
|
|
3
|
+
|
|
4
|
+
class AddTbspProtocolBlockingRequest(AbstractModel):
|
|
5
|
+
|
|
6
|
+
def __init__(self, id, client_token=None, ip=None, protocol_port_list=None):
|
|
7
|
+
super().__init__()
|
|
8
|
+
self.id = id
|
|
9
|
+
self.client_token = client_token
|
|
10
|
+
self.ip = ip
|
|
11
|
+
self.protocol_port_list = protocol_port_list
|
|
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.ip is not None:
|
|
19
|
+
result['ip'] = self.ip
|
|
20
|
+
if self.protocol_port_list is not None:
|
|
21
|
+
result['protocolPortList'] = [i.to_dict() for i in self.protocol_port_list]
|
|
22
|
+
return result
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def from_dict(self, m):
|
|
26
|
+
m = m or dict()
|
|
27
|
+
if m.get('id') is not None:
|
|
28
|
+
self.id = m.get('id')
|
|
29
|
+
if m.get('clientToken') is not None:
|
|
30
|
+
self.client_token = m.get('clientToken')
|
|
31
|
+
if m.get('ip') is not None:
|
|
32
|
+
self.ip = m.get('ip')
|
|
33
|
+
if m.get('protocolPortList') is not None:
|
|
34
|
+
self.protocol_port_list = [
|
|
35
|
+
TbspProtocolPortModel().from_dict(i)
|
|
36
|
+
for i in m.get('protocolPortList')
|
|
37
|
+
]
|
|
38
|
+
return self
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class BandwidthPackageInquiryRequest(AbstractModel):
|
|
4
|
+
|
|
5
|
+
def __init__(self, bandwidth_in_mbps, count=None, type=None):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.bandwidth_in_mbps = bandwidth_in_mbps
|
|
8
|
+
self.count = count
|
|
9
|
+
self.type = type
|
|
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.bandwidth_in_mbps is not None:
|
|
17
|
+
result['bandwidthInMbps'] = self.bandwidth_in_mbps
|
|
18
|
+
if self.count is not None:
|
|
19
|
+
result['count'] = self.count
|
|
20
|
+
if self.type is not None:
|
|
21
|
+
result['type'] = self.type
|
|
22
|
+
return result
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def from_dict(self, m):
|
|
26
|
+
m = m or dict()
|
|
27
|
+
if m.get('bandwidthInMbps') is not None:
|
|
28
|
+
self.bandwidth_in_mbps = m.get('bandwidthInMbps')
|
|
29
|
+
if m.get('count') is not None:
|
|
30
|
+
self.count = m.get('count')
|
|
31
|
+
if m.get('type') is not None:
|
|
32
|
+
self.type = m.get('type')
|
|
33
|
+
return self
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
2
|
+
|
|
3
|
+
class BandwidthPackageInquiryResponse(BceResponse):
|
|
4
|
+
"""
|
|
5
|
+
BandwidthPackageInquiryResponse
|
|
6
|
+
"""
|
|
7
|
+
def __init__(self, prices=None):
|
|
8
|
+
super().__init__()
|
|
9
|
+
self.prices = prices
|
|
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.prices is not None:
|
|
19
|
+
result['prices'] = self.prices
|
|
20
|
+
return result
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def from_dict(self, m):
|
|
24
|
+
m = m or dict()
|
|
25
|
+
if m.get('prices') is not None:
|
|
26
|
+
self.prices = m.get('prices')
|
|
27
|
+
return self
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
3
|
+
|
|
4
|
+
from baiducloud_python_sdk_eip.models.reservation import Reservation
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Billing(AbstractModel):
|
|
8
|
+
"""
|
|
9
|
+
Billing
|
|
10
|
+
"""
|
|
11
|
+
def __init__(self, payment_timing=None, billing_method=None, reservation=None):
|
|
12
|
+
super().__init__()
|
|
13
|
+
self.payment_timing = payment_timing
|
|
14
|
+
self.billing_method = billing_method
|
|
15
|
+
self.reservation = reservation
|
|
16
|
+
|
|
17
|
+
def to_dict(self):
|
|
18
|
+
_map = super().to_dict()
|
|
19
|
+
if _map is not None:
|
|
20
|
+
return _map
|
|
21
|
+
result = dict()
|
|
22
|
+
if self.payment_timing is not None:
|
|
23
|
+
result['paymentTiming'] = self.payment_timing
|
|
24
|
+
if self.billing_method is not None:
|
|
25
|
+
result['billingMethod'] = self.billing_method
|
|
26
|
+
if self.reservation is not None:
|
|
27
|
+
result['reservation'] = self.reservation.to_dict()
|
|
28
|
+
return result
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def from_dict(self, m):
|
|
32
|
+
m = m or dict()
|
|
33
|
+
if m.get('paymentTiming') is not None:
|
|
34
|
+
self.payment_timing = m.get('paymentTiming')
|
|
35
|
+
if m.get('billingMethod') is not None:
|
|
36
|
+
self.billing_method = m.get('billingMethod')
|
|
37
|
+
if m.get('reservation') is not None:
|
|
38
|
+
self.reservation = Reservation().from_dict(m.get('reservation'))
|
|
39
|
+
return self
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class BindTbspProtectionObjectRequest(AbstractModel):
|
|
4
|
+
|
|
5
|
+
def __init__(self, id, ip_list, client_token=None):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.id = id
|
|
8
|
+
self.client_token = client_token
|
|
9
|
+
self.ip_list = ip_list
|
|
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.ip_list is not None:
|
|
17
|
+
result['ipList'] = self.ip_list
|
|
18
|
+
return result
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def from_dict(self, m):
|
|
22
|
+
m = m or dict()
|
|
23
|
+
if m.get('id') is not None:
|
|
24
|
+
self.id = m.get('id')
|
|
25
|
+
if m.get('clientToken') is not None:
|
|
26
|
+
self.client_token = m.get('clientToken')
|
|
27
|
+
if m.get('ipList') is not None:
|
|
28
|
+
self.ip_list = m.get('ipList')
|
|
29
|
+
return self
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class CreateTbspRequest(AbstractModel):
|
|
4
|
+
|
|
5
|
+
def __init__(self, name, line_type, ip_capacity, reservation_length, reservation_time_unit, client_token=None, auto_renew_time=None, auto_renew_time_unit=None):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.client_token = client_token
|
|
8
|
+
self.name = name
|
|
9
|
+
self.line_type = line_type
|
|
10
|
+
self.ip_capacity = ip_capacity
|
|
11
|
+
self.reservation_length = reservation_length
|
|
12
|
+
self.reservation_time_unit = reservation_time_unit
|
|
13
|
+
self.auto_renew_time = auto_renew_time
|
|
14
|
+
self.auto_renew_time_unit = auto_renew_time_unit
|
|
15
|
+
|
|
16
|
+
def to_dict(self):
|
|
17
|
+
_map = super().to_dict()
|
|
18
|
+
if _map is not None:
|
|
19
|
+
return _map
|
|
20
|
+
result = dict()
|
|
21
|
+
if self.name is not None:
|
|
22
|
+
result['name'] = self.name
|
|
23
|
+
if self.line_type is not None:
|
|
24
|
+
result['lineType'] = self.line_type
|
|
25
|
+
if self.ip_capacity is not None:
|
|
26
|
+
result['ipCapacity'] = self.ip_capacity
|
|
27
|
+
if self.reservation_length is not None:
|
|
28
|
+
result['reservationLength'] = self.reservation_length
|
|
29
|
+
if self.reservation_time_unit is not None:
|
|
30
|
+
result['reservationTimeUnit'] = self.reservation_time_unit
|
|
31
|
+
if self.auto_renew_time is not None:
|
|
32
|
+
result['autoRenewTime'] = self.auto_renew_time
|
|
33
|
+
if self.auto_renew_time_unit is not None:
|
|
34
|
+
result['autoRenewTimeUnit'] = self.auto_renew_time_unit
|
|
35
|
+
return result
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def from_dict(self, m):
|
|
39
|
+
m = m or dict()
|
|
40
|
+
if m.get('clientToken') is not None:
|
|
41
|
+
self.client_token = m.get('clientToken')
|
|
42
|
+
if m.get('name') is not None:
|
|
43
|
+
self.name = m.get('name')
|
|
44
|
+
if m.get('lineType') is not None:
|
|
45
|
+
self.line_type = m.get('lineType')
|
|
46
|
+
if m.get('ipCapacity') is not None:
|
|
47
|
+
self.ip_capacity = m.get('ipCapacity')
|
|
48
|
+
if m.get('reservationLength') is not None:
|
|
49
|
+
self.reservation_length = m.get('reservationLength')
|
|
50
|
+
if m.get('reservationTimeUnit') is not None:
|
|
51
|
+
self.reservation_time_unit = m.get('reservationTimeUnit')
|
|
52
|
+
if m.get('autoRenewTime') is not None:
|
|
53
|
+
self.auto_renew_time = m.get('autoRenewTime')
|
|
54
|
+
if m.get('autoRenewTimeUnit') is not None:
|
|
55
|
+
self.auto_renew_time_unit = m.get('autoRenewTimeUnit')
|
|
56
|
+
return self
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.bce_response import BceResponse
|
|
2
|
+
|
|
3
|
+
class CreateTbspResponse(BceResponse):
|
|
4
|
+
"""
|
|
5
|
+
CreateTbspResponse
|
|
6
|
+
"""
|
|
7
|
+
def __init__(self, id=None):
|
|
8
|
+
super().__init__()
|
|
9
|
+
self.id = 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.id is not None:
|
|
19
|
+
result['id'] = self.id
|
|
20
|
+
return result
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def from_dict(self, m):
|
|
24
|
+
m = m or dict()
|
|
25
|
+
if m.get('id') is not None:
|
|
26
|
+
self.id = m.get('id')
|
|
27
|
+
return self
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from baiducloud_python_sdk_core.abstract_model import AbstractModel
|
|
2
|
+
|
|
3
|
+
class DetailTbspRequest(AbstractModel):
|
|
4
|
+
|
|
5
|
+
def __init__(self, id):
|
|
6
|
+
super().__init__()
|
|
7
|
+
self.id = id
|
|
8
|
+
|
|
9
|
+
def to_dict(self):
|
|
10
|
+
_map = super().to_dict()
|
|
11
|
+
if _map is not None:
|
|
12
|
+
return _map
|
|
13
|
+
result = dict()
|
|
14
|
+
return result
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def from_dict(self, m):
|
|
18
|
+
m = m or dict()
|
|
19
|
+
if m.get('id') is not None:
|
|
20
|
+
self.id = m.get('id')
|
|
21
|
+
return self
|