huaweicloudsdkobs 3.1.75__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.
Files changed (49) hide show
  1. huaweicloudsdkobs/v1/__init__.py +0 -1
  2. huaweicloudsdkobs/v1/model/__init__.py +0 -1
  3. huaweicloudsdkobs/v1/model/bucket.py +15 -15
  4. huaweicloudsdkobs/v1/model/contents.py +18 -18
  5. huaweicloudsdkobs/v1/model/copy_object_request.py +78 -78
  6. huaweicloudsdkobs/v1/model/copy_object_response.py +3 -3
  7. huaweicloudsdkobs/v1/model/create_bucket_request.py +51 -51
  8. huaweicloudsdkobs/v1/model/create_bucket_request_body.py +3 -3
  9. huaweicloudsdkobs/v1/model/delete_bucket_customdomain_request.py +9 -9
  10. huaweicloudsdkobs/v1/model/delete_bucket_request.py +6 -6
  11. huaweicloudsdkobs/v1/model/delete_object.py +6 -6
  12. huaweicloudsdkobs/v1/model/delete_object_request.py +12 -12
  13. huaweicloudsdkobs/v1/model/delete_objects_request.py +12 -12
  14. huaweicloudsdkobs/v1/model/delete_objects_request_body.py +6 -6
  15. huaweicloudsdkobs/v1/model/delete_objects_response.py +3 -3
  16. huaweicloudsdkobs/v1/model/delete_result_deleted.py +12 -12
  17. huaweicloudsdkobs/v1/model/delete_result_error.py +9 -9
  18. huaweicloudsdkobs/v1/model/domains.py +9 -9
  19. huaweicloudsdkobs/v1/model/filter_rule.py +6 -6
  20. huaweicloudsdkobs/v1/model/function_stage_configuration.py +12 -12
  21. huaweicloudsdkobs/v1/model/get_bucket_acl_request.py +9 -9
  22. huaweicloudsdkobs/v1/model/get_bucket_customdomain_request.py +9 -9
  23. huaweicloudsdkobs/v1/model/get_bucket_customdomain_response.py +5 -9
  24. huaweicloudsdkobs/v1/model/get_bucket_metadata_request.py +12 -12
  25. huaweicloudsdkobs/v1/model/get_bucket_notification_request.py +9 -9
  26. huaweicloudsdkobs/v1/model/get_object_metadata_request.py +33 -33
  27. huaweicloudsdkobs/v1/model/get_object_request.py +60 -60
  28. huaweicloudsdkobs/v1/model/grant.py +6 -6
  29. huaweicloudsdkobs/v1/model/grantee.py +6 -6
  30. huaweicloudsdkobs/v1/model/list_buckets_request.py +6 -6
  31. huaweicloudsdkobs/v1/model/list_buckets_response.py +4 -4
  32. huaweicloudsdkobs/v1/model/list_objects_request.py +27 -27
  33. huaweicloudsdkobs/v1/model/list_objects_response.py +27 -27
  34. huaweicloudsdkobs/v1/model/owner.py +3 -3
  35. huaweicloudsdkobs/v1/model/put_object_request.py +60 -60
  36. huaweicloudsdkobs/v1/model/set_bucket_acl_request.py +12 -12
  37. huaweicloudsdkobs/v1/model/set_bucket_custom_domain_body.py +15 -15
  38. huaweicloudsdkobs/v1/model/set_bucket_customedomain_request.py +9 -9
  39. huaweicloudsdkobs/v1/model/set_bucket_notification_request.py +9 -9
  40. huaweicloudsdkobs/v1/model/topic_configuration.py +9 -9
  41. huaweicloudsdkobs/v1/obs_async_client.py +543 -557
  42. huaweicloudsdkobs/v1/obs_client.py +543 -557
  43. {huaweicloudsdkobs-3.1.75.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/METADATA +2 -2
  44. huaweicloudsdkobs-3.1.77.dist-info/RECORD +70 -0
  45. huaweicloudsdkobs/v1/model/buckets.py +0 -117
  46. huaweicloudsdkobs-3.1.75.dist-info/RECORD +0 -71
  47. {huaweicloudsdkobs-3.1.75.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/LICENSE +0 -0
  48. {huaweicloudsdkobs-3.1.75.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/WHEEL +0 -0
  49. {huaweicloudsdkobs-3.1.75.dist-info → huaweicloudsdkobs-3.1.77.dist-info}/top_level.txt +0 -0
@@ -32,56 +32,33 @@ class ObsClient(Client):
32
32
 
33
33
  return client_builder
34
34
 
35
- def copy_object(self, request):
36
- """复制对象
35
+ def delete_bucket_customdomain(self, request):
36
+ """Deleting a Custom Domain Name of a Bucket
37
37
 
38
- 复制对象(Copy Object)特性用来为OBS上已经存在的对象创建一个副本。
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
- :param request: Request instance for CopyObject
68
- :type request: :class:`huaweicloudsdkobs.v1.CopyObjectRequest`
69
- :rtype: :class:`huaweicloudsdkobs.v1.CopyObjectResponse`
44
+ :param request: Request instance for DeleteBucketCustomdomain
45
+ :type request: :class:`huaweicloudsdkobs.v1.DeleteBucketCustomdomainRequest`
46
+ :rtype: :class:`huaweicloudsdkobs.v1.DeleteBucketCustomdomainResponse`
70
47
  """
71
- http_info = self._copy_object_http_info(request)
48
+ http_info = self._delete_bucket_customdomain_http_info(request)
72
49
  return self._call_api(**http_info)
73
50
 
74
- def copy_object_invoker(self, request):
75
- http_info = self._copy_object_http_info(request)
51
+ def delete_bucket_customdomain_invoker(self, request):
52
+ http_info = self._delete_bucket_customdomain_http_info(request)
76
53
  return SyncInvoker(self, http_info)
77
54
 
78
55
  @classmethod
79
- def _copy_object_http_info(cls, request):
56
+ def _delete_bucket_customdomain_http_info(cls, request):
80
57
  http_info = {
81
- "method": "PUT",
82
- "resource_path": "/{object_key}",
58
+ "method": "DELETE",
59
+ "resource_path": "/",
83
60
  "request_type": request.__class__.__name__,
84
- "response_type": "CopyObjectResponse"
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 ObsClient(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 ObsClient(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", "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", ]
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 ObsClient(Client):
172
103
 
173
104
  return http_info
174
105
 
175
- def create_bucket(self, request):
176
- """创建桶
106
+ def get_bucket_acl(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
- :param request: Request instance for CreateBucket
198
- :type request: :class:`huaweicloudsdkobs.v1.CreateBucketRequest`
199
- :rtype: :class:`huaweicloudsdkobs.v1.CreateBucketResponse`
113
+ :param request: Request instance for GetBucketAcl
114
+ :type request: :class:`huaweicloudsdkobs.v1.GetBucketAclRequest`
115
+ :rtype: :class:`huaweicloudsdkobs.v1.GetBucketAclResponse`
200
116
  """
201
- http_info = self._create_bucket_http_info(request)
117
+ http_info = self._get_bucket_acl_http_info(request)
202
118
  return self._call_api(**http_info)
203
119
 
204
- def create_bucket_invoker(self, request):
205
- http_info = self._create_bucket_http_info(request)
120
+ def get_bucket_acl_invoker(self, request):
121
+ http_info = self._get_bucket_acl_http_info(request)
206
122
  return SyncInvoker(self, http_info)
207
123
 
208
124
  @classmethod
209
- def _create_bucket_http_info(cls, request):
125
+ def _get_bucket_acl_http_info(cls, request):
210
126
  http_info = {
211
- "method": "PUT",
127
+ "method": "GET",
212
128
  "resource_path": "/",
213
129
  "request_type": request.__class__.__name__,
214
- "response_type": "CreateBucketResponse"
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 ObsClient(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/xml'])
160
+ ['application/json'])
275
161
 
276
162
  auth_settings = []
277
163
 
@@ -286,33 +172,35 @@ class ObsClient(Client):
286
172
 
287
173
  return http_info
288
174
 
289
- def delete_bucket(self, request):
290
- """删除桶
175
+ def get_bucket_customdomain(self, request):
176
+ """Getting a Custom Domain Name of a Bucket
291
177
 
292
- 删除桶操作用于删除用户指定的桶。只有桶的所有者或者拥有桶的删桶policy权限的用户可以执行删除桶的操作,要删除的桶必须是空桶。如果桶中有对象或者有多段任务则认为桶不为空,可以使用列举桶内对象和列举出多段上传任务接口来确认桶是否为空。
293
- 注:
294
- 如果删除桶时,服务端返回5XX错误或超时,系统需要时间进行桶信息一致性处理,在此期间桶的信息会不准确,过一段时间再查看桶是否删除成功,查询到桶,需要再次发送删除桶消息。
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
- :param request: Request instance for DeleteBucket
299
- :type request: :class:`huaweicloudsdkobs.v1.DeleteBucketRequest`
300
- :rtype: :class:`huaweicloudsdkobs.v1.DeleteBucketResponse`
186
+ :param request: Request instance for GetBucketCustomdomain
187
+ :type request: :class:`huaweicloudsdkobs.v1.GetBucketCustomdomainRequest`
188
+ :rtype: :class:`huaweicloudsdkobs.v1.GetBucketCustomdomainResponse`
301
189
  """
302
- http_info = self._delete_bucket_http_info(request)
190
+ http_info = self._get_bucket_customdomain_http_info(request)
303
191
  return self._call_api(**http_info)
304
192
 
305
- def delete_bucket_invoker(self, request):
306
- http_info = self._delete_bucket_http_info(request)
193
+ def get_bucket_customdomain_invoker(self, request):
194
+ http_info = self._get_bucket_customdomain_http_info(request)
307
195
  return SyncInvoker(self, http_info)
308
196
 
309
197
  @classmethod
310
- def _delete_bucket_http_info(cls, request):
198
+ def _get_bucket_customdomain_http_info(cls, request):
311
199
  http_info = {
312
- "method": "DELETE",
200
+ "method": "GET",
313
201
  "resource_path": "/",
314
202
  "request_type": request.__class__.__name__,
315
- "response_type": "DeleteBucketResponse"
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 ObsClient(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 ObsClient(Client):
355
245
 
356
246
  return http_info
357
247
 
358
- def delete_bucket_customdomain(self, request):
359
- """删除桶的自定义域名
248
+ def get_bucket_notification(self, request):
249
+ """Getting the Notification Configuration of a Bucket
360
250
 
361
- OBS使用DELETE操作来删除指定桶的标签。
251
+ This operation returns the notification configuration of a bucket.
362
252
 
363
- 要正确执行此操作,需要确保执行者有PutBucketcustomdomain权限。缺省情况下只有桶的所有者可以执行此操作,也可以通过设置桶策略或用户策略授权给其他用户。
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
- :param request: Request instance for DeleteBucketCustomdomain
368
- :type request: :class:`huaweicloudsdkobs.v1.DeleteBucketCustomdomainRequest`
369
- :rtype: :class:`huaweicloudsdkobs.v1.DeleteBucketCustomdomainResponse`
257
+ :param request: Request instance for GetBucketNotification
258
+ :type request: :class:`huaweicloudsdkobs.v1.GetBucketNotificationRequest`
259
+ :rtype: :class:`huaweicloudsdkobs.v1.GetBucketNotificationResponse`
370
260
  """
371
- http_info = self._delete_bucket_customdomain_http_info(request)
261
+ http_info = self._get_bucket_notification_http_info(request)
372
262
  return self._call_api(**http_info)
373
263
 
374
- def delete_bucket_customdomain_invoker(self, request):
375
- http_info = self._delete_bucket_customdomain_http_info(request)
264
+ def get_bucket_notification_invoker(self, request):
265
+ http_info = self._get_bucket_notification_http_info(request)
376
266
  return SyncInvoker(self, http_info)
377
267
 
378
268
  @classmethod
379
- def _delete_bucket_customdomain_http_info(cls, request):
269
+ def _get_bucket_notification_http_info(cls, request):
380
270
  http_info = {
381
- "method": "DELETE",
271
+ "method": "GET",
382
272
  "resource_path": "/",
383
273
  "request_type": request.__class__.__name__,
384
- "response_type": "DeleteBucketCustomdomainResponse"
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 ObsClient(Client):
395
285
  query_params = []
396
286
  if 'bucket_name' in local_var_params:
397
287
  cname = local_var_params['bucket_name']
398
- if 'customdomain' in local_var_params:
399
- query_params.append(('customdomain', local_var_params['customdomain']))
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 ObsClient(Client):
426
316
 
427
317
  return http_info
428
318
 
429
- def delete_object(self, request):
430
- """删除对象
319
+ def set_bucket_acl(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
- 如果要删除指定版本的对象,请求可携带versionId消息参数。
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
- :param request: Request instance for DeleteObject
442
- :type request: :class:`huaweicloudsdkobs.v1.DeleteObjectRequest`
443
- :rtype: :class:`huaweicloudsdkobs.v1.DeleteObjectResponse`
330
+ :param request: Request instance for SetBucketAcl
331
+ :type request: :class:`huaweicloudsdkobs.v1.SetBucketAclRequest`
332
+ :rtype: :class:`huaweicloudsdkobs.v1.SetBucketAclResponse`
444
333
  """
445
- http_info = self._delete_object_http_info(request)
334
+ http_info = self._set_bucket_acl_http_info(request)
446
335
  return self._call_api(**http_info)
447
336
 
448
- def delete_object_invoker(self, request):
449
- http_info = self._delete_object_http_info(request)
337
+ def set_bucket_acl_invoker(self, request):
338
+ http_info = self._set_bucket_acl_http_info(request)
450
339
  return SyncInvoker(self, http_info)
451
340
 
452
341
  @classmethod
453
- def _delete_object_http_info(cls, request):
342
+ def _set_bucket_acl_http_info(cls, request):
454
343
  http_info = {
455
- "method": "DELETE",
456
- "resource_path": "/{object_key}",
344
+ "method": "PUT",
345
+ "resource_path": "/",
457
346
  "request_type": request.__class__.__name__,
458
- "response_type": "DeleteObjectResponse"
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 ObsClient(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 'version_id' in local_var_params:
475
- query_params.append(('versionId', local_var_params['version_id']))
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", "x-obs-delete-marker", "x-obs-version-id", ]
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/json'])
381
+ ['application/xml'])
491
382
 
492
383
  auth_settings = []
493
384
 
@@ -502,35 +393,33 @@ class ObsClient(Client):
502
393
 
503
394
  return http_info
504
395
 
505
- def delete_objects(self, request):
506
- """批量删除对象
396
+ def set_bucket_customedomain(self, request):
397
+ """Configuring a Custom Domain Name for a Bucket
507
398
 
508
- 批量删除对象特性用于将一个桶内的部分对象一次性删除,删除后不可恢复。批量删除对象要求返回结果里包含每个对象的删除结果。OBS的批量删除对象使用同步删除对象的方式,每个对象的删除结果返回给请求用户。
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
- 批量删除对象支持两种响应方式:verbose和quiet。Verbose是指在返回响应时,不管对象是否删除成功都将删除结果包含在XML响应里;quiet是指在返回响应时,只返回删除失败的对象结果,没有返回的认为删除成功。OBS默认使用verbose模式,如果用户在请求消息体中指定quiet模式的话, 使用quiet模式。
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
- :param request: Request instance for DeleteObjects
517
- :type request: :class:`huaweicloudsdkobs.v1.DeleteObjectsRequest`
518
- :rtype: :class:`huaweicloudsdkobs.v1.DeleteObjectsResponse`
405
+ :param request: Request instance for SetBucketCustomedomain
406
+ :type request: :class:`huaweicloudsdkobs.v1.SetBucketCustomedomainRequest`
407
+ :rtype: :class:`huaweicloudsdkobs.v1.SetBucketCustomedomainResponse`
519
408
  """
520
- http_info = self._delete_objects_http_info(request)
409
+ http_info = self._set_bucket_customedomain_http_info(request)
521
410
  return self._call_api(**http_info)
522
411
 
523
- def delete_objects_invoker(self, request):
524
- http_info = self._delete_objects_http_info(request)
412
+ def set_bucket_customedomain_invoker(self, request):
413
+ http_info = self._set_bucket_customedomain_http_info(request)
525
414
  return SyncInvoker(self, http_info)
526
415
 
527
416
  @classmethod
528
- def _delete_objects_http_info(cls, request):
417
+ def _set_bucket_customedomain_http_info(cls, request):
529
418
  http_info = {
530
- "method": "POST",
419
+ "method": "PUT",
531
420
  "resource_path": "/",
532
421
  "request_type": request.__class__.__name__,
533
- "response_type": "DeleteObjectsResponse"
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 ObsClient(Client):
544
433
  query_params = []
545
434
  if 'bucket_name' in local_var_params:
546
435
  cname = local_var_params['bucket_name']
547
- if 'delete' in local_var_params:
548
- query_params.append(('delete', local_var_params['delete']))
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 ObsClient(Client):
579
466
 
580
467
  return http_info
581
468
 
582
- def get_bucket_acl(self, request):
583
- """获取桶ACL
469
+ def set_bucket_notification(self, request):
470
+ """Configuring Notifications for a Bucket
584
471
 
585
- 用户执行获取桶ACL的操作,返回信息包含指定桶的权限控制列表信息。用户必须拥有对指定桶READ_ACP的权限或FULL_CONTROL权限,才能执行获取桶ACL的操作。
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
- :param request: Request instance for GetBucketAcl
590
- :type request: :class:`huaweicloudsdkobs.v1.GetBucketAclRequest`
591
- :rtype: :class:`huaweicloudsdkobs.v1.GetBucketAclResponse`
485
+ :param request: Request instance for SetBucketNotification
486
+ :type request: :class:`huaweicloudsdkobs.v1.SetBucketNotificationRequest`
487
+ :rtype: :class:`huaweicloudsdkobs.v1.SetBucketNotificationResponse`
592
488
  """
593
- http_info = self._get_bucket_acl_http_info(request)
489
+ http_info = self._set_bucket_notification_http_info(request)
594
490
  return self._call_api(**http_info)
595
491
 
596
- def get_bucket_acl_invoker(self, request):
597
- http_info = self._get_bucket_acl_http_info(request)
492
+ def set_bucket_notification_invoker(self, request):
493
+ http_info = self._set_bucket_notification_http_info(request)
598
494
  return SyncInvoker(self, http_info)
599
495
 
600
496
  @classmethod
601
- def _get_bucket_acl_http_info(cls, request):
497
+ def _set_bucket_notification_http_info(cls, request):
602
498
  http_info = {
603
- "method": "GET",
499
+ "method": "PUT",
604
500
  "resource_path": "/",
605
501
  "request_type": request.__class__.__name__,
606
- "response_type": "GetBucketAclResponse"
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 ObsClient(Client):
617
513
  query_params = []
618
514
  if 'bucket_name' in local_var_params:
619
515
  cname = local_var_params['bucket_name']
620
- if 'acl' in local_var_params:
621
- query_params.append(('acl', local_var_params['acl']))
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 ObsClient(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/json'])
534
+ ['application/xml'])
637
535
 
638
536
  auth_settings = []
639
537
 
@@ -648,35 +546,46 @@ class ObsClient(Client):
648
546
 
649
547
  return http_info
650
548
 
651
- def get_bucket_customdomain(self, request):
652
- """获取桶的自定义域名
549
+ def create_bucket(self, request):
550
+ """Creating a Bucket
653
551
 
654
- OBS使用GET操作来获取桶的自定义域名。
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
- 要正确执行此操作,需要确保执行者有GetBucketcustomdomainConfiguration权限。桶拥有者默认具有此权限,并且可以将此权限授予其他人。
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
- 有关权限控制的更多信息请参考《对象存储服务权限配置指南》的[OBS权限控制概述](https://support.huaweicloud.com/perms-cfg-obs/obs_40_0001.html)章节。
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
- :param request: Request instance for GetBucketCustomdomain
663
- :type request: :class:`huaweicloudsdkobs.v1.GetBucketCustomdomainRequest`
664
- :rtype: :class:`huaweicloudsdkobs.v1.GetBucketCustomdomainResponse`
571
+ :param request: Request instance for CreateBucket
572
+ :type request: :class:`huaweicloudsdkobs.v1.CreateBucketRequest`
573
+ :rtype: :class:`huaweicloudsdkobs.v1.CreateBucketResponse`
665
574
  """
666
- http_info = self._get_bucket_customdomain_http_info(request)
575
+ http_info = self._create_bucket_http_info(request)
667
576
  return self._call_api(**http_info)
668
577
 
669
- def get_bucket_customdomain_invoker(self, request):
670
- http_info = self._get_bucket_customdomain_http_info(request)
578
+ def create_bucket_invoker(self, request):
579
+ http_info = self._create_bucket_http_info(request)
671
580
  return SyncInvoker(self, http_info)
672
581
 
673
582
  @classmethod
674
- def _get_bucket_customdomain_http_info(cls, request):
583
+ def _create_bucket_http_info(cls, request):
675
584
  http_info = {
676
- "method": "GET",
585
+ "method": "PUT",
677
586
  "resource_path": "/",
678
587
  "request_type": request.__class__.__name__,
679
- "response_type": "GetBucketCustomdomainResponse"
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 ObsClient(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/json'])
648
+ ['application/xml'])
710
649
 
711
650
  auth_settings = []
712
651
 
@@ -721,31 +660,33 @@ class ObsClient(Client):
721
660
 
722
661
  return http_info
723
662
 
724
- def get_bucket_metadata(self, request):
725
- """获取桶元数据
663
+ def delete_bucket(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
- :param request: Request instance for GetBucketMetadata
732
- :type request: :class:`huaweicloudsdkobs.v1.GetBucketMetadataRequest`
733
- :rtype: :class:`huaweicloudsdkobs.v1.GetBucketMetadataResponse`
672
+ :param request: Request instance for DeleteBucket
673
+ :type request: :class:`huaweicloudsdkobs.v1.DeleteBucketRequest`
674
+ :rtype: :class:`huaweicloudsdkobs.v1.DeleteBucketResponse`
734
675
  """
735
- http_info = self._get_bucket_metadata_http_info(request)
676
+ http_info = self._delete_bucket_http_info(request)
736
677
  return self._call_api(**http_info)
737
678
 
738
- def get_bucket_metadata_invoker(self, request):
739
- http_info = self._get_bucket_metadata_http_info(request)
679
+ def delete_bucket_invoker(self, request):
680
+ http_info = self._delete_bucket_http_info(request)
740
681
  return SyncInvoker(self, http_info)
741
682
 
742
683
  @classmethod
743
- def _get_bucket_metadata_http_info(cls, request):
684
+ def _delete_bucket_http_info(cls, request):
744
685
  http_info = {
745
- "method": "HEAD",
686
+ "method": "DELETE",
746
687
  "resource_path": "/",
747
688
  "request_type": request.__class__.__name__,
748
- "response_type": "GetBucketMetadataResponse"
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 ObsClient(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 ObsClient(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", "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", ]
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 ObsClient(Client):
792
729
 
793
730
  return http_info
794
731
 
795
- def get_bucket_notification(self, request):
796
- """获取桶的消息通知配置
732
+ def get_bucket_metadata(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
- :param request: Request instance for GetBucketNotification
805
- :type request: :class:`huaweicloudsdkobs.v1.GetBucketNotificationRequest`
806
- :rtype: :class:`huaweicloudsdkobs.v1.GetBucketNotificationResponse`
739
+ :param request: Request instance for GetBucketMetadata
740
+ :type request: :class:`huaweicloudsdkobs.v1.GetBucketMetadataRequest`
741
+ :rtype: :class:`huaweicloudsdkobs.v1.GetBucketMetadataResponse`
807
742
  """
808
- http_info = self._get_bucket_notification_http_info(request)
743
+ http_info = self._get_bucket_metadata_http_info(request)
809
744
  return self._call_api(**http_info)
810
745
 
811
- def get_bucket_notification_invoker(self, request):
812
- http_info = self._get_bucket_notification_http_info(request)
746
+ def get_bucket_metadata_invoker(self, request):
747
+ http_info = self._get_bucket_metadata_http_info(request)
813
748
  return SyncInvoker(self, http_info)
814
749
 
815
750
  @classmethod
816
- def _get_bucket_notification_http_info(cls, request):
751
+ def _get_bucket_metadata_http_info(cls, request):
817
752
  http_info = {
818
- "method": "GET",
753
+ "method": "HEAD",
819
754
  "resource_path": "/",
820
755
  "request_type": request.__class__.__name__,
821
- "response_type": "GetBucketNotificationResponse"
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 ObsClient(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 ObsClient(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", "ETag", "Connection", "Content-Length", "Date", ]
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 ObsClient(Client):
863
800
 
864
801
  return http_info
865
802
 
866
- def get_object(self, request):
867
- """获取对象内容
803
+ def list_buckets(self, request):
804
+ """Getting a List of Buckets
868
805
 
869
- GET操作从对象存储下载对象。使用GET接口前,请确认必须拥有对象的READ权限。如果对象Owner向匿名用户授予READ访问权限,则可以在不使用鉴权头域的情况下访问该对象。
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
- :param request: Request instance for GetObject
883
- :type request: :class:`huaweicloudsdkobs.v1.GetObjectRequest`
884
- :rtype: :class:`huaweicloudsdkobs.v1.GetObjectResponse`
810
+ :param request: Request instance for ListBuckets
811
+ :type request: :class:`huaweicloudsdkobs.v1.ListBucketsRequest`
812
+ :rtype: :class:`huaweicloudsdkobs.v1.ListBucketsResponse`
885
813
  """
886
- http_info = self._get_object_http_info(request)
814
+ http_info = self._list_buckets_http_info(request)
887
815
  return self._call_api(**http_info)
888
816
 
889
- def get_object_invoker(self, request):
890
- http_info = self._get_object_http_info(request)
817
+ def list_buckets_invoker(self, request):
818
+ http_info = self._list_buckets_http_info(request)
891
819
  return SyncInvoker(self, http_info)
892
820
 
893
821
  @classmethod
894
- def _get_object_http_info(cls, request):
822
+ def _list_buckets_http_info(cls, request):
895
823
  http_info = {
896
824
  "method": "GET",
897
- "resource_path": "/{object_key}",
825
+ "resource_path": "/",
898
826
  "request_type": request.__class__.__name__,
899
- "response_type": "GetObjectResponse"
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 ObsClient(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 'range' in local_var_params:
938
- header_params['Range'] = local_var_params['range']
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 ObsClient(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", "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", ]
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 ObsClient(Client):
975
867
 
976
868
  return http_info
977
869
 
978
- def get_object_metadata(self, request):
979
- """获取对象元数据
870
+ def list_objects(self, request):
871
+ """Listing Objects in a Bucket
980
872
 
981
- 拥有对象读权限的用户可以执行HEAD操作命令获取对象元数据,返回信息包含对象的元数据信息。
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
- :param request: Request instance for GetObjectMetadata
990
- :type request: :class:`huaweicloudsdkobs.v1.GetObjectMetadataRequest`
991
- :rtype: :class:`huaweicloudsdkobs.v1.GetObjectMetadataResponse`
877
+ :param request: Request instance for ListObjects
878
+ :type request: :class:`huaweicloudsdkobs.v1.ListObjectsRequest`
879
+ :rtype: :class:`huaweicloudsdkobs.v1.ListObjectsResponse`
992
880
  """
993
- http_info = self._get_object_metadata_http_info(request)
881
+ http_info = self._list_objects_http_info(request)
994
882
  return self._call_api(**http_info)
995
883
 
996
- def get_object_metadata_invoker(self, request):
997
- http_info = self._get_object_metadata_http_info(request)
884
+ def list_objects_invoker(self, request):
885
+ http_info = self._list_objects_http_info(request)
998
886
  return SyncInvoker(self, http_info)
999
887
 
1000
888
  @classmethod
1001
- def _get_object_metadata_http_info(cls, request):
889
+ def _list_objects_http_info(cls, request):
1002
890
  http_info = {
1003
- "method": "HEAD",
1004
- "resource_path": "/{object_key}",
891
+ "method": "GET",
892
+ "resource_path": "/",
1005
893
  "request_type": request.__class__.__name__,
1006
- "response_type": "GetObjectMetadataResponse"
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 ObsClient(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 'version_id' in local_var_params:
1023
- query_params.append(('versionId', local_var_params['version_id']))
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 ObsClient(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", "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", ]
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 ObsClient(Client):
1064
948
 
1065
949
  return http_info
1066
950
 
1067
- def list_buckets(self, request):
1068
- """获取桶列表
951
+ def copy_object(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
- :param request: Request instance for ListBuckets
1075
- :type request: :class:`huaweicloudsdkobs.v1.ListBucketsRequest`
1076
- :rtype: :class:`huaweicloudsdkobs.v1.ListBucketsResponse`
983
+ :param request: Request instance for CopyObject
984
+ :type request: :class:`huaweicloudsdkobs.v1.CopyObjectRequest`
985
+ :rtype: :class:`huaweicloudsdkobs.v1.CopyObjectResponse`
1077
986
  """
1078
- http_info = self._list_buckets_http_info(request)
987
+ http_info = self._copy_object_http_info(request)
1079
988
  return self._call_api(**http_info)
1080
989
 
1081
- def list_buckets_invoker(self, request):
1082
- http_info = self._list_buckets_http_info(request)
990
+ def copy_object_invoker(self, request):
991
+ http_info = self._copy_object_http_info(request)
1083
992
  return SyncInvoker(self, http_info)
1084
993
 
1085
994
  @classmethod
1086
- def _list_buckets_http_info(cls, request):
995
+ def _copy_object_http_info(cls, request):
1087
996
  http_info = {
1088
- "method": "GET",
1089
- "resource_path": "/",
997
+ "method": "PUT",
998
+ "resource_path": "/{object_key}",
1090
999
  "request_type": request.__class__.__name__,
1091
- "response_type": "ListBucketsResponse"
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 ObsClient(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 'x_obs_bucket_type' in local_var_params:
1108
- header_params['x-obs-bucket-type'] = local_var_params['x_obs_bucket_type']
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 ObsClient(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-bucket-type", "Connection", "Content-Length", "Date", ]
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 ObsClient(Client):
1131
1088
 
1132
1089
  return http_info
1133
1090
 
1134
- def list_objects(self, request):
1135
- """列举桶内对象
1091
+ def delete_object(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
- 如果用户在请求的URI里只指定了桶名,即GET /BucketName,则返回信息中会包含桶内部分或所有对象的描述信息(一次最多返回1000个对象信息);如果用户还指定了prefix、marker、max-keys、delimiter参数中的一个或多个,则返回的对象列表将按照如表1所示规定的语义返回指定的对象。
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
- :param request: Request instance for ListObjects
1144
- :type request: :class:`huaweicloudsdkobs.v1.ListObjectsRequest`
1145
- :rtype: :class:`huaweicloudsdkobs.v1.ListObjectsResponse`
1103
+ :param request: Request instance for DeleteObject
1104
+ :type request: :class:`huaweicloudsdkobs.v1.DeleteObjectRequest`
1105
+ :rtype: :class:`huaweicloudsdkobs.v1.DeleteObjectResponse`
1146
1106
  """
1147
- http_info = self._list_objects_http_info(request)
1107
+ http_info = self._delete_object_http_info(request)
1148
1108
  return self._call_api(**http_info)
1149
1109
 
1150
- def list_objects_invoker(self, request):
1151
- http_info = self._list_objects_http_info(request)
1110
+ def delete_object_invoker(self, request):
1111
+ http_info = self._delete_object_http_info(request)
1152
1112
  return SyncInvoker(self, http_info)
1153
1113
 
1154
1114
  @classmethod
1155
- def _list_objects_http_info(cls, request):
1115
+ def _delete_object_http_info(cls, request):
1156
1116
  http_info = {
1157
- "method": "GET",
1158
- "resource_path": "/",
1117
+ "method": "DELETE",
1118
+ "resource_path": "/{object_key}",
1159
1119
  "request_type": request.__class__.__name__,
1160
- "response_type": "ListObjectsResponse"
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 ObsClient(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 'prefix' in local_var_params:
1175
- query_params.append(('prefix', local_var_params['prefix']))
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 ObsClient(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", "x-obs-bucket-type", "Connection", "Content-Length", "Date", ]
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 ObsClient(Client):
1214
1164
 
1215
1165
  return http_info
1216
1166
 
1217
- def put_object(self, request):
1218
- """PUT上传对象
1219
-
1220
- 用户在OBS系统中创建了桶之后,可以采用PUT操作的方式将对象上传到桶中。上传对象操作是指在指定的桶内增加一个对象,执行该操作需要用户拥有桶的写权限。
1221
- 说明: 同一个桶中存储的对象名是唯一的。
1222
- 在桶未开启多版本的情况下,如果在指定的桶内已经有相同的对象键值的对象,用户上传的新对象会覆盖原来的对象;为了确保数据在传输过程中没有遭到破坏,用户可以在请求消息头中加入Content-MD5参数。在这种情况下,OBS收到上传的对象后,会对对象进行MD5校验,如果不一致则返回出错信息。
1223
- 用户还可以在上传对象时指定x-obs-acl参数,设置对象的权限控制策略。如果匿名用户在上传对象时未指定x-obs-acl参数,则该对象默认可以被所有OBS用户访问。
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(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
- :param request: Request instance for PutObject
1237
- :type request: :class:`huaweicloudsdkobs.v1.PutObjectRequest`
1238
- :rtype: :class:`huaweicloudsdkobs.v1.PutObjectResponse`
1178
+ :param request: Request instance for DeleteObjects
1179
+ :type request: :class:`huaweicloudsdkobs.v1.DeleteObjectsRequest`
1180
+ :rtype: :class:`huaweicloudsdkobs.v1.DeleteObjectsResponse`
1239
1181
  """
1240
- http_info = self._put_object_http_info(request)
1182
+ http_info = self._delete_objects_http_info(request)
1241
1183
  return self._call_api(**http_info)
1242
1184
 
1243
- def put_object_invoker(self, request):
1244
- http_info = self._put_object_http_info(request)
1185
+ def delete_objects_invoker(self, request):
1186
+ http_info = self._delete_objects_http_info(request)
1245
1187
  return SyncInvoker(self, http_info)
1246
1188
 
1247
1189
  @classmethod
1248
- def _put_object_http_info(cls, request):
1190
+ def _delete_objects_http_info(cls, request):
1249
1191
  http_info = {
1250
- "method": "PUT",
1251
- "resource_path": "/{object_key}",
1192
+ "method": "POST",
1193
+ "resource_path": "/",
1252
1194
  "request_type": request.__class__.__name__,
1253
- "response_type": "PutObjectResponse"
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 ObsClient(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 'x_obs_acl' in local_var_params:
1276
- header_params['x-obs-acl'] = local_var_params['x_obs_acl']
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", "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", ]
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/octet-stream'])
1229
+ ['application/xml'])
1318
1230
 
1319
1231
  auth_settings = []
1320
1232
 
@@ -1329,35 +1241,40 @@ class ObsClient(Client):
1329
1241
 
1330
1242
  return http_info
1331
1243
 
1332
- def set_bucket_acl(self, request):
1333
- """设置桶ACL
1244
+ def get_object(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
- OBS用户在创建桶时可以设置权限控制策略,也可以通过ACL操作API接口对已存在的桶更改或者获取ACL(access control list) 。一个桶的ACL最多支持100条Grant授权。PUT接口为幂等的覆盖写语意,新设置的桶ACL将覆盖原有的桶ACL,如果需要修改或者删除某条ACL重新PUT一个新的桶ACL即可。
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
- 使用桶ACL进行权限控制请参考[《对象存储服务权限配置指南》的OBS权限控制概述章节](https://support.huaweicloud.com/perms-cfg-obs/obs_40_0001.html)。
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
- :param request: Request instance for SetBucketAcl
1344
- :type request: :class:`huaweicloudsdkobs.v1.SetBucketAclRequest`
1345
- :rtype: :class:`huaweicloudsdkobs.v1.SetBucketAclResponse`
1260
+ :param request: Request instance for GetObject
1261
+ :type request: :class:`huaweicloudsdkobs.v1.GetObjectRequest`
1262
+ :rtype: :class:`huaweicloudsdkobs.v1.GetObjectResponse`
1346
1263
  """
1347
- http_info = self._set_bucket_acl_http_info(request)
1264
+ http_info = self._get_object_http_info(request)
1348
1265
  return self._call_api(**http_info)
1349
1266
 
1350
- def set_bucket_acl_invoker(self, request):
1351
- http_info = self._set_bucket_acl_http_info(request)
1267
+ def get_object_invoker(self, request):
1268
+ http_info = self._get_object_http_info(request)
1352
1269
  return SyncInvoker(self, http_info)
1353
1270
 
1354
1271
  @classmethod
1355
- def _set_bucket_acl_http_info(cls, request):
1272
+ def _get_object_http_info(cls, request):
1356
1273
  http_info = {
1357
- "method": "PUT",
1358
- "resource_path": "/",
1274
+ "method": "GET",
1275
+ "resource_path": "/{object_key}",
1359
1276
  "request_type": request.__class__.__name__,
1360
- "response_type": "SetBucketAclResponse"
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 ObsClient(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 'acl' in local_var_params:
1375
- query_params.append(('acl', local_var_params['acl']))
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 'x_obs_acl' in local_var_params:
1381
- header_params['x-obs-acl'] = local_var_params['x_obs_acl']
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", "ETag", "Connection", "Content-Length", "Date", ]
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/xml'])
1341
+ ['application/json'])
1395
1342
 
1396
1343
  auth_settings = []
1397
1344
 
@@ -1406,33 +1353,35 @@ class ObsClient(Client):
1406
1353
 
1407
1354
  return http_info
1408
1355
 
1409
- def set_bucket_customedomain(self, request):
1410
- """设置桶的自定义域名
1356
+ def get_object_metadata(self, request):
1357
+ """Getting Metadata of an Object
1411
1358
 
1412
- OBS使用PUT操作为桶设置自定义域名,设置成功之后,用户访问桶的自定义域名就能访问到桶。
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
- 必须保证此自定义域名通过DNS能够正确解析到OBS服务。
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
- :param request: Request instance for SetBucketCustomedomain
1419
- :type request: :class:`huaweicloudsdkobs.v1.SetBucketCustomedomainRequest`
1420
- :rtype: :class:`huaweicloudsdkobs.v1.SetBucketCustomedomainResponse`
1367
+ :param request: Request instance for GetObjectMetadata
1368
+ :type request: :class:`huaweicloudsdkobs.v1.GetObjectMetadataRequest`
1369
+ :rtype: :class:`huaweicloudsdkobs.v1.GetObjectMetadataResponse`
1421
1370
  """
1422
- http_info = self._set_bucket_customedomain_http_info(request)
1371
+ http_info = self._get_object_metadata_http_info(request)
1423
1372
  return self._call_api(**http_info)
1424
1373
 
1425
- def set_bucket_customedomain_invoker(self, request):
1426
- http_info = self._set_bucket_customedomain_http_info(request)
1374
+ def get_object_metadata_invoker(self, request):
1375
+ http_info = self._get_object_metadata_http_info(request)
1427
1376
  return SyncInvoker(self, http_info)
1428
1377
 
1429
1378
  @classmethod
1430
- def _set_bucket_customedomain_http_info(cls, request):
1379
+ def _get_object_metadata_http_info(cls, request):
1431
1380
  http_info = {
1432
- "method": "PUT",
1433
- "resource_path": "/",
1381
+ "method": "HEAD",
1382
+ "resource_path": "/{object_key}",
1434
1383
  "request_type": request.__class__.__name__,
1435
- "response_type": "SetBucketCustomedomainResponse"
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 ObsClient(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 'customdomain' in local_var_params:
1450
- query_params.append(('customdomain', local_var_params['customdomain']))
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", "ETag", "Connection", "Content-Length", "Date", ]
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/xml'])
1430
+ ['application/json'])
1468
1431
 
1469
1432
  auth_settings = []
1470
1433
 
@@ -1479,40 +1442,31 @@ class ObsClient(Client):
1479
1442
 
1480
1443
  return http_info
1481
1444
 
1482
- def set_bucket_notification(self, request):
1483
- """设置桶的消息通知配置
1445
+ def put_object(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
- :param request: Request instance for SetBucketNotification
1499
- :type request: :class:`huaweicloudsdkobs.v1.SetBucketNotificationRequest`
1500
- :rtype: :class:`huaweicloudsdkobs.v1.SetBucketNotificationResponse`
1452
+ :param request: Request instance for PutObject
1453
+ :type request: :class:`huaweicloudsdkobs.v1.PutObjectRequest`
1454
+ :rtype: :class:`huaweicloudsdkobs.v1.PutObjectResponse`
1501
1455
  """
1502
- http_info = self._set_bucket_notification_http_info(request)
1456
+ http_info = self._put_object_http_info(request)
1503
1457
  return self._call_api(**http_info)
1504
1458
 
1505
- def set_bucket_notification_invoker(self, request):
1506
- http_info = self._set_bucket_notification_http_info(request)
1459
+ def put_object_invoker(self, request):
1460
+ http_info = self._put_object_http_info(request)
1507
1461
  return SyncInvoker(self, http_info)
1508
1462
 
1509
1463
  @classmethod
1510
- def _set_bucket_notification_http_info(cls, request):
1464
+ def _put_object_http_info(cls, 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": "SetBucketNotificationResponse"
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 ObsClient(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/xml'])
1533
+ ['application/octet-stream'])
1548
1534
 
1549
1535
  auth_settings = []
1550
1536