huaweicloudsdkobs 3.1.76__py2.py3-none-any.whl → 3.1.77__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- huaweicloudsdkobs/v1/__init__.py +0 -1
- huaweicloudsdkobs/v1/model/__init__.py +0 -1
- huaweicloudsdkobs/v1/model/bucket.py +15 -15
- huaweicloudsdkobs/v1/model/contents.py +18 -18
- huaweicloudsdkobs/v1/model/copy_object_request.py +78 -78
- huaweicloudsdkobs/v1/model/copy_object_response.py +3 -3
- huaweicloudsdkobs/v1/model/create_bucket_request.py +51 -51
- huaweicloudsdkobs/v1/model/create_bucket_request_body.py +3 -3
- huaweicloudsdkobs/v1/model/delete_bucket_customdomain_request.py +9 -9
- huaweicloudsdkobs/v1/model/delete_bucket_request.py +6 -6
- huaweicloudsdkobs/v1/model/delete_object.py +6 -6
- huaweicloudsdkobs/v1/model/delete_object_request.py +12 -12
- huaweicloudsdkobs/v1/model/delete_objects_request.py +12 -12
- huaweicloudsdkobs/v1/model/delete_objects_request_body.py +6 -6
- huaweicloudsdkobs/v1/model/delete_objects_response.py +3 -3
- huaweicloudsdkobs/v1/model/delete_result_deleted.py +12 -12
- huaweicloudsdkobs/v1/model/delete_result_error.py +9 -9
- huaweicloudsdkobs/v1/model/domains.py +9 -9
- huaweicloudsdkobs/v1/model/filter_rule.py +6 -6
- huaweicloudsdkobs/v1/model/function_stage_configuration.py +12 -12
- huaweicloudsdkobs/v1/model/get_bucket_acl_request.py +9 -9
- huaweicloudsdkobs/v1/model/get_bucket_customdomain_request.py +9 -9
- huaweicloudsdkobs/v1/model/get_bucket_customdomain_response.py +5 -9
- huaweicloudsdkobs/v1/model/get_bucket_metadata_request.py +12 -12
- huaweicloudsdkobs/v1/model/get_bucket_notification_request.py +9 -9
- huaweicloudsdkobs/v1/model/get_object_metadata_request.py +33 -33
- huaweicloudsdkobs/v1/model/get_object_request.py +60 -60
- huaweicloudsdkobs/v1/model/grant.py +6 -6
- huaweicloudsdkobs/v1/model/grantee.py +6 -6
- huaweicloudsdkobs/v1/model/list_buckets_request.py +6 -6
- huaweicloudsdkobs/v1/model/list_buckets_response.py +4 -4
- huaweicloudsdkobs/v1/model/list_objects_request.py +27 -27
- huaweicloudsdkobs/v1/model/list_objects_response.py +27 -27
- huaweicloudsdkobs/v1/model/owner.py +3 -3
- huaweicloudsdkobs/v1/model/put_object_request.py +60 -60
- huaweicloudsdkobs/v1/model/set_bucket_acl_request.py +12 -12
- huaweicloudsdkobs/v1/model/set_bucket_custom_domain_body.py +15 -15
- huaweicloudsdkobs/v1/model/set_bucket_customedomain_request.py +9 -9
- huaweicloudsdkobs/v1/model/set_bucket_notification_request.py +9 -9
- huaweicloudsdkobs/v1/model/topic_configuration.py +9 -9
- huaweicloudsdkobs/v1/obs_async_client.py +543 -557
- huaweicloudsdkobs/v1/obs_client.py +543 -557
- {huaweicloudsdkobs-3.1.76.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/METADATA +2 -2
- huaweicloudsdkobs-3.1.77.dist-info/RECORD +70 -0
- huaweicloudsdkobs/v1/model/buckets.py +0 -117
- huaweicloudsdkobs-3.1.76.dist-info/RECORD +0 -71
- {huaweicloudsdkobs-3.1.76.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/LICENSE +0 -0
- {huaweicloudsdkobs-3.1.76.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/WHEEL +0 -0
- {huaweicloudsdkobs-3.1.76.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/top_level.txt +0 -0
@@ -32,56 +32,33 @@ class ObsAsyncClient(Client):
|
|
32
32
|
|
33
33
|
return client_builder
|
34
34
|
|
35
|
-
def
|
36
|
-
"""
|
35
|
+
def delete_bucket_customdomain_async(self, request):
|
36
|
+
"""Deleting a Custom Domain Name of a Bucket
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
当进行复制对象操作时,目标对象默认复制源对象的元数据;用户也可以将目标对象的元数据替换为本次请求中所带的元数据。新建的目标对象不会复制源对象的ACL信息,默认的新建对象的ACL是private,用户可以使用设置ACL的操作接口来重新设定新对象的ACL。
|
41
|
-
|
42
|
-
复制对象操作的请求需要通过头域携带拷贝的原桶和对象信息,不能携带消息实体。
|
43
|
-
|
44
|
-
该操作支持服务端加密功能。
|
45
|
-
|
46
|
-
目标对象大小范围是[0, 5GB],如果源对象大小超过5GB,只能使用Range拷贝部分对象。
|
47
|
-
|
48
|
-
#### 多版本 ####
|
49
|
-
默认情况下,x-obs-copy-source标识复制源对象的最新版本。如果源对象的最新版本是删除标记,则认为该对象已删除。要复制指定版本的对象,可以在x-obs-copy-source请求消息头中携带versionId参数。
|
50
|
-
|
51
|
-
如果目标对象的桶的多版本状态是开启的,系统为目标对象生成唯一的版本号(此版本号与源对象的版本号不同),并且会在响应报头x-obs-version-id返回该版本号。如果目标对象的桶的多版本状态是暂停的,则目标对象的版本号为null。
|
38
|
+
This operation deletes a custom domain name of a bucket.
|
52
39
|
|
53
|
-
|
54
|
-
在桶没有开启多版本的情况下,将源对象object_A复制为目标对象object_B,如果在复制操作之前对象object_B已经存在,复制操作执行之后老对象object_B则会被新复制对象object_B覆盖,复制成功后,只能下载到新的对象object_B,老对象object_B将会被删除。因此在使用copy接口时请确保目标对象不存在或者已无价值,避免因copy导致数据误删除。复制过程中源对象object_A无任何变化。
|
55
|
-
|
56
|
-
复制对象的结果不能仅根据HTTP返回头域中的status_code来判断请求是否成功,头域中status_code返回200时表示服务端已经收到请求,且开始处理复制对象请求。复制是否成功会在响应消息的body中,只有body体中有ETag标签才表示成功,否则表示复制失败。
|
57
|
-
|
58
|
-
#### 归档存储对象 ####
|
59
|
-
如果源对象是归档存储对象,需要判断源对象的取回状态,只有当源对象处于已取回状态时,才能复制成功。源对象未取回或者正在取回时,会复制失败,返回错误403 Forbidden。异常描述为:
|
60
|
-
|
61
|
-
ErrorCode: InvalidObjectState
|
62
|
-
|
63
|
-
ErrorMessage: Operation is not valid for the source object's storage class
|
40
|
+
To use this operation, you must have the **PutBucketcustomdomain** permission. The bucket owner can perform this operation by default and can grant this permission to others by using a bucket policy or a user policy.
|
64
41
|
|
65
42
|
Please refer to HUAWEI cloud API Explorer for details.
|
66
43
|
|
67
44
|
|
68
|
-
:param request: Request instance for
|
69
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
70
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
45
|
+
:param request: Request instance for DeleteBucketCustomdomain
|
46
|
+
:type request: :class:`huaweicloudsdkobs.v1.DeleteBucketCustomdomainRequest`
|
47
|
+
:rtype: :class:`huaweicloudsdkobs.v1.DeleteBucketCustomdomainResponse`
|
71
48
|
"""
|
72
|
-
http_info = self.
|
49
|
+
http_info = self._delete_bucket_customdomain_http_info(request)
|
73
50
|
return self._call_api(**http_info)
|
74
51
|
|
75
|
-
def
|
76
|
-
http_info = self.
|
52
|
+
def delete_bucket_customdomain_async_invoker(self, request):
|
53
|
+
http_info = self._delete_bucket_customdomain_http_info(request)
|
77
54
|
return AsyncInvoker(self, http_info)
|
78
55
|
|
79
|
-
def
|
56
|
+
def _delete_bucket_customdomain_http_info(self, request):
|
80
57
|
http_info = {
|
81
|
-
"method": "
|
82
|
-
"resource_path": "/
|
58
|
+
"method": "DELETE",
|
59
|
+
"resource_path": "/",
|
83
60
|
"request_type": request.__class__.__name__,
|
84
|
-
"response_type": "
|
61
|
+
"response_type": "DeleteBucketCustomdomainResponse"
|
85
62
|
}
|
86
63
|
|
87
64
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -91,62 +68,16 @@ class ObsAsyncClient(Client):
|
|
91
68
|
collection_formats = {}
|
92
69
|
|
93
70
|
path_params = {}
|
94
|
-
if 'object_key' in local_var_params:
|
95
|
-
path_params['object_key'] = local_var_params['object_key']
|
96
71
|
|
97
72
|
query_params = []
|
98
73
|
if 'bucket_name' in local_var_params:
|
99
74
|
cname = local_var_params['bucket_name']
|
75
|
+
if 'customdomain' in local_var_params:
|
76
|
+
query_params.append(('customdomain', local_var_params['customdomain']))
|
100
77
|
|
101
78
|
header_params = {}
|
102
79
|
if 'date' in local_var_params:
|
103
80
|
header_params['Date'] = local_var_params['date']
|
104
|
-
if 'x_obs_acl' in local_var_params:
|
105
|
-
header_params['x-obs-acl'] = local_var_params['x_obs_acl']
|
106
|
-
if 'x_obs_grant_read' in local_var_params:
|
107
|
-
header_params['x-obs-grant-read'] = local_var_params['x_obs_grant_read']
|
108
|
-
if 'x_obs_grant_read_acp' in local_var_params:
|
109
|
-
header_params['x-obs-grant-read-acp'] = local_var_params['x_obs_grant_read_acp']
|
110
|
-
if 'x_obs_grant_write_acp' in local_var_params:
|
111
|
-
header_params['x-obs-grant-write-acp'] = local_var_params['x_obs_grant_write_acp']
|
112
|
-
if 'x_obs_grant_full_control' in local_var_params:
|
113
|
-
header_params['x-obs-grant-full-control'] = local_var_params['x_obs_grant_full_control']
|
114
|
-
if 'x_obs_copy_source' in local_var_params:
|
115
|
-
header_params['x-obs-copy-source'] = local_var_params['x_obs_copy_source']
|
116
|
-
if 'x_obs_metadata_directive' in local_var_params:
|
117
|
-
header_params['x-obs-metadata-directive'] = local_var_params['x_obs_metadata_directive']
|
118
|
-
if 'x_obs_copy_source_if_match' in local_var_params:
|
119
|
-
header_params['x-obs-copy-source-if-match'] = local_var_params['x_obs_copy_source_if_match']
|
120
|
-
if 'x_obs_copy_source_if_none_match' in local_var_params:
|
121
|
-
header_params['x-obs-copy-source-if-none-match'] = local_var_params['x_obs_copy_source_if_none_match']
|
122
|
-
if 'x_obs_copy_source_if_unmodified_since' in local_var_params:
|
123
|
-
header_params['x-obs-copy-source-if-unmodified-since'] = local_var_params['x_obs_copy_source_if_unmodified_since']
|
124
|
-
if 'x_obs_copy_source_if_modified_since' in local_var_params:
|
125
|
-
header_params['x-obs-copy-source-if-modified-since'] = local_var_params['x_obs_copy_source_if_modified_since']
|
126
|
-
if 'x_obs_storage_class' in local_var_params:
|
127
|
-
header_params['x-obs-storage-class'] = local_var_params['x_obs_storage_class']
|
128
|
-
if 'x_obs_persistent_headers' in local_var_params:
|
129
|
-
header_params['x-obs-persistent-headers'] = local_var_params['x_obs_persistent_headers']
|
130
|
-
if 'x_obs_website_redirect_location' in local_var_params:
|
131
|
-
header_params['x-obs-website-redirect-location'] = local_var_params['x_obs_website_redirect_location']
|
132
|
-
if 'x_obs_server_side_encryption' in local_var_params:
|
133
|
-
header_params['x-obs-server-side-encryption'] = local_var_params['x_obs_server_side_encryption']
|
134
|
-
if 'x_obs_server_side_encryption_kms_key_id' in local_var_params:
|
135
|
-
header_params['x-obs-server-side-encryption-kms-key-id'] = local_var_params['x_obs_server_side_encryption_kms_key_id']
|
136
|
-
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
137
|
-
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
138
|
-
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
139
|
-
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
140
|
-
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
141
|
-
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
142
|
-
if 'x_obs_copy_source_server_side_encryption_customer_algorithm' in local_var_params:
|
143
|
-
header_params['x-obs-copy-source-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_copy_source_server_side_encryption_customer_algorithm']
|
144
|
-
if 'x_obs_copy_source_server_side_encryption_customer_key' in local_var_params:
|
145
|
-
header_params['x-obs-copy-source-server-side-encryption-customer-key'] = local_var_params['x_obs_copy_source_server_side_encryption_customer_key']
|
146
|
-
if 'x_obs_copy_source_server_side_encryption_customer_key_md5' in local_var_params:
|
147
|
-
header_params['x-obs-copy-source-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_copy_source_server_side_encryption_customer_key_md5']
|
148
|
-
if 'success_action_redirect' in local_var_params:
|
149
|
-
header_params['success_action_redirect'] = local_var_params['success_action_redirect']
|
150
81
|
|
151
82
|
form_params = {}
|
152
83
|
|
@@ -154,7 +85,7 @@ class ObsAsyncClient(Client):
|
|
154
85
|
if isinstance(request, SdkStreamRequest):
|
155
86
|
body = request.get_file_stream()
|
156
87
|
|
157
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
88
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
158
89
|
|
159
90
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
160
91
|
['application/json'])
|
@@ -172,46 +103,31 @@ class ObsAsyncClient(Client):
|
|
172
103
|
|
173
104
|
return http_info
|
174
105
|
|
175
|
-
def
|
176
|
-
"""
|
106
|
+
def get_bucket_acl_async(self, request):
|
107
|
+
"""Obtaining a Bucket ACL
|
177
108
|
|
178
|
-
|
179
|
-
|
180
|
-
说明:
|
181
|
-
默认情况下,一个用户可以拥有的桶的数量不能超过100个。
|
182
|
-
用户删除桶后,需要等待30分钟才能创建同名桶和并行文件系统。
|
183
|
-
OBS支持在创建桶时指定桶的AZ类型,您可以开启或关闭多AZ。关闭多AZ时,桶内数据默认存储在单个AZ内;开启多AZ时,桶内数据冗余存储在多个AZ内,可靠性更高。旧桶AZ类型默认为单AZ。
|
184
|
-
新创建桶的桶名在OBS中必须是唯一的。如果是同一个用户重复创建同一区域的同名桶时返回成功。除此以外的其他场景重复创建同名桶返回桶已存在。用户可以在请求消息头中加入x-obs-acl等参数,设置要创建桶的权限控制策略。
|
185
|
-
|
186
|
-
#### 存储类型 ####
|
187
|
-
允许用户创建不同默认存储类型的桶。发送创桶请求时携带头域“x-obs-storage-class”来指定桶的默认存储类型。桶内对象的存储类型与桶默认存储类型保持一致。存储类型有3种:STANDARD(标准存储)、WARM(低频访问存储)、COLD(归档存储)。如果没有携带此头域 ,则创建的桶为标准存储类型。
|
188
|
-
|
189
|
-
当往桶内上传对象时,如果没有指定对象的存储类别(参考PUT上传),则该对象的存储类型取桶的默认存储类型。
|
190
|
-
|
191
|
-
OBS标准存储拥有低访问时延和较高的吞吐量,因而适用于有大量热点文件需要频繁访问数据的业务场景,例如:大数据、移动应用、热点视频、社交图片等场景。
|
192
|
-
OBS低频访问存储适用于不频繁访问(少于每月一次访问)但在需要时也要求快速访问数据的业务场景,例如:文件同步/共享、企业备份等场景。与标准存储相比,低频访问存储有相同的数据持久性、吞吐量以及访问时延,且成本较低,但是可用性略低于标准存储。
|
193
|
-
OBS归档存储适用于很少访问(平均一年访问一次)数据的业务场景,例如:数据归档、长期备份等场景。归档存储安全、持久且成本极低,可以用来替代磁带库。为了保持成本低廉,数据取回时间可能长达数分钟到数小时不等。
|
109
|
+
This operation returns the ACL of a bucket. To use this operation, you must have the **READ_ACP** or **FULL_CONTROL** permission for the bucket.
|
194
110
|
|
195
111
|
Please refer to HUAWEI cloud API Explorer for details.
|
196
112
|
|
197
113
|
|
198
|
-
:param request: Request instance for
|
199
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
200
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
114
|
+
:param request: Request instance for GetBucketAcl
|
115
|
+
:type request: :class:`huaweicloudsdkobs.v1.GetBucketAclRequest`
|
116
|
+
:rtype: :class:`huaweicloudsdkobs.v1.GetBucketAclResponse`
|
201
117
|
"""
|
202
|
-
http_info = self.
|
118
|
+
http_info = self._get_bucket_acl_http_info(request)
|
203
119
|
return self._call_api(**http_info)
|
204
120
|
|
205
|
-
def
|
206
|
-
http_info = self.
|
121
|
+
def get_bucket_acl_async_invoker(self, request):
|
122
|
+
http_info = self._get_bucket_acl_http_info(request)
|
207
123
|
return AsyncInvoker(self, http_info)
|
208
124
|
|
209
|
-
def
|
125
|
+
def _get_bucket_acl_http_info(self, request):
|
210
126
|
http_info = {
|
211
|
-
"method": "
|
127
|
+
"method": "GET",
|
212
128
|
"resource_path": "/",
|
213
129
|
"request_type": request.__class__.__name__,
|
214
|
-
"response_type": "
|
130
|
+
"response_type": "GetBucketAclResponse"
|
215
131
|
}
|
216
132
|
|
217
133
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -225,53 +141,23 @@ class ObsAsyncClient(Client):
|
|
225
141
|
query_params = []
|
226
142
|
if 'bucket_name' in local_var_params:
|
227
143
|
cname = local_var_params['bucket_name']
|
144
|
+
if 'acl' in local_var_params:
|
145
|
+
query_params.append(('acl', local_var_params['acl']))
|
228
146
|
|
229
147
|
header_params = {}
|
230
148
|
if 'date' in local_var_params:
|
231
149
|
header_params['Date'] = local_var_params['date']
|
232
|
-
if 'x_obs_acl' in local_var_params:
|
233
|
-
header_params['x-obs-acl'] = local_var_params['x_obs_acl']
|
234
|
-
if 'x_obs_storage_class' in local_var_params:
|
235
|
-
header_params['x-obs-storage-class'] = local_var_params['x_obs_storage_class']
|
236
|
-
if 'x_obs_grant_read' in local_var_params:
|
237
|
-
header_params['x-obs-grant-read'] = local_var_params['x_obs_grant_read']
|
238
|
-
if 'x_obs_grant_write' in local_var_params:
|
239
|
-
header_params['x-obs-grant-write'] = local_var_params['x_obs_grant_write']
|
240
|
-
if 'x_obs_grant_read_acp' in local_var_params:
|
241
|
-
header_params['x-obs-grant-read-acp'] = local_var_params['x_obs_grant_read_acp']
|
242
|
-
if 'x_obs_grant_write_acp' in local_var_params:
|
243
|
-
header_params['x-obs-grant-write-acp'] = local_var_params['x_obs_grant_write_acp']
|
244
|
-
if 'x_obs_grant_full_control' in local_var_params:
|
245
|
-
header_params['x-obs-grant-full-control'] = local_var_params['x_obs_grant_full_control']
|
246
|
-
if 'x_obs_grant_read_delivered' in local_var_params:
|
247
|
-
header_params['x-obs-grant-read-delivered'] = local_var_params['x_obs_grant_read_delivered']
|
248
|
-
if 'x_obs_grant_full_control_delivered' in local_var_params:
|
249
|
-
header_params['x-obs-grant-full-control-delivered'] = local_var_params['x_obs_grant_full_control_delivered']
|
250
|
-
if 'x_obs_az_redundancy' in local_var_params:
|
251
|
-
header_params['x-obs-az-redundancy'] = local_var_params['x_obs_az_redundancy']
|
252
|
-
if 'x_obs_fs_file_interface' in local_var_params:
|
253
|
-
header_params['x-obs-fs-file-interface'] = local_var_params['x_obs_fs_file_interface']
|
254
|
-
if 'x_obs_epid' in local_var_params:
|
255
|
-
header_params['x-obs-epid'] = local_var_params['x_obs_epid']
|
256
|
-
if 'x_obs_cluster_type' in local_var_params:
|
257
|
-
header_params['x-obs-cluster-type'] = local_var_params['x_obs_cluster_type']
|
258
|
-
if 'x_obs_location_clustergroup_id' in local_var_params:
|
259
|
-
header_params['x-obs-location-clustergroup-id'] = local_var_params['x_obs_location_clustergroup_id']
|
260
|
-
if 'x_obs_ies_location' in local_var_params:
|
261
|
-
header_params['x-obs-ies-location'] = local_var_params['x_obs_ies_location']
|
262
150
|
|
263
151
|
form_params = {}
|
264
152
|
|
265
153
|
body = None
|
266
|
-
if 'body' in local_var_params:
|
267
|
-
body = local_var_params['body']
|
268
154
|
if isinstance(request, SdkStreamRequest):
|
269
155
|
body = request.get_file_stream()
|
270
156
|
|
271
157
|
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
272
158
|
|
273
159
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
274
|
-
['application/
|
160
|
+
['application/json'])
|
275
161
|
|
276
162
|
auth_settings = []
|
277
163
|
|
@@ -286,33 +172,35 @@ class ObsAsyncClient(Client):
|
|
286
172
|
|
287
173
|
return http_info
|
288
174
|
|
289
|
-
def
|
290
|
-
"""
|
175
|
+
def get_bucket_customdomain_async(self, request):
|
176
|
+
"""Getting a Custom Domain Name of a Bucket
|
291
177
|
|
292
|
-
|
293
|
-
|
294
|
-
|
178
|
+
This operation gets a custom domain name of a bucket.
|
179
|
+
|
180
|
+
To use this operation, you must have the **GetBucketcustomdomainConfiguration** permission. The bucket owner has this permission by default and can grant it to others.
|
181
|
+
|
182
|
+
For details about permission control, see the [permission control](https://support.huaweicloud.com/intl/en-us/perms-cfg-obs/obs_40_0001.html) in the *Object Storage Service Permissions Configuration Guide*.
|
295
183
|
|
296
184
|
Please refer to HUAWEI cloud API Explorer for details.
|
297
185
|
|
298
186
|
|
299
|
-
:param request: Request instance for
|
300
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
301
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
187
|
+
:param request: Request instance for GetBucketCustomdomain
|
188
|
+
:type request: :class:`huaweicloudsdkobs.v1.GetBucketCustomdomainRequest`
|
189
|
+
:rtype: :class:`huaweicloudsdkobs.v1.GetBucketCustomdomainResponse`
|
302
190
|
"""
|
303
|
-
http_info = self.
|
191
|
+
http_info = self._get_bucket_customdomain_http_info(request)
|
304
192
|
return self._call_api(**http_info)
|
305
193
|
|
306
|
-
def
|
307
|
-
http_info = self.
|
194
|
+
def get_bucket_customdomain_async_invoker(self, request):
|
195
|
+
http_info = self._get_bucket_customdomain_http_info(request)
|
308
196
|
return AsyncInvoker(self, http_info)
|
309
197
|
|
310
|
-
def
|
198
|
+
def _get_bucket_customdomain_http_info(self, request):
|
311
199
|
http_info = {
|
312
|
-
"method": "
|
200
|
+
"method": "GET",
|
313
201
|
"resource_path": "/",
|
314
202
|
"request_type": request.__class__.__name__,
|
315
|
-
"response_type": "
|
203
|
+
"response_type": "GetBucketCustomdomainResponse"
|
316
204
|
}
|
317
205
|
|
318
206
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -326,6 +214,8 @@ class ObsAsyncClient(Client):
|
|
326
214
|
query_params = []
|
327
215
|
if 'bucket_name' in local_var_params:
|
328
216
|
cname = local_var_params['bucket_name']
|
217
|
+
if 'customdomain' in local_var_params:
|
218
|
+
query_params.append(('customdomain', local_var_params['customdomain']))
|
329
219
|
|
330
220
|
header_params = {}
|
331
221
|
if 'date' in local_var_params:
|
@@ -355,33 +245,33 @@ class ObsAsyncClient(Client):
|
|
355
245
|
|
356
246
|
return http_info
|
357
247
|
|
358
|
-
def
|
359
|
-
"""
|
248
|
+
def get_bucket_notification_async(self, request):
|
249
|
+
"""Getting the Notification Configuration of a Bucket
|
360
250
|
|
361
|
-
|
251
|
+
This operation returns the notification configuration of a bucket.
|
362
252
|
|
363
|
-
|
253
|
+
To use this operation, you must have the **GetBucketNotification** permission. The bucket owner has this permission by default and can grant it to others by using a bucket policy or a user policy.
|
364
254
|
|
365
255
|
Please refer to HUAWEI cloud API Explorer for details.
|
366
256
|
|
367
257
|
|
368
|
-
:param request: Request instance for
|
369
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
370
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
258
|
+
:param request: Request instance for GetBucketNotification
|
259
|
+
:type request: :class:`huaweicloudsdkobs.v1.GetBucketNotificationRequest`
|
260
|
+
:rtype: :class:`huaweicloudsdkobs.v1.GetBucketNotificationResponse`
|
371
261
|
"""
|
372
|
-
http_info = self.
|
262
|
+
http_info = self._get_bucket_notification_http_info(request)
|
373
263
|
return self._call_api(**http_info)
|
374
264
|
|
375
|
-
def
|
376
|
-
http_info = self.
|
265
|
+
def get_bucket_notification_async_invoker(self, request):
|
266
|
+
http_info = self._get_bucket_notification_http_info(request)
|
377
267
|
return AsyncInvoker(self, http_info)
|
378
268
|
|
379
|
-
def
|
269
|
+
def _get_bucket_notification_http_info(self, request):
|
380
270
|
http_info = {
|
381
|
-
"method": "
|
271
|
+
"method": "GET",
|
382
272
|
"resource_path": "/",
|
383
273
|
"request_type": request.__class__.__name__,
|
384
|
-
"response_type": "
|
274
|
+
"response_type": "GetBucketNotificationResponse"
|
385
275
|
}
|
386
276
|
|
387
277
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -395,8 +285,8 @@ class ObsAsyncClient(Client):
|
|
395
285
|
query_params = []
|
396
286
|
if 'bucket_name' in local_var_params:
|
397
287
|
cname = local_var_params['bucket_name']
|
398
|
-
if '
|
399
|
-
query_params.append(('
|
288
|
+
if 'notification' in local_var_params:
|
289
|
+
query_params.append(('notification', local_var_params['notification']))
|
400
290
|
|
401
291
|
header_params = {}
|
402
292
|
if 'date' in local_var_params:
|
@@ -426,36 +316,35 @@ class ObsAsyncClient(Client):
|
|
426
316
|
|
427
317
|
return http_info
|
428
318
|
|
429
|
-
def
|
430
|
-
"""
|
319
|
+
def set_bucket_acl_async(self, request):
|
320
|
+
"""Configuring a Bucket ACL
|
431
321
|
|
432
|
-
|
322
|
+
This operation controls access to a bucket. By default, only the bucket creator has the read and write permissions on the bucket. You can also customize access policies for a bucket, for example, configuring a public read policy for the bucket to allow all users to read it.
|
433
323
|
|
434
|
-
|
435
|
-
当桶的多版本状态是开启时,不指定版本删除对象将产生一个带唯一版本号的删除标记,并不删除对象;当桶的多版本状态是Suspended时,不指定版本删除将删除版本号为null的对象,并将产生一个版本号为null的删除标记。
|
324
|
+
You can configure an ACL when creating a bucket, or modify or obtain the bucket ACL using API calls. A bucket ACL supports a maximum of 100 grants. The PUT method is idempotent. With this method, a new bucket ACL will overwrite the previous bucket ACL. To modify or delete an ACL, you just need to create a new one using the PUT method.
|
436
325
|
|
437
|
-
|
326
|
+
For details about how to use bucket ACLs to control permissions, see the [OBS permission control](https://support.huaweicloud.com/intl/en-us/perms-cfg-obs/obs_40_0001.html) in the *Object Storage Service Permissions Configuration Guide*.
|
438
327
|
|
439
328
|
Please refer to HUAWEI cloud API Explorer for details.
|
440
329
|
|
441
330
|
|
442
|
-
:param request: Request instance for
|
443
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
444
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
331
|
+
:param request: Request instance for SetBucketAcl
|
332
|
+
:type request: :class:`huaweicloudsdkobs.v1.SetBucketAclRequest`
|
333
|
+
:rtype: :class:`huaweicloudsdkobs.v1.SetBucketAclResponse`
|
445
334
|
"""
|
446
|
-
http_info = self.
|
335
|
+
http_info = self._set_bucket_acl_http_info(request)
|
447
336
|
return self._call_api(**http_info)
|
448
337
|
|
449
|
-
def
|
450
|
-
http_info = self.
|
338
|
+
def set_bucket_acl_async_invoker(self, request):
|
339
|
+
http_info = self._set_bucket_acl_http_info(request)
|
451
340
|
return AsyncInvoker(self, http_info)
|
452
341
|
|
453
|
-
def
|
342
|
+
def _set_bucket_acl_http_info(self, request):
|
454
343
|
http_info = {
|
455
|
-
"method": "
|
456
|
-
"resource_path": "/
|
344
|
+
"method": "PUT",
|
345
|
+
"resource_path": "/",
|
457
346
|
"request_type": request.__class__.__name__,
|
458
|
-
"response_type": "
|
347
|
+
"response_type": "SetBucketAclResponse"
|
459
348
|
}
|
460
349
|
|
461
350
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -465,29 +354,31 @@ class ObsAsyncClient(Client):
|
|
465
354
|
collection_formats = {}
|
466
355
|
|
467
356
|
path_params = {}
|
468
|
-
if 'object_key' in local_var_params:
|
469
|
-
path_params['object_key'] = local_var_params['object_key']
|
470
357
|
|
471
358
|
query_params = []
|
472
359
|
if 'bucket_name' in local_var_params:
|
473
360
|
cname = local_var_params['bucket_name']
|
474
|
-
if '
|
475
|
-
query_params.append(('
|
361
|
+
if 'acl' in local_var_params:
|
362
|
+
query_params.append(('acl', local_var_params['acl']))
|
476
363
|
|
477
364
|
header_params = {}
|
478
365
|
if 'date' in local_var_params:
|
479
366
|
header_params['Date'] = local_var_params['date']
|
367
|
+
if 'x_obs_acl' in local_var_params:
|
368
|
+
header_params['x-obs-acl'] = local_var_params['x_obs_acl']
|
480
369
|
|
481
370
|
form_params = {}
|
482
371
|
|
483
372
|
body = None
|
373
|
+
if 'body' in local_var_params:
|
374
|
+
body = local_var_params['body']
|
484
375
|
if isinstance(request, SdkStreamRequest):
|
485
376
|
body = request.get_file_stream()
|
486
377
|
|
487
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date",
|
378
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
488
379
|
|
489
380
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
490
|
-
['application/
|
381
|
+
['application/xml'])
|
491
382
|
|
492
383
|
auth_settings = []
|
493
384
|
|
@@ -502,35 +393,33 @@ class ObsAsyncClient(Client):
|
|
502
393
|
|
503
394
|
return http_info
|
504
395
|
|
505
|
-
def
|
506
|
-
"""
|
396
|
+
def set_bucket_customedomain_async(self, request):
|
397
|
+
"""Configuring a Custom Domain Name for a Bucket
|
507
398
|
|
508
|
-
|
399
|
+
This operation configures a custom domain name for a bucket. After the configuration is successful, you can access the bucket using its custom domain name.
|
509
400
|
|
510
|
-
|
511
|
-
|
512
|
-
批量删除的请求消息头中必须包含Content-MD5以及Content-Length,用以保证请求的消息体在服务端检测到网络传输如果有错,则可以检测出来。
|
401
|
+
Ensure that DNS can resolve the custom domain name to OBS.
|
513
402
|
|
514
403
|
Please refer to HUAWEI cloud API Explorer for details.
|
515
404
|
|
516
405
|
|
517
|
-
:param request: Request instance for
|
518
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
519
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
406
|
+
:param request: Request instance for SetBucketCustomedomain
|
407
|
+
:type request: :class:`huaweicloudsdkobs.v1.SetBucketCustomedomainRequest`
|
408
|
+
:rtype: :class:`huaweicloudsdkobs.v1.SetBucketCustomedomainResponse`
|
520
409
|
"""
|
521
|
-
http_info = self.
|
410
|
+
http_info = self._set_bucket_customedomain_http_info(request)
|
522
411
|
return self._call_api(**http_info)
|
523
412
|
|
524
|
-
def
|
525
|
-
http_info = self.
|
413
|
+
def set_bucket_customedomain_async_invoker(self, request):
|
414
|
+
http_info = self._set_bucket_customedomain_http_info(request)
|
526
415
|
return AsyncInvoker(self, http_info)
|
527
416
|
|
528
|
-
def
|
417
|
+
def _set_bucket_customedomain_http_info(self, request):
|
529
418
|
http_info = {
|
530
|
-
"method": "
|
419
|
+
"method": "PUT",
|
531
420
|
"resource_path": "/",
|
532
421
|
"request_type": request.__class__.__name__,
|
533
|
-
"response_type": "
|
422
|
+
"response_type": "SetBucketCustomedomainResponse"
|
534
423
|
}
|
535
424
|
|
536
425
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -544,12 +433,10 @@ class ObsAsyncClient(Client):
|
|
544
433
|
query_params = []
|
545
434
|
if 'bucket_name' in local_var_params:
|
546
435
|
cname = local_var_params['bucket_name']
|
547
|
-
if '
|
548
|
-
query_params.append(('
|
436
|
+
if 'customdomain' in local_var_params:
|
437
|
+
query_params.append(('customdomain', local_var_params['customdomain']))
|
549
438
|
|
550
439
|
header_params = {}
|
551
|
-
if 'content_md5' in local_var_params:
|
552
|
-
header_params['Content-MD5'] = local_var_params['content_md5']
|
553
440
|
if 'date' in local_var_params:
|
554
441
|
header_params['Date'] = local_var_params['date']
|
555
442
|
|
@@ -579,31 +466,40 @@ class ObsAsyncClient(Client):
|
|
579
466
|
|
580
467
|
return http_info
|
581
468
|
|
582
|
-
def
|
583
|
-
"""
|
469
|
+
def set_bucket_notification_async(self, request):
|
470
|
+
"""Configuring Notifications for a Bucket
|
584
471
|
|
585
|
-
|
472
|
+
This operation configures event notifications for your OBS bucket so that you can receive notifications when certain events happen in your bucket.
|
473
|
+
|
474
|
+
By default, a bucket has no event notifications configured. In this case, the bucket has an empty **NotificationConfiguration**. If a bucket has event notifications configured, you can add an empty **NotificationConfiguration** to disable notifications.
|
475
|
+
|
476
|
+
<NotificationConfiguration>
|
477
|
+
</NotificationConfiguration>
|
478
|
+
|
479
|
+
OBS currently supports event notifications relying on Simple Message Notification (SMN) and FunctionGraph. Take SMN as an example. After receiving an event notification configuration request, OBS verifies whether the specified SMN topic exists and whether the topic is authorized to OBS. If the topic exists and is authorized to OBS, OBS sends a test notification to the topic subscriber..
|
480
|
+
|
481
|
+
To use this operation, you must have the **PutBucketNotification** permission. The bucket owner has this permission by default and can grant it to others by using a bucket policy.
|
586
482
|
|
587
483
|
Please refer to HUAWEI cloud API Explorer for details.
|
588
484
|
|
589
485
|
|
590
|
-
:param request: Request instance for
|
591
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
592
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
486
|
+
:param request: Request instance for SetBucketNotification
|
487
|
+
:type request: :class:`huaweicloudsdkobs.v1.SetBucketNotificationRequest`
|
488
|
+
:rtype: :class:`huaweicloudsdkobs.v1.SetBucketNotificationResponse`
|
593
489
|
"""
|
594
|
-
http_info = self.
|
490
|
+
http_info = self._set_bucket_notification_http_info(request)
|
595
491
|
return self._call_api(**http_info)
|
596
492
|
|
597
|
-
def
|
598
|
-
http_info = self.
|
493
|
+
def set_bucket_notification_async_invoker(self, request):
|
494
|
+
http_info = self._set_bucket_notification_http_info(request)
|
599
495
|
return AsyncInvoker(self, http_info)
|
600
496
|
|
601
|
-
def
|
497
|
+
def _set_bucket_notification_http_info(self, request):
|
602
498
|
http_info = {
|
603
|
-
"method": "
|
499
|
+
"method": "PUT",
|
604
500
|
"resource_path": "/",
|
605
501
|
"request_type": request.__class__.__name__,
|
606
|
-
"response_type": "
|
502
|
+
"response_type": "SetBucketNotificationResponse"
|
607
503
|
}
|
608
504
|
|
609
505
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -617,8 +513,8 @@ class ObsAsyncClient(Client):
|
|
617
513
|
query_params = []
|
618
514
|
if 'bucket_name' in local_var_params:
|
619
515
|
cname = local_var_params['bucket_name']
|
620
|
-
if '
|
621
|
-
query_params.append(('
|
516
|
+
if 'notification' in local_var_params:
|
517
|
+
query_params.append(('notification', local_var_params['notification']))
|
622
518
|
|
623
519
|
header_params = {}
|
624
520
|
if 'date' in local_var_params:
|
@@ -627,13 +523,15 @@ class ObsAsyncClient(Client):
|
|
627
523
|
form_params = {}
|
628
524
|
|
629
525
|
body = None
|
526
|
+
if 'body' in local_var_params:
|
527
|
+
body = local_var_params['body']
|
630
528
|
if isinstance(request, SdkStreamRequest):
|
631
529
|
body = request.get_file_stream()
|
632
530
|
|
633
531
|
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
634
532
|
|
635
533
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
636
|
-
['application/
|
534
|
+
['application/xml'])
|
637
535
|
|
638
536
|
auth_settings = []
|
639
537
|
|
@@ -648,35 +546,46 @@ class ObsAsyncClient(Client):
|
|
648
546
|
|
649
547
|
return http_info
|
650
548
|
|
651
|
-
def
|
652
|
-
"""
|
549
|
+
def create_bucket_async(self, request):
|
550
|
+
"""Creating a Bucket
|
653
551
|
|
654
|
-
|
552
|
+
This operation creates a new bucket.
|
553
|
+
|
554
|
+
Note:
|
555
|
+
By default, a user can have a maximum of 100 buckets.
|
556
|
+
The name of a deleted bucket can be reused for another bucket or a parallel file system at least 30 minutes later after the deletion.
|
557
|
+
When creating a bucket in OBS, you can enable the multi-AZ storage for the bucket or disable it. With the multi-AZ storage disabled, data in a bucket is stored in a single AZ by default. With the multi-AZ storage enabled, data in a bucket is stored redundantly in multiple AZs, improving reliability. Old buckets use single-AZ storage by default.
|
558
|
+
A bucket name must be unique in OBS. If you create namesake buckets in the same region, a success message is returned. In other cases, if namesake buckets are created, an error message will be returned, indicating that the bucket already exists. You can add parameters like **x-obs-acl** in request headers to configure access control policies for a bucket.
|
655
559
|
|
656
|
-
|
560
|
+
**Storage Classes**
|
561
|
+
You can create buckets with different storage classes. In a bucket creation request, add the **x-obs-storage-class** header to specify the default storage class for a bucket. The storage class of objects in a bucket defaults to that of the bucket. There are three storage classes: Standard (STANDARD), Infrequent Access (WARM), and Archive (COLD). If **x-obs-storage-class** is not included in a bucket creation request, the bucket is created in the Standard storage class.
|
657
562
|
|
658
|
-
|
563
|
+
When uploading an object, if you do not specify a storage class for the object (see the upload with PUT), it inherits the storage class of the bucket by default.
|
564
|
+
|
565
|
+
The OBS Standard features low latency and high throughput. It is good for storing frequently accessed files. Its application scenarios include big data analytics, mobile apps, hot videos, and social apps.
|
566
|
+
The OBS Infrequent Access is for storing data that is infrequently (less than 12 times per year) accessed, but when needed, the access has to be fast. It can be used for file synchronization, file sharing, enterprise backups, and many other scenarios. It has the same durability, low latency, and high throughput as the Standard storage class, with a lower cost, but its availability is slightly lower than the Standard storage class.
|
567
|
+
The OBS Archive is for storing data that is rarely (once per year) accessed. The application scenarios include data archive and long-term backup storage. It is secure and durable and delivers the lowest cost among the three storage classes. The OBS Archive storage class can be used to replace tape libraries. To keep cost low, it may take hours to restore data from the Archive storage class.
|
659
568
|
|
660
569
|
Please refer to HUAWEI cloud API Explorer for details.
|
661
570
|
|
662
571
|
|
663
|
-
:param request: Request instance for
|
664
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
665
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
572
|
+
:param request: Request instance for CreateBucket
|
573
|
+
:type request: :class:`huaweicloudsdkobs.v1.CreateBucketRequest`
|
574
|
+
:rtype: :class:`huaweicloudsdkobs.v1.CreateBucketResponse`
|
666
575
|
"""
|
667
|
-
http_info = self.
|
576
|
+
http_info = self._create_bucket_http_info(request)
|
668
577
|
return self._call_api(**http_info)
|
669
578
|
|
670
|
-
def
|
671
|
-
http_info = self.
|
579
|
+
def create_bucket_async_invoker(self, request):
|
580
|
+
http_info = self._create_bucket_http_info(request)
|
672
581
|
return AsyncInvoker(self, http_info)
|
673
582
|
|
674
|
-
def
|
583
|
+
def _create_bucket_http_info(self, request):
|
675
584
|
http_info = {
|
676
|
-
"method": "
|
585
|
+
"method": "PUT",
|
677
586
|
"resource_path": "/",
|
678
587
|
"request_type": request.__class__.__name__,
|
679
|
-
"response_type": "
|
588
|
+
"response_type": "CreateBucketResponse"
|
680
589
|
}
|
681
590
|
|
682
591
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -690,23 +599,53 @@ class ObsAsyncClient(Client):
|
|
690
599
|
query_params = []
|
691
600
|
if 'bucket_name' in local_var_params:
|
692
601
|
cname = local_var_params['bucket_name']
|
693
|
-
if 'customdomain' in local_var_params:
|
694
|
-
query_params.append(('customdomain', local_var_params['customdomain']))
|
695
602
|
|
696
603
|
header_params = {}
|
697
604
|
if 'date' in local_var_params:
|
698
605
|
header_params['Date'] = local_var_params['date']
|
606
|
+
if 'x_obs_acl' in local_var_params:
|
607
|
+
header_params['x-obs-acl'] = local_var_params['x_obs_acl']
|
608
|
+
if 'x_obs_storage_class' in local_var_params:
|
609
|
+
header_params['x-obs-storage-class'] = local_var_params['x_obs_storage_class']
|
610
|
+
if 'x_obs_grant_read' in local_var_params:
|
611
|
+
header_params['x-obs-grant-read'] = local_var_params['x_obs_grant_read']
|
612
|
+
if 'x_obs_grant_write' in local_var_params:
|
613
|
+
header_params['x-obs-grant-write'] = local_var_params['x_obs_grant_write']
|
614
|
+
if 'x_obs_grant_read_acp' in local_var_params:
|
615
|
+
header_params['x-obs-grant-read-acp'] = local_var_params['x_obs_grant_read_acp']
|
616
|
+
if 'x_obs_grant_write_acp' in local_var_params:
|
617
|
+
header_params['x-obs-grant-write-acp'] = local_var_params['x_obs_grant_write_acp']
|
618
|
+
if 'x_obs_grant_full_control' in local_var_params:
|
619
|
+
header_params['x-obs-grant-full-control'] = local_var_params['x_obs_grant_full_control']
|
620
|
+
if 'x_obs_grant_read_delivered' in local_var_params:
|
621
|
+
header_params['x-obs-grant-read-delivered'] = local_var_params['x_obs_grant_read_delivered']
|
622
|
+
if 'x_obs_grant_full_control_delivered' in local_var_params:
|
623
|
+
header_params['x-obs-grant-full-control-delivered'] = local_var_params['x_obs_grant_full_control_delivered']
|
624
|
+
if 'x_obs_az_redundancy' in local_var_params:
|
625
|
+
header_params['x-obs-az-redundancy'] = local_var_params['x_obs_az_redundancy']
|
626
|
+
if 'x_obs_fs_file_interface' in local_var_params:
|
627
|
+
header_params['x-obs-fs-file-interface'] = local_var_params['x_obs_fs_file_interface']
|
628
|
+
if 'x_obs_epid' in local_var_params:
|
629
|
+
header_params['x-obs-epid'] = local_var_params['x_obs_epid']
|
630
|
+
if 'x_obs_cluster_type' in local_var_params:
|
631
|
+
header_params['x-obs-cluster-type'] = local_var_params['x_obs_cluster_type']
|
632
|
+
if 'x_obs_location_clustergroup_id' in local_var_params:
|
633
|
+
header_params['x-obs-location-clustergroup-id'] = local_var_params['x_obs_location_clustergroup_id']
|
634
|
+
if 'x_obs_ies_location' in local_var_params:
|
635
|
+
header_params['x-obs-ies-location'] = local_var_params['x_obs_ies_location']
|
699
636
|
|
700
637
|
form_params = {}
|
701
638
|
|
702
639
|
body = None
|
640
|
+
if 'body' in local_var_params:
|
641
|
+
body = local_var_params['body']
|
703
642
|
if isinstance(request, SdkStreamRequest):
|
704
643
|
body = request.get_file_stream()
|
705
644
|
|
706
645
|
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
707
646
|
|
708
647
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
709
|
-
['application/
|
648
|
+
['application/xml'])
|
710
649
|
|
711
650
|
auth_settings = []
|
712
651
|
|
@@ -721,31 +660,33 @@ class ObsAsyncClient(Client):
|
|
721
660
|
|
722
661
|
return http_info
|
723
662
|
|
724
|
-
def
|
725
|
-
"""
|
663
|
+
def delete_bucket_async(self, request):
|
664
|
+
"""Deleting a Bucket
|
726
665
|
|
727
|
-
|
666
|
+
This operation deletes a bucket. Only the bucket owner or the user who has the bucket delete permission can delete the bucket. Before a bucket itself can be deleted, all objects in the bucket must be deleted. A bucket is not empty if it has any object or multipart upload in it. You can list objects and multipart uploads in the bucket to check whether the bucket is empty.
|
667
|
+
Note:
|
668
|
+
If the server returns a **5***XX* error or times out when a bucket is being deleted, the system needs to synchronize the bucket information. During this period, the bucket information may be inaccurate. Wait a while and then check whether the bucket is deleted. If the bucket can still be queried, send a delete request again.
|
728
669
|
|
729
670
|
Please refer to HUAWEI cloud API Explorer for details.
|
730
671
|
|
731
672
|
|
732
|
-
:param request: Request instance for
|
733
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
734
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
673
|
+
:param request: Request instance for DeleteBucket
|
674
|
+
:type request: :class:`huaweicloudsdkobs.v1.DeleteBucketRequest`
|
675
|
+
:rtype: :class:`huaweicloudsdkobs.v1.DeleteBucketResponse`
|
735
676
|
"""
|
736
|
-
http_info = self.
|
677
|
+
http_info = self._delete_bucket_http_info(request)
|
737
678
|
return self._call_api(**http_info)
|
738
679
|
|
739
|
-
def
|
740
|
-
http_info = self.
|
680
|
+
def delete_bucket_async_invoker(self, request):
|
681
|
+
http_info = self._delete_bucket_http_info(request)
|
741
682
|
return AsyncInvoker(self, http_info)
|
742
683
|
|
743
|
-
def
|
684
|
+
def _delete_bucket_http_info(self, request):
|
744
685
|
http_info = {
|
745
|
-
"method": "
|
686
|
+
"method": "DELETE",
|
746
687
|
"resource_path": "/",
|
747
688
|
"request_type": request.__class__.__name__,
|
748
|
-
"response_type": "
|
689
|
+
"response_type": "DeleteBucketResponse"
|
749
690
|
}
|
750
691
|
|
751
692
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -763,10 +704,6 @@ class ObsAsyncClient(Client):
|
|
763
704
|
header_params = {}
|
764
705
|
if 'date' in local_var_params:
|
765
706
|
header_params['Date'] = local_var_params['date']
|
766
|
-
if 'origin' in local_var_params:
|
767
|
-
header_params['Origin'] = local_var_params['origin']
|
768
|
-
if 'access_control_request_headers' in local_var_params:
|
769
|
-
header_params['Access-Control-Request-Headers'] = local_var_params['access_control_request_headers']
|
770
707
|
|
771
708
|
form_params = {}
|
772
709
|
|
@@ -774,7 +711,7 @@ class ObsAsyncClient(Client):
|
|
774
711
|
if isinstance(request, SdkStreamRequest):
|
775
712
|
body = request.get_file_stream()
|
776
713
|
|
777
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
714
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
778
715
|
|
779
716
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
780
717
|
['application/json'])
|
@@ -792,33 +729,31 @@ class ObsAsyncClient(Client):
|
|
792
729
|
|
793
730
|
return http_info
|
794
731
|
|
795
|
-
def
|
796
|
-
"""
|
732
|
+
def get_bucket_metadata_async(self, request):
|
733
|
+
"""Getting Metadata of a Bucket
|
797
734
|
|
798
|
-
|
799
|
-
|
800
|
-
为了能成功执行此配置操作,需要确保执行者拥有GetBucketNotification权限。默认情况下只有桶的所有者拥有该权限,但可以通过设置桶策略或用户策略授权给其他用户。
|
735
|
+
This operation queries the metadata of a bucket. To use this operation, you must have the permission to read the bucket.
|
801
736
|
|
802
737
|
Please refer to HUAWEI cloud API Explorer for details.
|
803
738
|
|
804
739
|
|
805
|
-
:param request: Request instance for
|
806
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
807
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
740
|
+
:param request: Request instance for GetBucketMetadata
|
741
|
+
:type request: :class:`huaweicloudsdkobs.v1.GetBucketMetadataRequest`
|
742
|
+
:rtype: :class:`huaweicloudsdkobs.v1.GetBucketMetadataResponse`
|
808
743
|
"""
|
809
|
-
http_info = self.
|
744
|
+
http_info = self._get_bucket_metadata_http_info(request)
|
810
745
|
return self._call_api(**http_info)
|
811
746
|
|
812
|
-
def
|
813
|
-
http_info = self.
|
747
|
+
def get_bucket_metadata_async_invoker(self, request):
|
748
|
+
http_info = self._get_bucket_metadata_http_info(request)
|
814
749
|
return AsyncInvoker(self, http_info)
|
815
750
|
|
816
|
-
def
|
751
|
+
def _get_bucket_metadata_http_info(self, request):
|
817
752
|
http_info = {
|
818
|
-
"method": "
|
753
|
+
"method": "HEAD",
|
819
754
|
"resource_path": "/",
|
820
755
|
"request_type": request.__class__.__name__,
|
821
|
-
"response_type": "
|
756
|
+
"response_type": "GetBucketMetadataResponse"
|
822
757
|
}
|
823
758
|
|
824
759
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -832,12 +767,14 @@ class ObsAsyncClient(Client):
|
|
832
767
|
query_params = []
|
833
768
|
if 'bucket_name' in local_var_params:
|
834
769
|
cname = local_var_params['bucket_name']
|
835
|
-
if 'notification' in local_var_params:
|
836
|
-
query_params.append(('notification', local_var_params['notification']))
|
837
770
|
|
838
771
|
header_params = {}
|
839
772
|
if 'date' in local_var_params:
|
840
773
|
header_params['Date'] = local_var_params['date']
|
774
|
+
if 'origin' in local_var_params:
|
775
|
+
header_params['Origin'] = local_var_params['origin']
|
776
|
+
if 'access_control_request_headers' in local_var_params:
|
777
|
+
header_params['Access-Control-Request-Headers'] = local_var_params['access_control_request_headers']
|
841
778
|
|
842
779
|
form_params = {}
|
843
780
|
|
@@ -845,7 +782,7 @@ class ObsAsyncClient(Client):
|
|
845
782
|
if isinstance(request, SdkStreamRequest):
|
846
783
|
body = request.get_file_stream()
|
847
784
|
|
848
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
785
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "x-obs-fs-file-interface", "x-obs-version", "Access-Control-Allow-Origin", "Access-Control-Allow-Methods", "x-obs-bucket-location", "Connection", "x-obs-epid", "Date", "Access-Control-Allow-Headers", "Access-Control-Expose-Headers", "ETag", "x-obs-storage-class", "x-obs-az-redundancy", "Content-Length", "Access-Control-Max-Age", "x-obs-ies-location", ]
|
849
786
|
|
850
787
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
851
788
|
['application/json'])
|
@@ -863,40 +800,31 @@ class ObsAsyncClient(Client):
|
|
863
800
|
|
864
801
|
return http_info
|
865
802
|
|
866
|
-
def
|
867
|
-
"""
|
803
|
+
def list_buckets_async(self, request):
|
804
|
+
"""Getting a List of Buckets
|
868
805
|
|
869
|
-
|
870
|
-
|
871
|
-
#### 服务端加密 ####
|
872
|
-
如果客户端的对象上传时,使用了客户提供的加密密钥进行服务端加密,当下载对象时,同样也必须在消息中提供密钥。
|
873
|
-
|
874
|
-
#### 多版本 ####
|
875
|
-
默认情况下,获取的是最新版本的对象。如果最新版本的对象是删除标记,则返回对象不存在。如果要获取指定版本的对象,请求可携带versionId消息参数。
|
876
|
-
|
877
|
-
#### 归档存储对象 ####
|
878
|
-
如果要下载的对象是归档存储类对象,由于对象存储在存档设备中,您必须先使用对象取回,然后才能下载该归档存储对象。对象处于不同的取回状态时,给出不同响应:如果对象已取回,下载对象成功时需要返回x-obs-restore头域指示取回失效时间。对未取回或正在取回的归档存储对象发送下载请求时,会返回错误403 Forbidden。
|
806
|
+
This operation returns a list of all buckets you created.
|
879
807
|
|
880
808
|
Please refer to HUAWEI cloud API Explorer for details.
|
881
809
|
|
882
810
|
|
883
|
-
:param request: Request instance for
|
884
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
885
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
811
|
+
:param request: Request instance for ListBuckets
|
812
|
+
:type request: :class:`huaweicloudsdkobs.v1.ListBucketsRequest`
|
813
|
+
:rtype: :class:`huaweicloudsdkobs.v1.ListBucketsResponse`
|
886
814
|
"""
|
887
|
-
http_info = self.
|
815
|
+
http_info = self._list_buckets_http_info(request)
|
888
816
|
return self._call_api(**http_info)
|
889
817
|
|
890
|
-
def
|
891
|
-
http_info = self.
|
818
|
+
def list_buckets_async_invoker(self, request):
|
819
|
+
http_info = self._list_buckets_http_info(request)
|
892
820
|
return AsyncInvoker(self, http_info)
|
893
821
|
|
894
|
-
def
|
822
|
+
def _list_buckets_http_info(self, request):
|
895
823
|
http_info = {
|
896
824
|
"method": "GET",
|
897
|
-
"resource_path": "/
|
825
|
+
"resource_path": "/",
|
898
826
|
"request_type": request.__class__.__name__,
|
899
|
-
"response_type": "
|
827
|
+
"response_type": "ListBucketsResponse"
|
900
828
|
}
|
901
829
|
|
902
830
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -906,50 +834,14 @@ class ObsAsyncClient(Client):
|
|
906
834
|
collection_formats = {}
|
907
835
|
|
908
836
|
path_params = {}
|
909
|
-
if 'object_key' in local_var_params:
|
910
|
-
path_params['object_key'] = local_var_params['object_key']
|
911
837
|
|
912
838
|
query_params = []
|
913
|
-
if 'bucket_name' in local_var_params:
|
914
|
-
cname = local_var_params['bucket_name']
|
915
|
-
if 'response_content_type' in local_var_params:
|
916
|
-
query_params.append(('response-content-type', local_var_params['response_content_type']))
|
917
|
-
if 'response_content_language' in local_var_params:
|
918
|
-
query_params.append(('response-content-language', local_var_params['response_content_language']))
|
919
|
-
if 'response_expires' in local_var_params:
|
920
|
-
query_params.append(('response-expires', local_var_params['response_expires']))
|
921
|
-
if 'response_cache_control' in local_var_params:
|
922
|
-
query_params.append(('response-cache-control', local_var_params['response_cache_control']))
|
923
|
-
if 'response_content_disposition' in local_var_params:
|
924
|
-
query_params.append(('response-content-disposition', local_var_params['response_content_disposition']))
|
925
|
-
if 'response_content_encoding' in local_var_params:
|
926
|
-
query_params.append(('response-content-encoding', local_var_params['response_content_encoding']))
|
927
|
-
if 'version_id' in local_var_params:
|
928
|
-
query_params.append(('versionId', local_var_params['version_id']))
|
929
|
-
if 'x_image_process' in local_var_params:
|
930
|
-
query_params.append(('x-image-process', local_var_params['x_image_process']))
|
931
|
-
if 'attname' in local_var_params:
|
932
|
-
query_params.append(('attname', local_var_params['attname']))
|
933
839
|
|
934
840
|
header_params = {}
|
935
841
|
if 'date' in local_var_params:
|
936
842
|
header_params['Date'] = local_var_params['date']
|
937
|
-
if '
|
938
|
-
header_params['
|
939
|
-
if 'if_modified_since' in local_var_params:
|
940
|
-
header_params['If-Modified-Since'] = local_var_params['if_modified_since']
|
941
|
-
if 'if_unmodified_since' in local_var_params:
|
942
|
-
header_params['If-Unmodified-Since'] = local_var_params['if_unmodified_since']
|
943
|
-
if 'if_match' in local_var_params:
|
944
|
-
header_params['If-Match'] = local_var_params['if_match']
|
945
|
-
if 'if_none_match' in local_var_params:
|
946
|
-
header_params['If-None-Match'] = local_var_params['if_none_match']
|
947
|
-
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
948
|
-
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
949
|
-
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
950
|
-
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
951
|
-
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
952
|
-
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
843
|
+
if 'x_obs_bucket_type' in local_var_params:
|
844
|
+
header_params['x-obs-bucket-type'] = local_var_params['x_obs_bucket_type']
|
953
845
|
|
954
846
|
form_params = {}
|
955
847
|
|
@@ -957,7 +849,7 @@ class ObsAsyncClient(Client):
|
|
957
849
|
if isinstance(request, SdkStreamRequest):
|
958
850
|
body = request.get_file_stream()
|
959
851
|
|
960
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
852
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "x-obs-bucket-type", "Connection", "Content-Length", "Date", ]
|
961
853
|
|
962
854
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
963
855
|
['application/json'])
|
@@ -975,35 +867,31 @@ class ObsAsyncClient(Client):
|
|
975
867
|
|
976
868
|
return http_info
|
977
869
|
|
978
|
-
def
|
979
|
-
"""
|
870
|
+
def list_objects_async(self, request):
|
871
|
+
"""Listing Objects in a Bucket
|
980
872
|
|
981
|
-
|
982
|
-
该操作支持服务端加密功能。
|
983
|
-
|
984
|
-
#### 多版本 ####
|
985
|
-
默认情况下,获取的是最新版本的对象元数据。如果最新版本的对象是删除标记,则返回404。如果要获取指定版本的对象元数据,请求可携带versionId消息参数。
|
873
|
+
This operation returns objects in a bucket.
|
986
874
|
|
987
875
|
Please refer to HUAWEI cloud API Explorer for details.
|
988
876
|
|
989
877
|
|
990
|
-
:param request: Request instance for
|
991
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
992
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
878
|
+
:param request: Request instance for ListObjects
|
879
|
+
:type request: :class:`huaweicloudsdkobs.v1.ListObjectsRequest`
|
880
|
+
:rtype: :class:`huaweicloudsdkobs.v1.ListObjectsResponse`
|
993
881
|
"""
|
994
|
-
http_info = self.
|
882
|
+
http_info = self._list_objects_http_info(request)
|
995
883
|
return self._call_api(**http_info)
|
996
884
|
|
997
|
-
def
|
998
|
-
http_info = self.
|
885
|
+
def list_objects_async_invoker(self, request):
|
886
|
+
http_info = self._list_objects_http_info(request)
|
999
887
|
return AsyncInvoker(self, http_info)
|
1000
888
|
|
1001
|
-
def
|
889
|
+
def _list_objects_http_info(self, request):
|
1002
890
|
http_info = {
|
1003
|
-
"method": "
|
1004
|
-
"resource_path": "/
|
891
|
+
"method": "GET",
|
892
|
+
"resource_path": "/",
|
1005
893
|
"request_type": request.__class__.__name__,
|
1006
|
-
"response_type": "
|
894
|
+
"response_type": "ListObjectsResponse"
|
1007
895
|
}
|
1008
896
|
|
1009
897
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1013,32 +901,28 @@ class ObsAsyncClient(Client):
|
|
1013
901
|
collection_formats = {}
|
1014
902
|
|
1015
903
|
path_params = {}
|
1016
|
-
if 'object_key' in local_var_params:
|
1017
|
-
path_params['object_key'] = local_var_params['object_key']
|
1018
904
|
|
1019
905
|
query_params = []
|
1020
906
|
if 'bucket_name' in local_var_params:
|
1021
907
|
cname = local_var_params['bucket_name']
|
1022
|
-
if '
|
1023
|
-
query_params.append(('
|
908
|
+
if 'prefix' in local_var_params:
|
909
|
+
query_params.append(('prefix', local_var_params['prefix']))
|
910
|
+
if 'marker' in local_var_params:
|
911
|
+
query_params.append(('marker', local_var_params['marker']))
|
912
|
+
if 'max_keys' in local_var_params:
|
913
|
+
query_params.append(('max-keys', local_var_params['max_keys']))
|
914
|
+
if 'delimiter' in local_var_params:
|
915
|
+
query_params.append(('delimiter', local_var_params['delimiter']))
|
916
|
+
if 'key_marker' in local_var_params:
|
917
|
+
query_params.append(('key-marker', local_var_params['key_marker']))
|
918
|
+
if 'version_id_marker' in local_var_params:
|
919
|
+
query_params.append(('version-id-marker', local_var_params['version_id_marker']))
|
920
|
+
if 'encoding_type' in local_var_params:
|
921
|
+
query_params.append(('encoding-type', local_var_params['encoding_type']))
|
1024
922
|
|
1025
923
|
header_params = {}
|
1026
924
|
if 'date' in local_var_params:
|
1027
925
|
header_params['Date'] = local_var_params['date']
|
1028
|
-
if 'origin' in local_var_params:
|
1029
|
-
header_params['Origin'] = local_var_params['origin']
|
1030
|
-
if 'access_control_request_headers' in local_var_params:
|
1031
|
-
header_params['Access-Control-Request-Headers'] = local_var_params['access_control_request_headers']
|
1032
|
-
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
1033
|
-
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
1034
|
-
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
1035
|
-
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
1036
|
-
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
1037
|
-
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
1038
|
-
if 'success_action_redirect' in local_var_params:
|
1039
|
-
header_params['success-action-redirect'] = local_var_params['success_action_redirect']
|
1040
|
-
if 'x_obs_expires' in local_var_params:
|
1041
|
-
header_params['x-obs-expires'] = local_var_params['x_obs_expires']
|
1042
926
|
|
1043
927
|
form_params = {}
|
1044
928
|
|
@@ -1046,7 +930,7 @@ class ObsAsyncClient(Client):
|
|
1046
930
|
if isinstance(request, SdkStreamRequest):
|
1047
931
|
body = request.get_file_stream()
|
1048
932
|
|
1049
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
933
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "x-obs-bucket-type", "Connection", "Content-Length", "Date", ]
|
1050
934
|
|
1051
935
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1052
936
|
['application/json'])
|
@@ -1064,31 +948,56 @@ class ObsAsyncClient(Client):
|
|
1064
948
|
|
1065
949
|
return http_info
|
1066
950
|
|
1067
|
-
def
|
1068
|
-
"""
|
951
|
+
def copy_object_async(self, request):
|
952
|
+
"""Copying an Object
|
1069
953
|
|
1070
|
-
OBS
|
954
|
+
This operation creates a copy of an object in OBS.
|
955
|
+
|
956
|
+
When copying an object, you can keep all metadata of the source object (default) or replace the metadata with the new metadata provided in the request. However, the ACL of the source object is not preserved and is set to private for the object copy. You can use the ACL setting API to update the ACL of the new object.
|
957
|
+
|
958
|
+
The data copy request needs to carry the information about the source bucket and object in headers, but cannot carry the message body.
|
959
|
+
|
960
|
+
This operation supports server-side encryption.
|
961
|
+
|
962
|
+
The object you can copy is up to 5 GB. If the source object is larger than 5 GB, you can only copy some of the object using **Range**.
|
963
|
+
|
964
|
+
**Versioning**
|
965
|
+
By default, **x-obs-copy-source** specifies the latest version of the source object. If the latest version of the source object has a delete marker, the object is considered deleted. To copy a specific object version, add the **versionId** parameter in the **x-obs-copy-source** request header.
|
966
|
+
|
967
|
+
If versioning is enabled for the bucket storing the target object, OBS generates a unique version ID for the target object (this version ID is different from that of the source object) and returns the version ID in the **x-obs-version-id** response header. If versioning is suspended for the target bucket, the version ID of the target object is **null**.
|
968
|
+
|
969
|
+
Note:
|
970
|
+
Assume that the target bucket already has **object_B** in it and has the versioning not enabled. If you make a copy of **object_A** and save it as **object_B** in the target bucket, the new **object_B** will overwrite the old one. You can download only the new **object_B**, as the old one has been deleted. To use this API, ensure that there is no object with the same name as the object copy to protect data from being deleted by mistake. This copy operation does not make any changes to **object_A**.
|
971
|
+
|
972
|
+
**status_code** in the returned HTTP header does not represent whether an object copy is successful. Status code 200 indicates that the server has received the data copy request and starts to process it. A copy request succeeds only when the body in the response contains ETag, or the copy request failed.
|
973
|
+
|
974
|
+
**Archive Objects**
|
975
|
+
If source objects are in the Archive storage class, ensure that these objects have been restored before you copy them. If a source object is not restored or is being restored, its copy will fail and error **403 Forbidden** will be returned. The error description is as follows:
|
976
|
+
|
977
|
+
ErrorCode: InvalidObjectState
|
978
|
+
|
979
|
+
ErrorMessage: Operation is not valid for the source object's storage class
|
1071
980
|
|
1072
981
|
Please refer to HUAWEI cloud API Explorer for details.
|
1073
982
|
|
1074
983
|
|
1075
|
-
:param request: Request instance for
|
1076
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
1077
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
984
|
+
:param request: Request instance for CopyObject
|
985
|
+
:type request: :class:`huaweicloudsdkobs.v1.CopyObjectRequest`
|
986
|
+
:rtype: :class:`huaweicloudsdkobs.v1.CopyObjectResponse`
|
1078
987
|
"""
|
1079
|
-
http_info = self.
|
988
|
+
http_info = self._copy_object_http_info(request)
|
1080
989
|
return self._call_api(**http_info)
|
1081
990
|
|
1082
|
-
def
|
1083
|
-
http_info = self.
|
991
|
+
def copy_object_async_invoker(self, request):
|
992
|
+
http_info = self._copy_object_http_info(request)
|
1084
993
|
return AsyncInvoker(self, http_info)
|
1085
994
|
|
1086
|
-
def
|
995
|
+
def _copy_object_http_info(self, request):
|
1087
996
|
http_info = {
|
1088
|
-
"method": "
|
1089
|
-
"resource_path": "/",
|
997
|
+
"method": "PUT",
|
998
|
+
"resource_path": "/{object_key}",
|
1090
999
|
"request_type": request.__class__.__name__,
|
1091
|
-
"response_type": "
|
1000
|
+
"response_type": "CopyObjectResponse"
|
1092
1001
|
}
|
1093
1002
|
|
1094
1003
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1098,14 +1007,62 @@ class ObsAsyncClient(Client):
|
|
1098
1007
|
collection_formats = {}
|
1099
1008
|
|
1100
1009
|
path_params = {}
|
1010
|
+
if 'object_key' in local_var_params:
|
1011
|
+
path_params['object_key'] = local_var_params['object_key']
|
1101
1012
|
|
1102
1013
|
query_params = []
|
1014
|
+
if 'bucket_name' in local_var_params:
|
1015
|
+
cname = local_var_params['bucket_name']
|
1103
1016
|
|
1104
1017
|
header_params = {}
|
1105
1018
|
if 'date' in local_var_params:
|
1106
1019
|
header_params['Date'] = local_var_params['date']
|
1107
|
-
if '
|
1108
|
-
header_params['x-obs-
|
1020
|
+
if 'x_obs_acl' in local_var_params:
|
1021
|
+
header_params['x-obs-acl'] = local_var_params['x_obs_acl']
|
1022
|
+
if 'x_obs_grant_read' in local_var_params:
|
1023
|
+
header_params['x-obs-grant-read'] = local_var_params['x_obs_grant_read']
|
1024
|
+
if 'x_obs_grant_read_acp' in local_var_params:
|
1025
|
+
header_params['x-obs-grant-read-acp'] = local_var_params['x_obs_grant_read_acp']
|
1026
|
+
if 'x_obs_grant_write_acp' in local_var_params:
|
1027
|
+
header_params['x-obs-grant-write-acp'] = local_var_params['x_obs_grant_write_acp']
|
1028
|
+
if 'x_obs_grant_full_control' in local_var_params:
|
1029
|
+
header_params['x-obs-grant-full-control'] = local_var_params['x_obs_grant_full_control']
|
1030
|
+
if 'x_obs_copy_source' in local_var_params:
|
1031
|
+
header_params['x-obs-copy-source'] = local_var_params['x_obs_copy_source']
|
1032
|
+
if 'x_obs_metadata_directive' in local_var_params:
|
1033
|
+
header_params['x-obs-metadata-directive'] = local_var_params['x_obs_metadata_directive']
|
1034
|
+
if 'x_obs_copy_source_if_match' in local_var_params:
|
1035
|
+
header_params['x-obs-copy-source-if-match'] = local_var_params['x_obs_copy_source_if_match']
|
1036
|
+
if 'x_obs_copy_source_if_none_match' in local_var_params:
|
1037
|
+
header_params['x-obs-copy-source-if-none-match'] = local_var_params['x_obs_copy_source_if_none_match']
|
1038
|
+
if 'x_obs_copy_source_if_unmodified_since' in local_var_params:
|
1039
|
+
header_params['x-obs-copy-source-if-unmodified-since'] = local_var_params['x_obs_copy_source_if_unmodified_since']
|
1040
|
+
if 'x_obs_copy_source_if_modified_since' in local_var_params:
|
1041
|
+
header_params['x-obs-copy-source-if-modified-since'] = local_var_params['x_obs_copy_source_if_modified_since']
|
1042
|
+
if 'x_obs_storage_class' in local_var_params:
|
1043
|
+
header_params['x-obs-storage-class'] = local_var_params['x_obs_storage_class']
|
1044
|
+
if 'x_obs_persistent_headers' in local_var_params:
|
1045
|
+
header_params['x-obs-persistent-headers'] = local_var_params['x_obs_persistent_headers']
|
1046
|
+
if 'x_obs_website_redirect_location' in local_var_params:
|
1047
|
+
header_params['x-obs-website-redirect-location'] = local_var_params['x_obs_website_redirect_location']
|
1048
|
+
if 'x_obs_server_side_encryption' in local_var_params:
|
1049
|
+
header_params['x-obs-server-side-encryption'] = local_var_params['x_obs_server_side_encryption']
|
1050
|
+
if 'x_obs_server_side_encryption_kms_key_id' in local_var_params:
|
1051
|
+
header_params['x-obs-server-side-encryption-kms-key-id'] = local_var_params['x_obs_server_side_encryption_kms_key_id']
|
1052
|
+
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
1053
|
+
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
1054
|
+
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
1055
|
+
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
1056
|
+
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
1057
|
+
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
1058
|
+
if 'x_obs_copy_source_server_side_encryption_customer_algorithm' in local_var_params:
|
1059
|
+
header_params['x-obs-copy-source-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_copy_source_server_side_encryption_customer_algorithm']
|
1060
|
+
if 'x_obs_copy_source_server_side_encryption_customer_key' in local_var_params:
|
1061
|
+
header_params['x-obs-copy-source-server-side-encryption-customer-key'] = local_var_params['x_obs_copy_source_server_side_encryption_customer_key']
|
1062
|
+
if 'x_obs_copy_source_server_side_encryption_customer_key_md5' in local_var_params:
|
1063
|
+
header_params['x-obs-copy-source-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_copy_source_server_side_encryption_customer_key_md5']
|
1064
|
+
if 'success_action_redirect' in local_var_params:
|
1065
|
+
header_params['success_action_redirect'] = local_var_params['success_action_redirect']
|
1109
1066
|
|
1110
1067
|
form_params = {}
|
1111
1068
|
|
@@ -1113,7 +1070,7 @@ class ObsAsyncClient(Client):
|
|
1113
1070
|
if isinstance(request, SdkStreamRequest):
|
1114
1071
|
body = request.get_file_stream()
|
1115
1072
|
|
1116
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "x-obs-
|
1073
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "x-obs-server-side-encryption", "Connection", "x-obs-server-side-encryption-customer-key-MD5", "Date", "ETag", "x-obs-server-side-encryption-customer-algorithm", "x-obs-copy-source-version-id", "x-obs-storage-class", "x-obs-server-side-encryption-kms-key-id", "Content-Length", "x-obs-version-id", ]
|
1117
1074
|
|
1118
1075
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1119
1076
|
['application/json'])
|
@@ -1131,33 +1088,36 @@ class ObsAsyncClient(Client):
|
|
1131
1088
|
|
1132
1089
|
return http_info
|
1133
1090
|
|
1134
|
-
def
|
1135
|
-
"""
|
1091
|
+
def delete_object_async(self, request):
|
1092
|
+
"""Deleting an Object
|
1136
1093
|
|
1137
|
-
|
1094
|
+
This operation deletes an object. If you try to delete an object that does not exist, OBS still returns a success message.
|
1138
1095
|
|
1139
|
-
|
1096
|
+
**Versioning**
|
1097
|
+
When versioning is enabled for a bucket, deleting an object with no version ID specified attaches a delete marker with a unique version ID to the object, but the object is not really deleted. When versioning is suspended for a bucket, deleting an object with no version ID specified deletes the object whose version ID is **null** and creates a delete marker with a version ID **null**.
|
1098
|
+
|
1099
|
+
To delete a specific object version, add the **versionId** parameter in the request.
|
1140
1100
|
|
1141
1101
|
Please refer to HUAWEI cloud API Explorer for details.
|
1142
1102
|
|
1143
1103
|
|
1144
|
-
:param request: Request instance for
|
1145
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
1146
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
1104
|
+
:param request: Request instance for DeleteObject
|
1105
|
+
:type request: :class:`huaweicloudsdkobs.v1.DeleteObjectRequest`
|
1106
|
+
:rtype: :class:`huaweicloudsdkobs.v1.DeleteObjectResponse`
|
1147
1107
|
"""
|
1148
|
-
http_info = self.
|
1108
|
+
http_info = self._delete_object_http_info(request)
|
1149
1109
|
return self._call_api(**http_info)
|
1150
1110
|
|
1151
|
-
def
|
1152
|
-
http_info = self.
|
1111
|
+
def delete_object_async_invoker(self, request):
|
1112
|
+
http_info = self._delete_object_http_info(request)
|
1153
1113
|
return AsyncInvoker(self, http_info)
|
1154
1114
|
|
1155
|
-
def
|
1115
|
+
def _delete_object_http_info(self, request):
|
1156
1116
|
http_info = {
|
1157
|
-
"method": "
|
1158
|
-
"resource_path": "/",
|
1117
|
+
"method": "DELETE",
|
1118
|
+
"resource_path": "/{object_key}",
|
1159
1119
|
"request_type": request.__class__.__name__,
|
1160
|
-
"response_type": "
|
1120
|
+
"response_type": "DeleteObjectResponse"
|
1161
1121
|
}
|
1162
1122
|
|
1163
1123
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1167,24 +1127,14 @@ class ObsAsyncClient(Client):
|
|
1167
1127
|
collection_formats = {}
|
1168
1128
|
|
1169
1129
|
path_params = {}
|
1130
|
+
if 'object_key' in local_var_params:
|
1131
|
+
path_params['object_key'] = local_var_params['object_key']
|
1170
1132
|
|
1171
1133
|
query_params = []
|
1172
1134
|
if 'bucket_name' in local_var_params:
|
1173
1135
|
cname = local_var_params['bucket_name']
|
1174
|
-
if '
|
1175
|
-
query_params.append(('
|
1176
|
-
if 'marker' in local_var_params:
|
1177
|
-
query_params.append(('marker', local_var_params['marker']))
|
1178
|
-
if 'max_keys' in local_var_params:
|
1179
|
-
query_params.append(('max-keys', local_var_params['max_keys']))
|
1180
|
-
if 'delimiter' in local_var_params:
|
1181
|
-
query_params.append(('delimiter', local_var_params['delimiter']))
|
1182
|
-
if 'key_marker' in local_var_params:
|
1183
|
-
query_params.append(('key-marker', local_var_params['key_marker']))
|
1184
|
-
if 'version_id_marker' in local_var_params:
|
1185
|
-
query_params.append(('version-id-marker', local_var_params['version_id_marker']))
|
1186
|
-
if 'encoding_type' in local_var_params:
|
1187
|
-
query_params.append(('encoding-type', local_var_params['encoding_type']))
|
1136
|
+
if 'version_id' in local_var_params:
|
1137
|
+
query_params.append(('versionId', local_var_params['version_id']))
|
1188
1138
|
|
1189
1139
|
header_params = {}
|
1190
1140
|
if 'date' in local_var_params:
|
@@ -1196,7 +1146,7 @@ class ObsAsyncClient(Client):
|
|
1196
1146
|
if isinstance(request, SdkStreamRequest):
|
1197
1147
|
body = request.get_file_stream()
|
1198
1148
|
|
1199
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "
|
1149
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", "x-obs-delete-marker", "x-obs-version-id", ]
|
1200
1150
|
|
1201
1151
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1202
1152
|
['application/json'])
|
@@ -1214,43 +1164,35 @@ class ObsAsyncClient(Client):
|
|
1214
1164
|
|
1215
1165
|
return http_info
|
1216
1166
|
|
1217
|
-
def
|
1218
|
-
"""
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
单次上传对象大小范围是[0, 5GB],如果需要上传超过5GB的大文件,需要通过多段操作来分段上传。
|
1226
|
-
OBS没有文件夹的概念。为了使用户更方便进行管理数据,OBS提供了一种方式模拟文件夹:通过在对象的名称中增加“/”,例如“test/123.jpg”。此时,“test”就被模拟成了一个文件夹,“123.jpg”则模拟成“test”文件夹下的文件名了,而实际上,对象名称(Key)仍然是“test/123.jpg”。此类命名方式的对象,在控制台上会以文件夹的形式展示。
|
1227
|
-
#### 与POST上传的区别 #### PUT上传中参数通过请求头域传递;POST上传则作为消息体中的表单域传递。
|
1228
|
-
PUT上传需在URL中指定对象名;POST上传提交的URL为桶域名,无需指定对象名。两者的请求行分别为:
|
1229
|
-
PUT /ObjectName HTTP/1.1
|
1230
|
-
POST / HTTP/1.1
|
1231
|
-
关于POST上传的更多详细信息,请参考POST上传。
|
1232
|
-
#### 多版本 #### 如果桶的多版本状态是开启的,系统会自动为对象生成一个唯一的版本号,并且会在响应报头x-obs-version-id返回该版本号。如果桶的多版本状态是暂停的,则对象的版本号为null。关于桶的多版本状态,参见设置桶的多版本状态。
|
1167
|
+
def delete_objects_async(self, request):
|
1168
|
+
"""Batch Deleting Objects
|
1169
|
+
|
1170
|
+
This operation deletes some objects in a bucket at a time. The operation cannot be undone. OBS synchronously deletes objects in a batch. The deletion result of each object is returned.
|
1171
|
+
|
1172
|
+
Batch object deletion supports two response methods: verbose and quiet. With verbose, OBS returns the results of both successful and failed deletions in the XML response; with quiet, OBS only returns the results of failed deletions in the XML response. OBS uses verbose by default. To use quiet, specify the quiet method in the request body.
|
1173
|
+
|
1174
|
+
In a batch deletion request, the **Content-MD5** and **Content-Length** headers must be included, so that the message body can be identified if the server discovers a network transmission error.
|
1233
1175
|
|
1234
1176
|
Please refer to HUAWEI cloud API Explorer for details.
|
1235
1177
|
|
1236
1178
|
|
1237
|
-
:param request: Request instance for
|
1238
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
1239
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
1179
|
+
:param request: Request instance for DeleteObjects
|
1180
|
+
:type request: :class:`huaweicloudsdkobs.v1.DeleteObjectsRequest`
|
1181
|
+
:rtype: :class:`huaweicloudsdkobs.v1.DeleteObjectsResponse`
|
1240
1182
|
"""
|
1241
|
-
http_info = self.
|
1183
|
+
http_info = self._delete_objects_http_info(request)
|
1242
1184
|
return self._call_api(**http_info)
|
1243
1185
|
|
1244
|
-
def
|
1245
|
-
http_info = self.
|
1186
|
+
def delete_objects_async_invoker(self, request):
|
1187
|
+
http_info = self._delete_objects_http_info(request)
|
1246
1188
|
return AsyncInvoker(self, http_info)
|
1247
1189
|
|
1248
|
-
def
|
1190
|
+
def _delete_objects_http_info(self, request):
|
1249
1191
|
http_info = {
|
1250
|
-
"method": "
|
1251
|
-
"resource_path": "/
|
1192
|
+
"method": "POST",
|
1193
|
+
"resource_path": "/",
|
1252
1194
|
"request_type": request.__class__.__name__,
|
1253
|
-
"response_type": "
|
1195
|
+
"response_type": "DeleteObjectsResponse"
|
1254
1196
|
}
|
1255
1197
|
|
1256
1198
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1260,61 +1202,31 @@ class ObsAsyncClient(Client):
|
|
1260
1202
|
collection_formats = {}
|
1261
1203
|
|
1262
1204
|
path_params = {}
|
1263
|
-
if 'object_key' in local_var_params:
|
1264
|
-
path_params['object_key'] = local_var_params['object_key']
|
1265
1205
|
|
1266
1206
|
query_params = []
|
1267
1207
|
if 'bucket_name' in local_var_params:
|
1268
1208
|
cname = local_var_params['bucket_name']
|
1209
|
+
if 'delete' in local_var_params:
|
1210
|
+
query_params.append(('delete', local_var_params['delete']))
|
1269
1211
|
|
1270
1212
|
header_params = {}
|
1271
|
-
if 'date' in local_var_params:
|
1272
|
-
header_params['Date'] = local_var_params['date']
|
1273
1213
|
if 'content_md5' in local_var_params:
|
1274
1214
|
header_params['Content-MD5'] = local_var_params['content_md5']
|
1275
|
-
if '
|
1276
|
-
header_params['
|
1277
|
-
if 'x_obs_grant_read' in local_var_params:
|
1278
|
-
header_params['x-obs-grant-read'] = local_var_params['x_obs_grant_read']
|
1279
|
-
if 'x_obs_grant_read_acp' in local_var_params:
|
1280
|
-
header_params['x-obs-grant-read-acp'] = local_var_params['x_obs_grant_read_acp']
|
1281
|
-
if 'x_obs_grant_write_acp' in local_var_params:
|
1282
|
-
header_params['x-obs-grant-write-acp'] = local_var_params['x_obs_grant_write_acp']
|
1283
|
-
if 'x_obs_grant_full_control' in local_var_params:
|
1284
|
-
header_params['x-obs-grant-full-control'] = local_var_params['x_obs_grant_full_control']
|
1285
|
-
if 'x_obs_storage_class' in local_var_params:
|
1286
|
-
header_params['x-obs-storage-class'] = local_var_params['x_obs_storage_class']
|
1287
|
-
if 'x_obs_meta_xxx' in local_var_params:
|
1288
|
-
header_params['x-obs-meta-xxx'] = local_var_params['x_obs_meta_xxx']
|
1289
|
-
if 'x_obs_persistent_headers' in local_var_params:
|
1290
|
-
header_params['x-obs-persistent-headers'] = local_var_params['x_obs_persistent_headers']
|
1291
|
-
if 'x_obs_website_redirect_location' in local_var_params:
|
1292
|
-
header_params['x-obs-website-redirect-location'] = local_var_params['x_obs_website_redirect_location']
|
1293
|
-
if 'x_obs_server_side_encryption' in local_var_params:
|
1294
|
-
header_params['x-obs-server-side-encryption'] = local_var_params['x_obs_server_side_encryption']
|
1295
|
-
if 'x_obs_server_side_encryption_kms_key_id' in local_var_params:
|
1296
|
-
header_params['x-obs-server-side-encryption-kms-key-id'] = local_var_params['x_obs_server_side_encryption_kms_key_id']
|
1297
|
-
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
1298
|
-
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
1299
|
-
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
1300
|
-
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
1301
|
-
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
1302
|
-
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
1303
|
-
if 'success_action_redirect' in local_var_params:
|
1304
|
-
header_params['success-action-redirect'] = local_var_params['success_action_redirect']
|
1305
|
-
if 'x_obs_expires' in local_var_params:
|
1306
|
-
header_params['x-obs-expires'] = local_var_params['x_obs_expires']
|
1215
|
+
if 'date' in local_var_params:
|
1216
|
+
header_params['Date'] = local_var_params['date']
|
1307
1217
|
|
1308
1218
|
form_params = {}
|
1309
1219
|
|
1310
1220
|
body = None
|
1221
|
+
if 'body' in local_var_params:
|
1222
|
+
body = local_var_params['body']
|
1311
1223
|
if isinstance(request, SdkStreamRequest):
|
1312
1224
|
body = request.get_file_stream()
|
1313
1225
|
|
1314
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "
|
1226
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
1315
1227
|
|
1316
1228
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1317
|
-
['application/
|
1229
|
+
['application/xml'])
|
1318
1230
|
|
1319
1231
|
auth_settings = []
|
1320
1232
|
|
@@ -1329,35 +1241,40 @@ class ObsAsyncClient(Client):
|
|
1329
1241
|
|
1330
1242
|
return http_info
|
1331
1243
|
|
1332
|
-
def
|
1333
|
-
"""
|
1244
|
+
def get_object_async(self, request):
|
1245
|
+
"""Downloading an Object
|
1334
1246
|
|
1335
|
-
OBS
|
1247
|
+
This operation downloads an object from OBS. To use this operation, you must have the read permission for the object. If the object owner has granted anonymous users the read permission for the object, anonymous users can access this object without using the authentication header field.
|
1336
1248
|
|
1337
|
-
|
1249
|
+
**Server-Side Encryption**
|
1250
|
+
If the object uploaded to a server is encrypted with the key provided by the client, the key must also be provided in the message for downloading the object.
|
1338
1251
|
|
1339
|
-
|
1252
|
+
**Versioning**
|
1253
|
+
By default, this operation returns the latest object version. If the latest object version has a delete marker, OBS returns a message indicating that the object does not exist. To download a specific object version, add the **versionId** parameter in the request.
|
1254
|
+
|
1255
|
+
**Archive Objects**
|
1256
|
+
You must restore an Archive object before you can download it. The response varies depending on the restore status of the object. If an object has been restored, after this object is downloaded, the **x-obs-restore** header is returned to indicate when the retention of the restored object expires. If you send a request to download Archive objects that are not restored or are being restored, a **403 Forbidden** error is returned.
|
1340
1257
|
|
1341
1258
|
Please refer to HUAWEI cloud API Explorer for details.
|
1342
1259
|
|
1343
1260
|
|
1344
|
-
:param request: Request instance for
|
1345
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
1346
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
1261
|
+
:param request: Request instance for GetObject
|
1262
|
+
:type request: :class:`huaweicloudsdkobs.v1.GetObjectRequest`
|
1263
|
+
:rtype: :class:`huaweicloudsdkobs.v1.GetObjectResponse`
|
1347
1264
|
"""
|
1348
|
-
http_info = self.
|
1265
|
+
http_info = self._get_object_http_info(request)
|
1349
1266
|
return self._call_api(**http_info)
|
1350
1267
|
|
1351
|
-
def
|
1352
|
-
http_info = self.
|
1268
|
+
def get_object_async_invoker(self, request):
|
1269
|
+
http_info = self._get_object_http_info(request)
|
1353
1270
|
return AsyncInvoker(self, http_info)
|
1354
1271
|
|
1355
|
-
def
|
1272
|
+
def _get_object_http_info(self, request):
|
1356
1273
|
http_info = {
|
1357
|
-
"method": "
|
1358
|
-
"resource_path": "/",
|
1274
|
+
"method": "GET",
|
1275
|
+
"resource_path": "/{object_key}",
|
1359
1276
|
"request_type": request.__class__.__name__,
|
1360
|
-
"response_type": "
|
1277
|
+
"response_type": "GetObjectResponse"
|
1361
1278
|
}
|
1362
1279
|
|
1363
1280
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1367,31 +1284,61 @@ class ObsAsyncClient(Client):
|
|
1367
1284
|
collection_formats = {}
|
1368
1285
|
|
1369
1286
|
path_params = {}
|
1287
|
+
if 'object_key' in local_var_params:
|
1288
|
+
path_params['object_key'] = local_var_params['object_key']
|
1370
1289
|
|
1371
1290
|
query_params = []
|
1372
1291
|
if 'bucket_name' in local_var_params:
|
1373
1292
|
cname = local_var_params['bucket_name']
|
1374
|
-
if '
|
1375
|
-
query_params.append(('
|
1293
|
+
if 'response_content_type' in local_var_params:
|
1294
|
+
query_params.append(('response-content-type', local_var_params['response_content_type']))
|
1295
|
+
if 'response_content_language' in local_var_params:
|
1296
|
+
query_params.append(('response-content-language', local_var_params['response_content_language']))
|
1297
|
+
if 'response_expires' in local_var_params:
|
1298
|
+
query_params.append(('response-expires', local_var_params['response_expires']))
|
1299
|
+
if 'response_cache_control' in local_var_params:
|
1300
|
+
query_params.append(('response-cache-control', local_var_params['response_cache_control']))
|
1301
|
+
if 'response_content_disposition' in local_var_params:
|
1302
|
+
query_params.append(('response-content-disposition', local_var_params['response_content_disposition']))
|
1303
|
+
if 'response_content_encoding' in local_var_params:
|
1304
|
+
query_params.append(('response-content-encoding', local_var_params['response_content_encoding']))
|
1305
|
+
if 'version_id' in local_var_params:
|
1306
|
+
query_params.append(('versionId', local_var_params['version_id']))
|
1307
|
+
if 'x_image_process' in local_var_params:
|
1308
|
+
query_params.append(('x-image-process', local_var_params['x_image_process']))
|
1309
|
+
if 'attname' in local_var_params:
|
1310
|
+
query_params.append(('attname', local_var_params['attname']))
|
1376
1311
|
|
1377
1312
|
header_params = {}
|
1378
1313
|
if 'date' in local_var_params:
|
1379
1314
|
header_params['Date'] = local_var_params['date']
|
1380
|
-
if '
|
1381
|
-
header_params['
|
1315
|
+
if 'range' in local_var_params:
|
1316
|
+
header_params['Range'] = local_var_params['range']
|
1317
|
+
if 'if_modified_since' in local_var_params:
|
1318
|
+
header_params['If-Modified-Since'] = local_var_params['if_modified_since']
|
1319
|
+
if 'if_unmodified_since' in local_var_params:
|
1320
|
+
header_params['If-Unmodified-Since'] = local_var_params['if_unmodified_since']
|
1321
|
+
if 'if_match' in local_var_params:
|
1322
|
+
header_params['If-Match'] = local_var_params['if_match']
|
1323
|
+
if 'if_none_match' in local_var_params:
|
1324
|
+
header_params['If-None-Match'] = local_var_params['if_none_match']
|
1325
|
+
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
1326
|
+
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
1327
|
+
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
1328
|
+
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
1329
|
+
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
1330
|
+
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
1382
1331
|
|
1383
1332
|
form_params = {}
|
1384
1333
|
|
1385
1334
|
body = None
|
1386
|
-
if 'body' in local_var_params:
|
1387
|
-
body = local_var_params['body']
|
1388
1335
|
if isinstance(request, SdkStreamRequest):
|
1389
1336
|
body = request.get_file_stream()
|
1390
1337
|
|
1391
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
1338
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "x-obs-server-side-encryption", "x-obs-object-type", "x-obs-next-append-position", "Connection", "x-obs-server-side-encryption-customer-key-MD5", "x-obs-expiration", "Date", "ETag", "x-obs-server-side-encryption-customer-algorithm", "x-obs-server-side-encryption-kms-key-id", "Content-Length", "x-obs-website-redirect-location", "x-obs-delete-marker", "x-obs-version-id", ]
|
1392
1339
|
|
1393
1340
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1394
|
-
['application/
|
1341
|
+
['application/json'])
|
1395
1342
|
|
1396
1343
|
auth_settings = []
|
1397
1344
|
|
@@ -1406,33 +1353,35 @@ class ObsAsyncClient(Client):
|
|
1406
1353
|
|
1407
1354
|
return http_info
|
1408
1355
|
|
1409
|
-
def
|
1410
|
-
"""
|
1356
|
+
def get_object_metadata_async(self, request):
|
1357
|
+
"""Getting Metadata of an Object
|
1411
1358
|
|
1412
|
-
|
1359
|
+
This operation returns the metadata of an object. To use this operation, you must have the read permission on the object.
|
1360
|
+
This operation supports server-side encryption.
|
1413
1361
|
|
1414
|
-
|
1362
|
+
**Versioning**
|
1363
|
+
By default, this operation returns the metadata of the latest object version. If this object has a delete marker, status code 404 is returned. To obtain the metadata of a specific object version, add the **versionId** parameter in the request.
|
1415
1364
|
|
1416
1365
|
Please refer to HUAWEI cloud API Explorer for details.
|
1417
1366
|
|
1418
1367
|
|
1419
|
-
:param request: Request instance for
|
1420
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
1421
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
1368
|
+
:param request: Request instance for GetObjectMetadata
|
1369
|
+
:type request: :class:`huaweicloudsdkobs.v1.GetObjectMetadataRequest`
|
1370
|
+
:rtype: :class:`huaweicloudsdkobs.v1.GetObjectMetadataResponse`
|
1422
1371
|
"""
|
1423
|
-
http_info = self.
|
1372
|
+
http_info = self._get_object_metadata_http_info(request)
|
1424
1373
|
return self._call_api(**http_info)
|
1425
1374
|
|
1426
|
-
def
|
1427
|
-
http_info = self.
|
1375
|
+
def get_object_metadata_async_invoker(self, request):
|
1376
|
+
http_info = self._get_object_metadata_http_info(request)
|
1428
1377
|
return AsyncInvoker(self, http_info)
|
1429
1378
|
|
1430
|
-
def
|
1379
|
+
def _get_object_metadata_http_info(self, request):
|
1431
1380
|
http_info = {
|
1432
|
-
"method": "
|
1433
|
-
"resource_path": "/",
|
1381
|
+
"method": "HEAD",
|
1382
|
+
"resource_path": "/{object_key}",
|
1434
1383
|
"request_type": request.__class__.__name__,
|
1435
|
-
"response_type": "
|
1384
|
+
"response_type": "GetObjectMetadataResponse"
|
1436
1385
|
}
|
1437
1386
|
|
1438
1387
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1442,29 +1391,43 @@ class ObsAsyncClient(Client):
|
|
1442
1391
|
collection_formats = {}
|
1443
1392
|
|
1444
1393
|
path_params = {}
|
1394
|
+
if 'object_key' in local_var_params:
|
1395
|
+
path_params['object_key'] = local_var_params['object_key']
|
1445
1396
|
|
1446
1397
|
query_params = []
|
1447
1398
|
if 'bucket_name' in local_var_params:
|
1448
1399
|
cname = local_var_params['bucket_name']
|
1449
|
-
if '
|
1450
|
-
query_params.append(('
|
1400
|
+
if 'version_id' in local_var_params:
|
1401
|
+
query_params.append(('versionId', local_var_params['version_id']))
|
1451
1402
|
|
1452
1403
|
header_params = {}
|
1453
1404
|
if 'date' in local_var_params:
|
1454
1405
|
header_params['Date'] = local_var_params['date']
|
1406
|
+
if 'origin' in local_var_params:
|
1407
|
+
header_params['Origin'] = local_var_params['origin']
|
1408
|
+
if 'access_control_request_headers' in local_var_params:
|
1409
|
+
header_params['Access-Control-Request-Headers'] = local_var_params['access_control_request_headers']
|
1410
|
+
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
1411
|
+
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
1412
|
+
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
1413
|
+
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
1414
|
+
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
1415
|
+
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
1416
|
+
if 'success_action_redirect' in local_var_params:
|
1417
|
+
header_params['success-action-redirect'] = local_var_params['success_action_redirect']
|
1418
|
+
if 'x_obs_expires' in local_var_params:
|
1419
|
+
header_params['x-obs-expires'] = local_var_params['x_obs_expires']
|
1455
1420
|
|
1456
1421
|
form_params = {}
|
1457
1422
|
|
1458
1423
|
body = None
|
1459
|
-
if 'body' in local_var_params:
|
1460
|
-
body = local_var_params['body']
|
1461
1424
|
if isinstance(request, SdkStreamRequest):
|
1462
1425
|
body = request.get_file_stream()
|
1463
1426
|
|
1464
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "
|
1427
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "x-obs-hash-crc64ecma", "Access-Control-Allow-Origin", "x-obs-server-side-encryption", "x-obs-restore", "x-obs-object-type", "x-obs-next-append-position", "Access-Control-Allow-Methods", "Connection", "x-obs-server-side-encryption-customer-key-MD5", "x-obs-expiration", "Date", "Access-Control-Allow-Headers", "x-obs-uploadId", "Access-Control-Expose-Headers", "ETag", "x-obs-server-side-encryption-customer-algorithm", "x-obs-storage-class", "x-obs-server-side-encryption-kms-key-id", "Content-Length", "Access-Control-Max-Age", "x-obs-website-redirect-location", "x-obs-version-id", ]
|
1465
1428
|
|
1466
1429
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1467
|
-
['application/
|
1430
|
+
['application/json'])
|
1468
1431
|
|
1469
1432
|
auth_settings = []
|
1470
1433
|
|
@@ -1479,40 +1442,31 @@ class ObsAsyncClient(Client):
|
|
1479
1442
|
|
1480
1443
|
return http_info
|
1481
1444
|
|
1482
|
-
def
|
1483
|
-
"""
|
1445
|
+
def put_object_async(self, request):
|
1446
|
+
"""Uploading an Object - PUT
|
1484
1447
|
|
1485
|
-
OBS
|
1486
|
-
|
1487
|
-
默认情况下,您的桶没有配置事件通知。这个时候桶的通知配置将是一个空NotificationConfiguration。对已配置有事件通知的桶,可以通过添加空NotificationConfiguration元素禁用消息通知功能。
|
1488
|
-
|
1489
|
-
<NotificationConfiguration>
|
1490
|
-
</NotificationConfiguration>
|
1491
|
-
|
1492
|
-
目前对象存储服务(OBS)支持包括简单通知服务(SMN)、函数工作流服务(FunctionGraph)在内的两种桶通知服务配置。以SMN为例,当OBS接收到配置消息通知的请求后,会验证指定的消息通知服务(SMN)主题是否存在及主题策略是否授权给了对象存储服务,验证通过后会向该主题订阅者发送一个测试消息通知。
|
1493
|
-
|
1494
|
-
为了能成功执行此配置操作,需要确保执行者拥有PutBucketNotification权限。默认情况下只有桶的所有者拥有该权限,但可以通过设置桶策略授权给其他用户。
|
1448
|
+
After you create a bucket in OBS, you can use this operation to upload an object to your bucket. This operation adds an object to a bucket. To use this operation, you must have write permissions on the bucket.The name of each object in a bucket must be unique.With versioning not enabled, if an object to be uploaded has the same name as an existing object in the bucket, the newly uploaded object will overwrite the existing one. To protect data from being corrupted during transmission, you can add the **Content-MD5** parameter in the request header. After receiving the request, OBS will perform an MD5 consistency check. If the two MD5 values are inconsistent, the system returns an error message.You can also specify the **x-obs-acl** parameter to configure an access control policy for the object. If an anonymous user does not specify **x-obs-acl** when uploading an object, the object can be accessed by all OBS users by default.This operation supports server-side encryption.The object size in a single upload is up to 5 GB. To upload a file larger than 5 GB, use the multipart upload.OBS does not have real folders. For easy data management, OBS allows you to simulate a folder by adding a slash (/) to the object name, for example, **test/123.jpg**. OBS will present **test** to you as a folder and **123.jpg** as the name of a file stored inside of **test**, but the object key is still actually **test/123.jpg**. Objects named this way appear as folders on OBS Console.**Differences Between PUT and POST** In the PUT method, parameters are passed using request headers. In the POST method, parameters are passed using form fields in the message body.To upload an object with PUT, you need to specify the object name in the URL. The object name is not required with the POST method that uses the bucket domain name as the URL. An example of an upload with PUT or POST is as follows:PUT /ObjectName HTTP/1.1POST / HTTP/1.1For POST upload, see the corresponding section.**Versioning** If versioning is enabled on a bucket, OBS assigns a unique version ID for the object you upload to the bucket and returns this version ID in the **x-obs-version-id** header in the response. If versioning is suspended for the bucket, the object version ID is **null**. For details about the bucket versioning status, see the configuration of bucket versioning.
|
1495
1449
|
|
1496
1450
|
Please refer to HUAWEI cloud API Explorer for details.
|
1497
1451
|
|
1498
1452
|
|
1499
|
-
:param request: Request instance for
|
1500
|
-
:type request: :class:`huaweicloudsdkobs.v1.
|
1501
|
-
:rtype: :class:`huaweicloudsdkobs.v1.
|
1453
|
+
:param request: Request instance for PutObject
|
1454
|
+
:type request: :class:`huaweicloudsdkobs.v1.PutObjectRequest`
|
1455
|
+
:rtype: :class:`huaweicloudsdkobs.v1.PutObjectResponse`
|
1502
1456
|
"""
|
1503
|
-
http_info = self.
|
1457
|
+
http_info = self._put_object_http_info(request)
|
1504
1458
|
return self._call_api(**http_info)
|
1505
1459
|
|
1506
|
-
def
|
1507
|
-
http_info = self.
|
1460
|
+
def put_object_async_invoker(self, request):
|
1461
|
+
http_info = self._put_object_http_info(request)
|
1508
1462
|
return AsyncInvoker(self, http_info)
|
1509
1463
|
|
1510
|
-
def
|
1464
|
+
def _put_object_http_info(self, request):
|
1511
1465
|
http_info = {
|
1512
1466
|
"method": "PUT",
|
1513
|
-
"resource_path": "/",
|
1467
|
+
"resource_path": "/{object_key}",
|
1514
1468
|
"request_type": request.__class__.__name__,
|
1515
|
-
"response_type": "
|
1469
|
+
"response_type": "PutObjectResponse"
|
1516
1470
|
}
|
1517
1471
|
|
1518
1472
|
local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
|
@@ -1522,29 +1476,61 @@ class ObsAsyncClient(Client):
|
|
1522
1476
|
collection_formats = {}
|
1523
1477
|
|
1524
1478
|
path_params = {}
|
1479
|
+
if 'object_key' in local_var_params:
|
1480
|
+
path_params['object_key'] = local_var_params['object_key']
|
1525
1481
|
|
1526
1482
|
query_params = []
|
1527
1483
|
if 'bucket_name' in local_var_params:
|
1528
1484
|
cname = local_var_params['bucket_name']
|
1529
|
-
if 'notification' in local_var_params:
|
1530
|
-
query_params.append(('notification', local_var_params['notification']))
|
1531
1485
|
|
1532
1486
|
header_params = {}
|
1533
1487
|
if 'date' in local_var_params:
|
1534
1488
|
header_params['Date'] = local_var_params['date']
|
1489
|
+
if 'content_md5' in local_var_params:
|
1490
|
+
header_params['Content-MD5'] = local_var_params['content_md5']
|
1491
|
+
if 'x_obs_acl' in local_var_params:
|
1492
|
+
header_params['x-obs-acl'] = local_var_params['x_obs_acl']
|
1493
|
+
if 'x_obs_grant_read' in local_var_params:
|
1494
|
+
header_params['x-obs-grant-read'] = local_var_params['x_obs_grant_read']
|
1495
|
+
if 'x_obs_grant_read_acp' in local_var_params:
|
1496
|
+
header_params['x-obs-grant-read-acp'] = local_var_params['x_obs_grant_read_acp']
|
1497
|
+
if 'x_obs_grant_write_acp' in local_var_params:
|
1498
|
+
header_params['x-obs-grant-write-acp'] = local_var_params['x_obs_grant_write_acp']
|
1499
|
+
if 'x_obs_grant_full_control' in local_var_params:
|
1500
|
+
header_params['x-obs-grant-full-control'] = local_var_params['x_obs_grant_full_control']
|
1501
|
+
if 'x_obs_storage_class' in local_var_params:
|
1502
|
+
header_params['x-obs-storage-class'] = local_var_params['x_obs_storage_class']
|
1503
|
+
if 'x_obs_meta_xxx' in local_var_params:
|
1504
|
+
header_params['x-obs-meta-xxx'] = local_var_params['x_obs_meta_xxx']
|
1505
|
+
if 'x_obs_persistent_headers' in local_var_params:
|
1506
|
+
header_params['x-obs-persistent-headers'] = local_var_params['x_obs_persistent_headers']
|
1507
|
+
if 'x_obs_website_redirect_location' in local_var_params:
|
1508
|
+
header_params['x-obs-website-redirect-location'] = local_var_params['x_obs_website_redirect_location']
|
1509
|
+
if 'x_obs_server_side_encryption' in local_var_params:
|
1510
|
+
header_params['x-obs-server-side-encryption'] = local_var_params['x_obs_server_side_encryption']
|
1511
|
+
if 'x_obs_server_side_encryption_kms_key_id' in local_var_params:
|
1512
|
+
header_params['x-obs-server-side-encryption-kms-key-id'] = local_var_params['x_obs_server_side_encryption_kms_key_id']
|
1513
|
+
if 'x_obs_server_side_encryption_customer_algorithm' in local_var_params:
|
1514
|
+
header_params['x-obs-server-side-encryption-customer-algorithm'] = local_var_params['x_obs_server_side_encryption_customer_algorithm']
|
1515
|
+
if 'x_obs_server_side_encryption_customer_key' in local_var_params:
|
1516
|
+
header_params['x-obs-server-side-encryption-customer-key'] = local_var_params['x_obs_server_side_encryption_customer_key']
|
1517
|
+
if 'x_obs_server_side_encryption_customer_key_md5' in local_var_params:
|
1518
|
+
header_params['x-obs-server-side-encryption-customer-key-MD5'] = local_var_params['x_obs_server_side_encryption_customer_key_md5']
|
1519
|
+
if 'success_action_redirect' in local_var_params:
|
1520
|
+
header_params['success-action-redirect'] = local_var_params['success_action_redirect']
|
1521
|
+
if 'x_obs_expires' in local_var_params:
|
1522
|
+
header_params['x-obs-expires'] = local_var_params['x_obs_expires']
|
1535
1523
|
|
1536
1524
|
form_params = {}
|
1537
1525
|
|
1538
1526
|
body = None
|
1539
|
-
if 'body' in local_var_params:
|
1540
|
-
body = local_var_params['body']
|
1541
1527
|
if isinstance(request, SdkStreamRequest):
|
1542
1528
|
body = request.get_file_stream()
|
1543
1529
|
|
1544
|
-
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "Connection", "Content-Length", "Date", ]
|
1530
|
+
response_headers = ["x-obs-id-2", "x-obs-request-id", "ETag", "x-obs-server-side-encryption", "x-obs-server-side-encryption-customer-algorithm", "x-obs-storage-class", "Connection", "x-obs-server-side-encryption-customer-key-MD5", "x-obs-server-side-encryption-kms-key-id", "Content-Length", "Date", "x-obs-version-id", ]
|
1545
1531
|
|
1546
1532
|
header_params['Content-Type'] = http_utils.select_header_content_type(
|
1547
|
-
['application/
|
1533
|
+
['application/octet-stream'])
|
1548
1534
|
|
1549
1535
|
auth_settings = []
|
1550
1536
|
|