huaweicloudsdkobs 3.1.160__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.
- huaweicloudsdkobs/__init__.py +0 -0
- huaweicloudsdkobs/v1/__init__.py +66 -0
- huaweicloudsdkobs/v1/model/__init__.py +63 -0
- huaweicloudsdkobs/v1/model/access_control_list.py +113 -0
- huaweicloudsdkobs/v1/model/bucket.py +233 -0
- huaweicloudsdkobs/v1/model/buckets.py +117 -0
- huaweicloudsdkobs/v1/model/common_prefixes.py +113 -0
- huaweicloudsdkobs/v1/model/contents.py +287 -0
- huaweicloudsdkobs/v1/model/copy_object_request.py +839 -0
- huaweicloudsdkobs/v1/model/copy_object_response.py +443 -0
- huaweicloudsdkobs/v1/model/create_bucket_request.py +605 -0
- huaweicloudsdkobs/v1/model/create_bucket_request_body.py +117 -0
- huaweicloudsdkobs/v1/model/create_bucket_response.py +239 -0
- huaweicloudsdkobs/v1/model/delete_bucket_customdomain_request.py +173 -0
- huaweicloudsdkobs/v1/model/delete_bucket_customdomain_response.py +239 -0
- huaweicloudsdkobs/v1/model/delete_bucket_request.py +145 -0
- huaweicloudsdkobs/v1/model/delete_bucket_response.py +239 -0
- huaweicloudsdkobs/v1/model/delete_object.py +146 -0
- huaweicloudsdkobs/v1/model/delete_object_request.py +202 -0
- huaweicloudsdkobs/v1/model/delete_object_response.py +289 -0
- huaweicloudsdkobs/v1/model/delete_objects_request.py +226 -0
- huaweicloudsdkobs/v1/model/delete_objects_request_body.py +171 -0
- huaweicloudsdkobs/v1/model/delete_objects_response.py +318 -0
- huaweicloudsdkobs/v1/model/delete_result_deleted.py +204 -0
- huaweicloudsdkobs/v1/model/delete_result_error.py +175 -0
- huaweicloudsdkobs/v1/model/domains.py +173 -0
- huaweicloudsdkobs/v1/model/filter_object.py +113 -0
- huaweicloudsdkobs/v1/model/filter_rule.py +146 -0
- huaweicloudsdkobs/v1/model/function_stage_configuration.py +229 -0
- huaweicloudsdkobs/v1/model/get_bucket_acl_request.py +173 -0
- huaweicloudsdkobs/v1/model/get_bucket_acl_response.py +289 -0
- huaweicloudsdkobs/v1/model/get_bucket_customdomain_request.py +173 -0
- huaweicloudsdkobs/v1/model/get_bucket_customdomain_response.py +264 -0
- huaweicloudsdkobs/v1/model/get_bucket_metadata_request.py +203 -0
- huaweicloudsdkobs/v1/model/get_bucket_metadata_response.py +539 -0
- huaweicloudsdkobs/v1/model/get_bucket_notification_request.py +173 -0
- huaweicloudsdkobs/v1/model/get_bucket_notification_response.py +264 -0
- huaweicloudsdkobs/v1/model/get_object_metadata_request.py +405 -0
- huaweicloudsdkobs/v1/model/get_object_metadata_response.py +689 -0
- huaweicloudsdkobs/v1/model/get_object_request.py +666 -0
- huaweicloudsdkobs/v1/model/get_object_response.py +489 -0
- huaweicloudsdkobs/v1/model/grant.py +171 -0
- huaweicloudsdkobs/v1/model/grantee.py +146 -0
- huaweicloudsdkobs/v1/model/list_buckets_request.py +146 -0
- huaweicloudsdkobs/v1/model/list_buckets_response.py +314 -0
- huaweicloudsdkobs/v1/model/list_objects_request.py +348 -0
- huaweicloudsdkobs/v1/model/list_objects_response.py +546 -0
- huaweicloudsdkobs/v1/model/owner.py +117 -0
- huaweicloudsdkobs/v1/model/put_object_request.py +667 -0
- huaweicloudsdkobs/v1/model/put_object_response.py +389 -0
- huaweicloudsdkobs/v1/model/set_bucket_acl_request.py +227 -0
- huaweicloudsdkobs/v1/model/set_bucket_acl_request_body.py +138 -0
- huaweicloudsdkobs/v1/model/set_bucket_acl_response.py +239 -0
- huaweicloudsdkobs/v1/model/set_bucket_custom_domain_body.py +230 -0
- huaweicloudsdkobs/v1/model/set_bucket_customedomain_request.py +198 -0
- huaweicloudsdkobs/v1/model/set_bucket_customedomain_response.py +239 -0
- huaweicloudsdkobs/v1/model/set_bucket_notification_request.py +198 -0
- huaweicloudsdkobs/v1/model/set_bucket_notification_request_body.py +138 -0
- huaweicloudsdkobs/v1/model/set_bucket_notification_response.py +239 -0
- huaweicloudsdkobs/v1/model/topic_configuration.py +200 -0
- huaweicloudsdkobs/v1/model/topic_configuration_filter.py +113 -0
- huaweicloudsdkobs/v1/obs_async_client.py +1600 -0
- huaweicloudsdkobs/v1/obs_client.py +1597 -0
- huaweicloudsdkobs/v1/obs_credentials.py +69 -0
- huaweicloudsdkobs/v1/obs_signer.py +298 -0
- huaweicloudsdkobs/v1/region/__init__.py +0 -0
- huaweicloudsdkobs/v1/region/obs_region.py +88 -0
- huaweicloudsdkobs-3.1.160.dist-info/LICENSE +13 -0
- huaweicloudsdkobs-3.1.160.dist-info/METADATA +26 -0
- huaweicloudsdkobs-3.1.160.dist-info/RECORD +72 -0
- huaweicloudsdkobs-3.1.160.dist-info/WHEEL +5 -0
- huaweicloudsdkobs-3.1.160.dist-info/top_level.txt +1 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
"""
|
3
|
+
Copyright 2023 Huawei Technologies Co.,Ltd.
|
4
|
+
|
5
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
6
|
+
or more contributor license agreements. See the NOTICE file
|
7
|
+
distributed with this work for additional information
|
8
|
+
regarding copyright ownership. The ASF licenses this file
|
9
|
+
to you under the Apache LICENSE, Version 2.0 (the
|
10
|
+
"LICENSE"); you may not use this file except in compliance
|
11
|
+
with the LICENSE. You may obtain a copy of the LICENSE at
|
12
|
+
|
13
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
|
15
|
+
Unless required by applicable law or agreed to in writing,
|
16
|
+
software distributed under the LICENSE is distributed on an
|
17
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
18
|
+
KIND, either express or implied. See the LICENSE for the
|
19
|
+
specific language governing permissions and limitations
|
20
|
+
under the LICENSE.
|
21
|
+
"""
|
22
|
+
|
23
|
+
from huaweicloudsdkobs.v1.obs_signer import OBSSigner
|
24
|
+
from huaweicloudsdkcore.auth.credentials import Credentials
|
25
|
+
import datetime
|
26
|
+
import hashlib
|
27
|
+
import base64
|
28
|
+
|
29
|
+
_AUTHORIZATION_HEADER = 'Authorization'
|
30
|
+
_CONTENT_MD5_HEADER = 'Content-MD5'
|
31
|
+
|
32
|
+
|
33
|
+
class ObsCredentials(Credentials):
|
34
|
+
def __init__(self, ak, sk, securityToken=None):
|
35
|
+
self.ak = ak
|
36
|
+
self.sk = sk
|
37
|
+
self.security_token = securityToken
|
38
|
+
|
39
|
+
def get_update_path_params(self):
|
40
|
+
return {}
|
41
|
+
|
42
|
+
def process_auth_params(self, http_client, region_id):
|
43
|
+
return self
|
44
|
+
|
45
|
+
def get_encoded_md5(self, byte_val):
|
46
|
+
hash_object = hashlib.md5(byte_val)
|
47
|
+
base64_hash = base64.b64encode(hash_object.digest())
|
48
|
+
return base64_hash
|
49
|
+
|
50
|
+
def process_auth_request(self, request, http_client):
|
51
|
+
if request.host.split('.')[0] == 'obs':
|
52
|
+
bucketName = None
|
53
|
+
else:
|
54
|
+
bucketName = request.host.split('.')[0]
|
55
|
+
objectKey = request.resource_path.split('/')[1]
|
56
|
+
pathArgs = request.query_params
|
57
|
+
gmt_format = '%a %b %d %Y %H:%M:%S GMT'
|
58
|
+
request.header_params['Date'] = datetime.datetime.utcnow().strftime(gmt_format)
|
59
|
+
if request.body and _CONTENT_MD5_HEADER not in request.header_params and isinstance(request.body, str):
|
60
|
+
md5 = self.get_encoded_md5(request.body.encode('UTF-8')).decode('UTF-8')
|
61
|
+
request.header_params[_CONTENT_MD5_HEADER] = md5
|
62
|
+
ret = OBSSigner.doAuth(self, request.method, bucketName, objectKey, pathArgs, request.header_params)
|
63
|
+
|
64
|
+
request.header_params[_AUTHORIZATION_HEADER] = ret[_AUTHORIZATION_HEADER]
|
65
|
+
|
66
|
+
OBSSigner.process_request_uri(request)
|
67
|
+
return http_client.executor.submit(lambda: request)
|
68
|
+
|
69
|
+
|
@@ -0,0 +1,298 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
"""
|
3
|
+
Copyright 2023 Huawei Technologies Co.,Ltd.
|
4
|
+
|
5
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
6
|
+
or more contributor license agreements. See the NOTICE file
|
7
|
+
distributed with this work for additional information
|
8
|
+
regarding copyright ownership. The ASF licenses this file
|
9
|
+
to you under the Apache LICENSE, Version 2.0 (the
|
10
|
+
"LICENSE"); you may not use this file except in compliance
|
11
|
+
with the LICENSE. You may obtain a copy of the LICENSE at
|
12
|
+
|
13
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
|
15
|
+
Unless required by applicable law or agreed to in writing,
|
16
|
+
software distributed under the LICENSE is distributed on an
|
17
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
18
|
+
KIND, either express or implied. See the LICENSE for the
|
19
|
+
specific language governing permissions and limitations
|
20
|
+
under the LICENSE.
|
21
|
+
"""
|
22
|
+
|
23
|
+
import hashlib
|
24
|
+
import hmac
|
25
|
+
import six
|
26
|
+
import binascii
|
27
|
+
from huaweicloudsdkcore.sdk_request import SdkRequest
|
28
|
+
if six.PY3:
|
29
|
+
from urllib.parse import quote
|
30
|
+
else:
|
31
|
+
from urllib import quote
|
32
|
+
|
33
|
+
_OBS_HEADER_PREFIX = 'x-obs-'
|
34
|
+
_AUTHORIZATION_HEADER = 'Authorization'
|
35
|
+
_OBS_META_HEADER_PREFIX = 'x-obs-meta-'
|
36
|
+
_CANONICAL_STRING = 'CanonicalString'
|
37
|
+
|
38
|
+
_CONTENT_TYPE_HEADER = 'Content-Type'
|
39
|
+
_CONTENT_MD5_HEADER = 'Content-MD5'
|
40
|
+
_X_OBS_SECURITY_TOKEN = "x-obs-security-token"
|
41
|
+
_DATE_HEADER = 'Date'
|
42
|
+
|
43
|
+
_FILE = "file"
|
44
|
+
|
45
|
+
_CONTENT_LIST = [_CONTENT_TYPE_HEADER.lower(), _CONTENT_MD5_HEADER.lower(), _DATE_HEADER.lower()]
|
46
|
+
|
47
|
+
_ALLOWED_RESOURCE_PARAMTER_NAMES = (
|
48
|
+
'acl',
|
49
|
+
'backtosource',
|
50
|
+
'policy',
|
51
|
+
'torrent',
|
52
|
+
'logging',
|
53
|
+
'location',
|
54
|
+
'storageinfo',
|
55
|
+
'quota',
|
56
|
+
'storageclass',
|
57
|
+
'storagepolicy',
|
58
|
+
'requestpayment',
|
59
|
+
'versions',
|
60
|
+
'versioning',
|
61
|
+
'versionid',
|
62
|
+
'uploads',
|
63
|
+
'uploadid',
|
64
|
+
'partnumber',
|
65
|
+
'website',
|
66
|
+
'notification',
|
67
|
+
'lifecycle',
|
68
|
+
'deletebucket',
|
69
|
+
'delete',
|
70
|
+
'cors',
|
71
|
+
'restore',
|
72
|
+
'tagging',
|
73
|
+
'replication',
|
74
|
+
'metadata',
|
75
|
+
'encryption',
|
76
|
+
|
77
|
+
# File System API
|
78
|
+
'append',
|
79
|
+
'position',
|
80
|
+
'truncate',
|
81
|
+
'modify',
|
82
|
+
'rename',
|
83
|
+
'length',
|
84
|
+
'name',
|
85
|
+
'fileinterface',
|
86
|
+
|
87
|
+
'response-content-type',
|
88
|
+
'response-content-language',
|
89
|
+
'response-expires',
|
90
|
+
'response-cache-control',
|
91
|
+
'response-content-disposition',
|
92
|
+
'response-content-encoding',
|
93
|
+
'x-image-save-bucket',
|
94
|
+
'x-image-save-object',
|
95
|
+
'x-image-process',
|
96
|
+
'x-oss-process',
|
97
|
+
|
98
|
+
# workflow api
|
99
|
+
'x-workflow-prefix',
|
100
|
+
'x-workflow-start',
|
101
|
+
'x-workflow-limit',
|
102
|
+
'x-workflow-template-name',
|
103
|
+
'x-workflow-graph-name',
|
104
|
+
'x-workflow-execution-state',
|
105
|
+
'x-workflow-execution-type',
|
106
|
+
'x-workflow-next-marker',
|
107
|
+
'obsworkflowtriggerpolicy',
|
108
|
+
|
109
|
+
# virtual bucket api
|
110
|
+
'obsbucketalias',
|
111
|
+
'obsalias'
|
112
|
+
)
|
113
|
+
_IS_PYTHON2 = six.PY2
|
114
|
+
|
115
|
+
|
116
|
+
class OBSSigner(object):
|
117
|
+
|
118
|
+
def __init__(self, credentials):
|
119
|
+
self._ak = credentials.ak
|
120
|
+
self._sk = credentials.sk
|
121
|
+
|
122
|
+
@classmethod
|
123
|
+
def auth_prefix(self):
|
124
|
+
return 'OBS'
|
125
|
+
|
126
|
+
@classmethod
|
127
|
+
def _get_header_prefix(self):
|
128
|
+
return _OBS_HEADER_PREFIX
|
129
|
+
|
130
|
+
@classmethod
|
131
|
+
def date_header(self):
|
132
|
+
return self._get_header_prefix() + 'date'
|
133
|
+
|
134
|
+
@classmethod
|
135
|
+
def _get_meta_header_prefix(self):
|
136
|
+
return _OBS_META_HEADER_PREFIX
|
137
|
+
|
138
|
+
@classmethod
|
139
|
+
def to_string(self, item):
|
140
|
+
try:
|
141
|
+
return str(item) if item is not None else ''
|
142
|
+
except Exception:
|
143
|
+
return ''
|
144
|
+
|
145
|
+
@classmethod
|
146
|
+
def encode_object_key(self, key):
|
147
|
+
return self.encode_item(key, '/~')
|
148
|
+
|
149
|
+
@classmethod
|
150
|
+
def encode_item(self, item, safe='/'):
|
151
|
+
return quote(self.to_string(item), safe)
|
152
|
+
|
153
|
+
@classmethod
|
154
|
+
def doAuth(self, credentials, method, bucket, key, path_args, headers, expires=None):
|
155
|
+
if credentials.security_token is not None:
|
156
|
+
headers[_X_OBS_SECURITY_TOKEN] = credentials.security_token
|
157
|
+
ret = self.getSignature(credentials, method, bucket, key, path_args, headers, expires)
|
158
|
+
return {
|
159
|
+
_AUTHORIZATION_HEADER: '%s %s:%s' % (self.auth_prefix(), credentials.ak, ret['Signature']),
|
160
|
+
_CANONICAL_STRING: ret[_CANONICAL_STRING]
|
161
|
+
}
|
162
|
+
|
163
|
+
@classmethod
|
164
|
+
def getSignature(self, credentials, method, bucket, key, path_args, headers, expires=None):
|
165
|
+
canonical_string = self.__make_canonical_string(method, bucket, key, path_args, headers, expires)
|
166
|
+
return {
|
167
|
+
'Signature': self.hmacSha128(credentials, canonical_string),
|
168
|
+
_CANONICAL_STRING: canonical_string
|
169
|
+
}
|
170
|
+
|
171
|
+
@classmethod
|
172
|
+
def hmacSha128(self, credentials, canonical_string):
|
173
|
+
if _IS_PYTHON2:
|
174
|
+
hashed = hmac.new(credentials.sk, canonical_string, hashlib.sha1)
|
175
|
+
encode_canonical = binascii.b2a_base64(hashed.digest())[:-1]
|
176
|
+
else:
|
177
|
+
hashed = hmac.new(credentials.sk.encode('UTF-8'), canonical_string.encode('UTF-8'), hashlib.sha1)
|
178
|
+
encode_canonical = binascii.b2a_base64(hashed.digest())[:-1].decode('UTF-8')
|
179
|
+
|
180
|
+
return encode_canonical
|
181
|
+
|
182
|
+
@classmethod
|
183
|
+
def __make_canonical_string(self, method, bucket_name, key, path_args, headers, expires=None):
|
184
|
+
interesting_headers = self.__make_canonicalstring_interesting_headers(headers, expires)
|
185
|
+
key_list = sorted(interesting_headers.keys())
|
186
|
+
str_list = self.__make_canonicalstring_str_list(key_list, method, interesting_headers)
|
187
|
+
URI = ''
|
188
|
+
_bucket_name = bucket_name
|
189
|
+
if _bucket_name:
|
190
|
+
URI += '/'
|
191
|
+
URI += _bucket_name
|
192
|
+
URI += '/'
|
193
|
+
|
194
|
+
if key:
|
195
|
+
if not URI.endswith('/'):
|
196
|
+
URI += '/'
|
197
|
+
URI += key
|
198
|
+
|
199
|
+
if URI:
|
200
|
+
str_list.append(URI)
|
201
|
+
else:
|
202
|
+
str_list.append('/')
|
203
|
+
|
204
|
+
if path_args:
|
205
|
+
e = '?'
|
206
|
+
cannoList = sorted(path_args, key=lambda d: d[0])
|
207
|
+
for path_key, path_value in cannoList:
|
208
|
+
if path_key.lower() in _ALLOWED_RESOURCE_PARAMTER_NAMES or path_key.lower().startswith(
|
209
|
+
self._get_header_prefix()):
|
210
|
+
path_key = self.encode_item(path_key, '/')
|
211
|
+
if path_value == ' ' or not path_value:
|
212
|
+
e += path_key + '&'
|
213
|
+
continue
|
214
|
+
e += path_key + '=' + self.to_string(path_value) + '&'
|
215
|
+
|
216
|
+
e = e[:-1]
|
217
|
+
str_list.append(e)
|
218
|
+
return ''.join(str_list)
|
219
|
+
|
220
|
+
@classmethod
|
221
|
+
def __make_canonicalstring_interesting_headers(self, headers, expires):
|
222
|
+
interesting_headers = {}
|
223
|
+
if isinstance(headers, dict):
|
224
|
+
for hash_key in headers.keys():
|
225
|
+
lk = hash_key.lower()
|
226
|
+
if lk in _CONTENT_LIST or lk.startswith(self._get_header_prefix()):
|
227
|
+
s = headers.get(hash_key)
|
228
|
+
interesting_headers[lk] = ''.join(s)
|
229
|
+
|
230
|
+
key_list = interesting_headers.keys()
|
231
|
+
|
232
|
+
if self.date_header() in key_list:
|
233
|
+
interesting_headers[_DATE_HEADER.lower()] = ''
|
234
|
+
|
235
|
+
if expires:
|
236
|
+
interesting_headers[_DATE_HEADER.lower()] = expires
|
237
|
+
|
238
|
+
if _CONTENT_TYPE_HEADER.lower() not in key_list:
|
239
|
+
interesting_headers[_CONTENT_TYPE_HEADER.lower()] = ''
|
240
|
+
|
241
|
+
if _CONTENT_MD5_HEADER.lower() not in key_list:
|
242
|
+
interesting_headers[_CONTENT_MD5_HEADER.lower()] = ''
|
243
|
+
|
244
|
+
return interesting_headers
|
245
|
+
|
246
|
+
@classmethod
|
247
|
+
def __make_canonicalstring_str_list(self, keylist, method, interesting_headers):
|
248
|
+
str_list = [method + '\n']
|
249
|
+
for k in keylist:
|
250
|
+
header_key = self.to_string(k)
|
251
|
+
val = '' if interesting_headers[header_key] is None else interesting_headers[header_key]
|
252
|
+
if header_key.startswith(self._get_meta_header_prefix()):
|
253
|
+
str_list.append(header_key + ':' + self.to_string(val).strip())
|
254
|
+
elif header_key.startswith(self._get_header_prefix()):
|
255
|
+
str_list.append(header_key + ':' + val)
|
256
|
+
else:
|
257
|
+
str_list.append(val)
|
258
|
+
str_list.append('\n')
|
259
|
+
return str_list
|
260
|
+
|
261
|
+
@classmethod
|
262
|
+
def process_request_uri(cls, request):
|
263
|
+
# type: (SdkRequest) -> None
|
264
|
+
canonical_query_string = cls._process_canonical_query_string(request)
|
265
|
+
request.uri = "%s?%s" % (request.resource_path, canonical_query_string) \
|
266
|
+
if canonical_query_string != "" else request.resource_path
|
267
|
+
|
268
|
+
@classmethod
|
269
|
+
def _url_encode(cls, s):
|
270
|
+
# type: (str) -> str
|
271
|
+
return quote(s, safe='~')
|
272
|
+
|
273
|
+
@classmethod
|
274
|
+
def _process_canonical_query_string(cls, request):
|
275
|
+
# type: (SdkRequest) -> str
|
276
|
+
params = []
|
277
|
+
for param in request.query_params:
|
278
|
+
params.append(param)
|
279
|
+
params.sort()
|
280
|
+
|
281
|
+
canonical_query_param = []
|
282
|
+
for (key, value) in params:
|
283
|
+
k = cls._url_encode(key)
|
284
|
+
if value == ' ' or not value:
|
285
|
+
canonical_query_param.append(k)
|
286
|
+
elif isinstance(value, list):
|
287
|
+
value.sort()
|
288
|
+
for v in value:
|
289
|
+
kv = "%s=%s" % (k, cls._url_encode(str(v)))
|
290
|
+
canonical_query_param.append(kv)
|
291
|
+
elif isinstance(value, bool):
|
292
|
+
kv = "%s=%s" % (k, cls._url_encode(str(value).lower()))
|
293
|
+
canonical_query_param.append(kv)
|
294
|
+
else:
|
295
|
+
kv = "%s=%s" % (k, cls._url_encode(str(value)))
|
296
|
+
canonical_query_param.append(kv)
|
297
|
+
|
298
|
+
return '&'.join(canonical_query_param)
|
File without changes
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
from huaweicloudsdkcore.region.region import Region
|
4
|
+
from huaweicloudsdkcore.region.provider import RegionProviderChain
|
5
|
+
|
6
|
+
class ObsRegion:
|
7
|
+
_PROVIDER = RegionProviderChain.get_default_region_provider_chain("OBS")
|
8
|
+
|
9
|
+
AF_SOUTH_1 = Region("af-south-1",
|
10
|
+
"https://obs.af-south-1.myhuaweicloud.com")
|
11
|
+
CN_NORTH_4 = Region("cn-north-4",
|
12
|
+
"https://obs.cn-north-4.myhuaweicloud.com")
|
13
|
+
CN_NORTH_1 = Region("cn-north-1",
|
14
|
+
"https://obs.cn-north-1.myhuaweicloud.com")
|
15
|
+
CN_NORTH_9 = Region("cn-north-9",
|
16
|
+
"https://obs.cn-north-9.myhuaweicloud.com")
|
17
|
+
CN_EAST_2 = Region("cn-east-2",
|
18
|
+
"https://obs.cn-east-2.myhuaweicloud.com")
|
19
|
+
CN_EAST_3 = Region("cn-east-3",
|
20
|
+
"https://obs.cn-east-3.myhuaweicloud.com")
|
21
|
+
CN_SOUTH_1 = Region("cn-south-1",
|
22
|
+
"https://obs.cn-south-1.myhuaweicloud.com")
|
23
|
+
CN_SOUTH_4 = Region("cn-south-4",
|
24
|
+
"https://obs.cn-south-4.myhuaweicloud.com")
|
25
|
+
CN_SOUTH_2 = Region("cn-south-2",
|
26
|
+
"https://obs.cn-south-2.myhuaweicloud.com")
|
27
|
+
LA_NORTH_2 = Region("la-north-2",
|
28
|
+
"https://obs.la-north-2.myhuaweicloud.com")
|
29
|
+
NA_MEXICO_1 = Region("na-mexico-1",
|
30
|
+
"https://obs.na-mexico-1.myhuaweicloud.com")
|
31
|
+
SA_BRAZIL_1 = Region("sa-brazil-1",
|
32
|
+
"https://obs.sa-brazil-1.myhuaweicloud.com")
|
33
|
+
LA_SOUTH_2 = Region("la-south-2",
|
34
|
+
"https://obs.la-south-2.myhuaweicloud.com")
|
35
|
+
CN_SOUTHWEST_2 = Region("cn-southwest-2",
|
36
|
+
"https://obs.cn-southwest-2.myhuaweicloud.com")
|
37
|
+
AP_SOUTHEAST_2 = Region("ap-southeast-2",
|
38
|
+
"https://obs.ap-southeast-2.myhuaweicloud.com")
|
39
|
+
AP_SOUTHEAST_3 = Region("ap-southeast-3",
|
40
|
+
"https://obs.ap-southeast-3.myhuaweicloud.com")
|
41
|
+
AP_SOUTHEAST_4 = Region("ap-southeast-4",
|
42
|
+
"https://obs.ap-southeast-4.myhuaweicloud.com")
|
43
|
+
AP_SOUTHEAST_1 = Region("ap-southeast-1",
|
44
|
+
"https://obs.ap-southeast-1.myhuaweicloud.com")
|
45
|
+
TR_WEST_1 = Region("tr-west-1",
|
46
|
+
"https://obs.tr-west-1.myhuaweicloud.com")
|
47
|
+
EU_WEST_101 = Region("eu-west-101",
|
48
|
+
"https://obs.eu-west-101.myhuaweicloud.eu")
|
49
|
+
|
50
|
+
static_fields = {
|
51
|
+
"af-south-1": AF_SOUTH_1,
|
52
|
+
"cn-north-4": CN_NORTH_4,
|
53
|
+
"cn-north-1": CN_NORTH_1,
|
54
|
+
"cn-north-9": CN_NORTH_9,
|
55
|
+
"cn-east-2": CN_EAST_2,
|
56
|
+
"cn-east-3": CN_EAST_3,
|
57
|
+
"cn-south-1": CN_SOUTH_1,
|
58
|
+
"cn-south-4": CN_SOUTH_4,
|
59
|
+
"cn-south-2": CN_SOUTH_2,
|
60
|
+
"la-north-2": LA_NORTH_2,
|
61
|
+
"na-mexico-1": NA_MEXICO_1,
|
62
|
+
"sa-brazil-1": SA_BRAZIL_1,
|
63
|
+
"la-south-2": LA_SOUTH_2,
|
64
|
+
"cn-southwest-2": CN_SOUTHWEST_2,
|
65
|
+
"ap-southeast-2": AP_SOUTHEAST_2,
|
66
|
+
"ap-southeast-3": AP_SOUTHEAST_3,
|
67
|
+
"ap-southeast-4": AP_SOUTHEAST_4,
|
68
|
+
"ap-southeast-1": AP_SOUTHEAST_1,
|
69
|
+
"tr-west-1": TR_WEST_1,
|
70
|
+
"eu-west-101": EU_WEST_101,
|
71
|
+
}
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def value_of(cls, region_id, static_fields=None):
|
75
|
+
if not region_id:
|
76
|
+
raise KeyError("Unexpected empty parameter: region_id")
|
77
|
+
|
78
|
+
fields = static_fields or cls.static_fields
|
79
|
+
|
80
|
+
region = cls._PROVIDER.get_region(region_id)
|
81
|
+
if region:
|
82
|
+
return region
|
83
|
+
|
84
|
+
if region_id in fields:
|
85
|
+
return fields.get(region_id)
|
86
|
+
|
87
|
+
raise KeyError("region_id '%s' is not in the following supported regions of service 'Obs': [%s]" % (
|
88
|
+
region_id, ", ".join(sorted(fields.keys()))))
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (c) Huawei Technologies Co., Ltd. 2020-present. All rights reserved.
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: huaweicloudsdkobs
|
3
|
+
Version: 3.1.160
|
4
|
+
Summary: OBS
|
5
|
+
Home-page: https://github.com/huaweicloud/huaweicloud-sdk-python-v3
|
6
|
+
Author: HuaweiCloud SDK
|
7
|
+
Author-email: hwcloudsdk@huawei.com
|
8
|
+
License: Apache LICENSE 2.0
|
9
|
+
Keywords: huaweicloud,sdk,OBS
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
11
|
+
Classifier: Intended Audience :: Developers
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
13
|
+
Classifier: Programming Language :: Python :: 3.6
|
14
|
+
Classifier: Programming Language :: Python :: 3.7
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
20
|
+
Classifier: Topic :: Software Development
|
21
|
+
Requires-Python: >=3.6
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
License-File: LICENSE
|
24
|
+
Requires-Dist: huaweicloudsdkcore>=3.1.160
|
25
|
+
|
26
|
+
See detailed information in [huaweicloud-sdk-python-v3](https://github.com/huaweicloud/huaweicloud-sdk-python-v3).
|
@@ -0,0 +1,72 @@
|
|
1
|
+
huaweicloudsdkobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
huaweicloudsdkobs/v1/__init__.py,sha256=Br-91ECOvy-mLUL6wIHdj-ynTRoW_DeFGdNALJsBWwE,4965
|
3
|
+
huaweicloudsdkobs/v1/obs_async_client.py,sha256=tMVIAXQYtMXp92XBhFIYKF4OIJRDL8KLTCKxJH46KVI,76984
|
4
|
+
huaweicloudsdkobs/v1/obs_client.py,sha256=VkGqAe8Ay9VZ5kWEHdeaf5G_Lkdnol224o4dNZUFaAA,76915
|
5
|
+
huaweicloudsdkobs/v1/obs_credentials.py,sha256=cIlZE3o8GHaHsDKrhqEPfPXQ3tHXQE2FqHI4uqDfNHI,2559
|
6
|
+
huaweicloudsdkobs/v1/obs_signer.py,sha256=w79BqrSjL1CgG_pLtwjknP-cPm9nqovC6kWO3zOCrY8,9438
|
7
|
+
huaweicloudsdkobs/v1/model/__init__.py,sha256=t0iNalKUCsoK-kq7kXl2pdcjvxCK7CsRc9--Z6Xxq2s,4879
|
8
|
+
huaweicloudsdkobs/v1/model/access_control_list.py,sha256=Ehoe-AjD6CjOHrcpbOueAx_Z4dOGoaKoiii4pXYcSZo,3096
|
9
|
+
huaweicloudsdkobs/v1/model/bucket.py,sha256=Haav8AJ2yIT40_X1oy0Q2mi7dOmUBG4bDfsHtVpM5CA,6981
|
10
|
+
huaweicloudsdkobs/v1/model/buckets.py,sha256=oRGB3-wuKJefqBK_hw4nP8bcLb1dl-bpiwykbQCHKlM,3114
|
11
|
+
huaweicloudsdkobs/v1/model/common_prefixes.py,sha256=dYnz5f8lGVVBksmnh39sbtc41xKSKlg64ITV5yPNJn0,2973
|
12
|
+
huaweicloudsdkobs/v1/model/contents.py,sha256=yFvzZE5X8Bq0XdOWvkK_FMguT0HneGIUxNjZ0TWPPLc,9567
|
13
|
+
huaweicloudsdkobs/v1/model/copy_object_request.py,sha256=JCj1Zdzocfpa5RYD65ykETTPrlCL9sznUOIe-iU7UeE,65080
|
14
|
+
huaweicloudsdkobs/v1/model/copy_object_response.py,sha256=GLyp0p_IB44sfJbHOr1tX-GR8ZLE3qaf-4Xg3aYvYpk,16593
|
15
|
+
huaweicloudsdkobs/v1/model/create_bucket_request.py,sha256=3fZ6jjv2rJQGUbhcEWfS8ZGanze-1zEzsYgONZMkHHs,32271
|
16
|
+
huaweicloudsdkobs/v1/model/create_bucket_request_body.py,sha256=QjK50Yz0qURUTmAD5xhkdZDd83BZTTRBaQJ50oSq7qA,5408
|
17
|
+
huaweicloudsdkobs/v1/model/create_bucket_response.py,sha256=NdYfp0lSeb2drHyNV3AYNfLdowX_dkn8zaYize6YthE,6977
|
18
|
+
huaweicloudsdkobs/v1/model/delete_bucket_customdomain_request.py,sha256=fCEASb0d_S3ExYz098Zi9o4oBY14PM6g4kW-NalJD3Y,5840
|
19
|
+
huaweicloudsdkobs/v1/model/delete_bucket_customdomain_response.py,sha256=DgwLCbmHNUD51aKeDMj9sBZOO0JmISRi1noYOpSOylA,7325
|
20
|
+
huaweicloudsdkobs/v1/model/delete_bucket_request.py,sha256=9G4IuwJZGRAVlCUtBXWMkKHW9PvxSGyVobr0YIxCBcU,4509
|
21
|
+
huaweicloudsdkobs/v1/model/delete_bucket_response.py,sha256=2diM8241YF9AuMJxhEWx9XpVAfGwwvlG9JrzPRvumlo,6977
|
22
|
+
huaweicloudsdkobs/v1/model/delete_object.py,sha256=3CyMAB0kxcmOUPyLnc8AgrhxC7KpB67bPVc8iRv2S1c,4100
|
23
|
+
huaweicloudsdkobs/v1/model/delete_object_request.py,sha256=cHa50UMDUplQOdHmmIiPWwy7GB1WinYENQ08Y99Uf6w,6227
|
24
|
+
huaweicloudsdkobs/v1/model/delete_object_response.py,sha256=VuHHDDKRHILS8z2bDNCERkqlrmW5HLaECRh7mEqxgD0,8832
|
25
|
+
huaweicloudsdkobs/v1/model/delete_objects_request.py,sha256=CQhKE50JlexvyDcN_GgSC90AWhNUjVnF8REZbOHSFRI,7089
|
26
|
+
huaweicloudsdkobs/v1/model/delete_objects_request_body.py,sha256=UIhrjF_r-8LqzTD2g_askT6UCCI2VZzysg6KT8WQDAs,5915
|
27
|
+
huaweicloudsdkobs/v1/model/delete_objects_response.py,sha256=UL_W3e4yHpcvlwDtvrsvI-LEqS8bYlhIOaEkOSbyHMY,9997
|
28
|
+
huaweicloudsdkobs/v1/model/delete_result_deleted.py,sha256=RLKvxkVVThfXkQWszbyb-HGK8N58avqyksNKzvC8Eik,7807
|
29
|
+
huaweicloudsdkobs/v1/model/delete_result_error.py,sha256=V4qcVHIce4Q4kJwVhOosmcM3ktzHkeIh0rzZtVyvagQ,4573
|
30
|
+
huaweicloudsdkobs/v1/model/domains.py,sha256=mVfCKvg5hsatC7JqsKkQnS3V1829G6Z6GzclMiXczO4,4755
|
31
|
+
huaweicloudsdkobs/v1/model/filter_object.py,sha256=kAs-FPHXg4cRq838DyDw12yBL_j2nqvXZ3yMpawxT-c,3213
|
32
|
+
huaweicloudsdkobs/v1/model/filter_rule.py,sha256=2E76FpSNZCckYzwKbM4IE9o5HcHX96vHcl_c1kuijBQ,4378
|
33
|
+
huaweicloudsdkobs/v1/model/function_stage_configuration.py,sha256=Vo2LPohfTKjLjf-bU_IrefsoXMcWnLQ9VVwbxc7nJ_U,10061
|
34
|
+
huaweicloudsdkobs/v1/model/get_bucket_acl_request.py,sha256=-E2yEO2bM-7xgpySI3V9vVjlKG-azpkCfcoLv5PEvk0,5267
|
35
|
+
huaweicloudsdkobs/v1/model/get_bucket_acl_response.py,sha256=lCBxcaK2o0V217ChTwgDBDHlZi-6BV1sGrOLaw3o2ec,8821
|
36
|
+
huaweicloudsdkobs/v1/model/get_bucket_customdomain_request.py,sha256=L15g2eMZKgZMh-e3MjENqngNnsl4MkiLNiHXQd7lbv8,5609
|
37
|
+
huaweicloudsdkobs/v1/model/get_bucket_customdomain_response.py,sha256=XAUIUBiXkyRJT9qX5KgWb6A3xSbUYHEteJF2yl01Sj8,8066
|
38
|
+
huaweicloudsdkobs/v1/model/get_bucket_metadata_request.py,sha256=kwPQXX-UAO7sanBpbICgCiwVsd6XlN7pKEwvfO0Qqv0,7347
|
39
|
+
huaweicloudsdkobs/v1/model/get_bucket_metadata_response.py,sha256=RmmNsFhjzRe54VBt_IM1Spp5E6kOEc3BjNKxCBVZtP4,19573
|
40
|
+
huaweicloudsdkobs/v1/model/get_bucket_notification_request.py,sha256=RYwO_Pa1OS-1RFHKzV3iMkr_jHCH8-BHy3jL12VeRMQ,5633
|
41
|
+
huaweicloudsdkobs/v1/model/get_bucket_notification_response.py,sha256=o9ylfigRj239JEjtY17puCsy9yAZ-dJo8qUOwsbNRqw,8602
|
42
|
+
huaweicloudsdkobs/v1/model/get_object_metadata_request.py,sha256=sZI-fBF77EWTYJhAOZPkYTbmhE40F5SPdylgqlHfLm0,20621
|
43
|
+
huaweicloudsdkobs/v1/model/get_object_metadata_response.py,sha256=7gMJxKamWahZKxHS783Lf1kwrEgbzH8UzW44Ew_lXyY,27649
|
44
|
+
huaweicloudsdkobs/v1/model/get_object_request.py,sha256=ifFUcwK-oicnR9QkrEJdskonZvxsN7dB_XwNptm602Y,33197
|
45
|
+
huaweicloudsdkobs/v1/model/get_object_response.py,sha256=ePPt_FiyOrdOmX_nEohYQGoicDxlqdQV2qqTIxD1WjM,18593
|
46
|
+
huaweicloudsdkobs/v1/model/grant.py,sha256=UmcKeLGrwtJJE0ue1SbkIbYs7cis7SD9o36BMKZkag0,4705
|
47
|
+
huaweicloudsdkobs/v1/model/grantee.py,sha256=BYkLrBIk1cXvd3o7iM-k-RVnsw1HYPY2M5xSrlJrdYw,3644
|
48
|
+
huaweicloudsdkobs/v1/model/list_buckets_request.py,sha256=UMcQweCLmQ2bpzKAfCPiLbcPSEQRb57JtK5SUdSMUTE,5362
|
49
|
+
huaweicloudsdkobs/v1/model/list_buckets_response.py,sha256=P0LeowjYGjYNbUW1u1M5XJFl3D8g6RRa4GQW4NUxFlc,9382
|
50
|
+
huaweicloudsdkobs/v1/model/list_objects_request.py,sha256=IhiziG6Fa3144fb4lWwmzWdkPNazsTN2ynolYmx1-R0,16812
|
51
|
+
huaweicloudsdkobs/v1/model/list_objects_response.py,sha256=A_tbi1zLo4L4ztnnXHKbDtzlPXJfhgV-TIBgo3oCyio,18349
|
52
|
+
huaweicloudsdkobs/v1/model/owner.py,sha256=S_reGkoG5lHugVu3aUweKOZwHZJu2zzLJHqR1XM0UrA,2895
|
53
|
+
huaweicloudsdkobs/v1/model/put_object_request.py,sha256=x9aVm1R7NLLNBkr6X_lIRLFXQhXf5wq6o9Wk6uuxQ2I,43986
|
54
|
+
huaweicloudsdkobs/v1/model/put_object_response.py,sha256=ZYBKQb8ubjn5rZFFf1ncFgwMg0pxZT3w0TnCV8c2SFg,14430
|
55
|
+
huaweicloudsdkobs/v1/model/set_bucket_acl_request.py,sha256=YWXkF6VgsOWXrjdAulNdbpjEooczktqz23tzFbPBpSg,7315
|
56
|
+
huaweicloudsdkobs/v1/model/set_bucket_acl_request_body.py,sha256=g6mPwOzgcwzbGbtwv80KgjLJBMqEQw0DCJFxLfB8tPk,4234
|
57
|
+
huaweicloudsdkobs/v1/model/set_bucket_acl_response.py,sha256=PL3wIYUx8lDnoEH7xP608iwEQ60iza0fCNzZewJ74CM,6977
|
58
|
+
huaweicloudsdkobs/v1/model/set_bucket_custom_domain_body.py,sha256=pMCzIiI8G_4Gpht9ct-5_6KEbSwB8p-VRljs21DwoYU,8885
|
59
|
+
huaweicloudsdkobs/v1/model/set_bucket_customedomain_request.py,sha256=J0323LPewtDFvH7h8ZtOLEA5oq1Bu1OM3OUyskIwSyI,7247
|
60
|
+
huaweicloudsdkobs/v1/model/set_bucket_customedomain_response.py,sha256=jjKFIZZKjKFgqq80Y9zMq4ghvze3wRF2yb_9bxagzAg,7267
|
61
|
+
huaweicloudsdkobs/v1/model/set_bucket_notification_request.py,sha256=j7L2nyW5YiMhRVwo8gEILkhzT_uCZNrXI1G5gfQevpM,6528
|
62
|
+
huaweicloudsdkobs/v1/model/set_bucket_notification_request_body.py,sha256=M6ROm3vel0XUOkRYVl47F7y3Vv-KY1KZD-huaxMx42w,5003
|
63
|
+
huaweicloudsdkobs/v1/model/set_bucket_notification_response.py,sha256=1vr6_WBDlG-LeyASk_h12w0J49UWSvOUzOvAKx8eUhs,7238
|
64
|
+
huaweicloudsdkobs/v1/model/topic_configuration.py,sha256=Jb0E-phy1QAdiiqOQQ8sdtTgQxdcHWg0CmaNfOFMYB8,8309
|
65
|
+
huaweicloudsdkobs/v1/model/topic_configuration_filter.py,sha256=qyspT2sAduXdvQltqscYdZSmuwWNIYXMCBVsUNmfhg8,3179
|
66
|
+
huaweicloudsdkobs/v1/region/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
|
+
huaweicloudsdkobs/v1/region/obs_region.py,sha256=n9cfJcnl6pGlJ8Q-H9wTdFstgI2SAyg4dvgl8PK2yI4,3720
|
68
|
+
huaweicloudsdkobs-3.1.160.dist-info/LICENSE,sha256=4_VSTLuxcsybRG9N4Isktlj1rAIBBsfl0Tjc0gBTijo,604
|
69
|
+
huaweicloudsdkobs-3.1.160.dist-info/METADATA,sha256=9Uo3rA5hVNNTiecn1-o_tdgGiuKV6_4U9td-d8oZ1XE,1064
|
70
|
+
huaweicloudsdkobs-3.1.160.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
71
|
+
huaweicloudsdkobs-3.1.160.dist-info/top_level.txt,sha256=TQ9fl_7vXBasHekxzCcB9Rd8PzCKQsH6IE-d0wz9iwk,18
|
72
|
+
huaweicloudsdkobs-3.1.160.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
huaweicloudsdkobs
|