From d84e24d1828075001648ec720c9388e11bc02c90 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Fri, 3 Mar 2023 09:35:22 +0000 Subject: [PATCH] OBS API doc Reviewed-by: Sabelnikov, Dmitriy Reviewed-by: Hasko, Vladimir Co-authored-by: zhangyue Co-committed-by: zhangyue --- docs/obs/api-ref/.placeholder | 0 docs/obs/api-ref/ALL_META.TXT.json | 372 +++--- docs/obs/api-ref/CLASS.TXT.json | 327 +++--- docs/obs/api-ref/obs_04_0000.html | 16 +- docs/obs/api-ref/obs_04_0004.html | 2 +- docs/obs/api-ref/obs_04_0005.html | 28 +- docs/obs/api-ref/obs_04_0007.html | 10 +- docs/obs/api-ref/obs_04_0010.html | 999 ++++++++-------- docs/obs/api-ref/obs_04_0011.html | 1023 +++++++++-------- docs/obs/api-ref/obs_04_0012.html | 4 +- docs/obs/api-ref/obs_04_0015.html | 497 ++++---- docs/obs/api-ref/obs_04_0016.html | 493 ++++---- docs/obs/api-ref/obs_04_0017.html | 525 +++++---- docs/obs/api-ref/obs_04_0019.html | 2 + docs/obs/api-ref/obs_04_0020.html | 273 +++-- docs/obs/api-ref/obs_04_0021.html | 275 +++-- docs/obs/api-ref/obs_04_0022.html | 479 ++++---- docs/obs/api-ref/obs_04_0023.html | 211 ++-- docs/obs/api-ref/obs_04_0024.html | 116 +- docs/obs/api-ref/obs_04_0025.html | 84 +- docs/obs/api-ref/obs_04_0027.html | 514 +++++---- docs/obs/api-ref/obs_04_0028.html | 166 +-- docs/obs/api-ref/obs_04_0029.html | 82 +- docs/obs/api-ref/obs_04_0030.html | 273 ++--- docs/obs/api-ref/obs_04_0031.html | 268 ++--- docs/obs/api-ref/obs_04_0032.html | 235 ++-- docs/obs/api-ref/obs_04_0033.html | 224 ++-- docs/obs/api-ref/obs_04_0034.html | 380 +++--- docs/obs/api-ref/obs_04_0035.html | 373 +++--- docs/obs/api-ref/obs_04_0036.html | 92 +- docs/obs/api-ref/obs_04_0037.html | 131 ++- docs/obs/api-ref/obs_04_0038.html | 130 ++- docs/obs/api-ref/obs_04_0039.html | 312 ++--- docs/obs/api-ref/obs_04_0040.html | 295 +++-- docs/obs/api-ref/obs_04_0044.html | 118 +- docs/obs/api-ref/obs_04_0045.html | 124 +- docs/obs/api-ref/obs_04_0049.html | 182 +-- docs/obs/api-ref/obs_04_0050.html | 176 +-- docs/obs/api-ref/obs_04_0051.html | 94 +- docs/obs/api-ref/obs_04_0052.html | 132 +-- docs/obs/api-ref/obs_04_0053.html | 128 ++- docs/obs/api-ref/obs_04_0054.html | 134 +-- docs/obs/api-ref/obs_04_0059.html | 118 +- docs/obs/api-ref/obs_04_0060.html | 172 +-- docs/obs/api-ref/obs_04_0061.html | 102 +- docs/obs/api-ref/obs_04_0062.html | 192 ++-- docs/obs/api-ref/obs_04_0063.html | 198 ++-- docs/obs/api-ref/obs_04_0064.html | 102 +- docs/obs/api-ref/obs_04_0071.html | 154 +-- docs/obs/api-ref/obs_04_0072.html | 142 +-- docs/obs/api-ref/obs_04_0073.html | 90 +- docs/obs/api-ref/obs_04_0074.html | 224 ++-- docs/obs/api-ref/obs_04_0075.html | 206 ++-- docs/obs/api-ref/obs_04_0076.html | 90 +- docs/obs/api-ref/obs_04_0077.html | 150 +-- docs/obs/api-ref/obs_04_0078.html | 150 +-- docs/obs/api-ref/obs_04_0079.html | 8 + docs/obs/api-ref/obs_04_0080.html | 579 +++++----- docs/obs/api-ref/obs_04_0081.html | 745 ++++++------ docs/obs/api-ref/obs_04_0082.html | 294 ++--- docs/obs/api-ref/obs_04_0083.html | 682 +++++------ docs/obs/api-ref/obs_04_0084.html | 136 +-- docs/obs/api-ref/obs_04_0085.html | 80 +- docs/obs/api-ref/obs_04_0086.html | 248 ++-- docs/obs/api-ref/obs_04_0087.html | 107 +- docs/obs/api-ref/obs_04_0089.html | 260 +++-- docs/obs/api-ref/obs_04_0090.html | 262 ++--- docs/obs/api-ref/obs_04_0091.html | 373 ++++++ docs/obs/api-ref/obs_04_0092.html | 105 ++ docs/obs/api-ref/obs_04_0093.html | 92 ++ docs/obs/api-ref/obs_04_0094.html | 90 ++ docs/obs/api-ref/obs_04_0096.html | 6 +- docs/obs/api-ref/obs_04_0097.html | 340 +++--- docs/obs/api-ref/obs_04_0098.html | 236 ++-- docs/obs/api-ref/obs_04_0099.html | 64 +- docs/obs/api-ref/obs_04_0100.html | 69 +- docs/obs/api-ref/obs_04_0101.html | 283 ++--- docs/obs/api-ref/obs_04_0102.html | 272 ++--- docs/obs/api-ref/obs_04_0103.html | 71 +- docs/obs/api-ref/obs_04_0106.html | 287 ++--- docs/obs/api-ref/obs_04_0107.html | 223 ++-- docs/obs/api-ref/obs_04_0115.html | 46 +- docs/obs/api-ref/obs_04_0117.html | 2 +- docs/obs/api-ref/obs_04_0160.html | 335 ++++++ .../public_sys-resources/icon-arrowdn.gif | Bin 68 -> 1887 bytes .../public_sys-resources/icon-arrowrt.gif | Bin 70 -> 1890 bytes 86 files changed, 10167 insertions(+), 8517 deletions(-) delete mode 100644 docs/obs/api-ref/.placeholder create mode 100644 docs/obs/api-ref/obs_04_0091.html create mode 100644 docs/obs/api-ref/obs_04_0092.html create mode 100644 docs/obs/api-ref/obs_04_0093.html create mode 100644 docs/obs/api-ref/obs_04_0094.html create mode 100644 docs/obs/api-ref/obs_04_0160.html diff --git a/docs/obs/api-ref/.placeholder b/docs/obs/api-ref/.placeholder deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/obs/api-ref/ALL_META.TXT.json b/docs/obs/api-ref/ALL_META.TXT.json index 087cb83d1..91a634b9e 100644 --- a/docs/obs/api-ref/ALL_META.TXT.json +++ b/docs/obs/api-ref/ALL_META.TXT.json @@ -15,7 +15,7 @@ "code":"2", "des":"Welcome to the Object Storage Service API Reference. Object Storage Service (OBS) provides massive, secure, reliable, and cost-effective data storage capabilities for use", "doc_type":"api", - "kw":"Overview,Before You Start,API Reference (OBS)", + "kw":"Overview,Before You Start,API Reference", "title":"Overview", "githuburl":"" }, @@ -25,7 +25,7 @@ "code":"3", "des":"OBS provides Representational State Transfer (REST) APIs, allowing you to use HTTP or HTTPS requests to call them. For details, see Calling APIs.", "doc_type":"api", - "kw":"API Calling,Before You Start,API Reference (OBS)", + "kw":"API Calling,Before You Start,API Reference", "title":"API Calling", "githuburl":"" }, @@ -35,7 +35,7 @@ "code":"4", "des":"An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of services, see Regions and Endpoints.OBS prov", "doc_type":"api", - "kw":"Endpoints,Before You Start,API Reference (OBS)", + "kw":"Endpoints,Before You Start,API Reference", "title":"Endpoints", "githuburl":"" }, @@ -45,7 +45,7 @@ "code":"5", "des":"DomainYou can register a domain with the cloud service. The domain has full access permissions for all the resources and cloud services that are subscribed under it. The ", "doc_type":"api", - "kw":"Basic Concepts,Before You Start,API Reference (OBS)", + "kw":"Basic Concepts,Before You Start,API Reference", "title":"Basic Concepts", "githuburl":"" }, @@ -55,7 +55,7 @@ "code":"6", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", - "kw":"API Overview,API Reference (OBS)", + "kw":"API Overview,API Reference", "title":"API Overview", "githuburl":"" }, @@ -75,7 +75,7 @@ "code":"8", "des":"This section describes the structure of a REST API request.OBS uses URI to locate specific buckets, objects, and their parameters. Use URIs when you want to operate resou", "doc_type":"api", - "kw":"Constructing a Request,Calling APIs,API Reference (OBS)", + "kw":"Constructing a Request,Calling APIs,API Reference", "title":"Constructing a Request", "githuburl":"" }, @@ -95,7 +95,7 @@ "code":"10", "des":"OBS signs a request using AK/SK. When a client is sending a request to OBS, the message header must contain the SK, request time, request type, and other information of t", "doc_type":"api", - "kw":"User Signature Authentication,Authentication,API Reference (OBS)", + "kw":"User Signature Authentication,Authentication,API Reference", "title":"User Signature Authentication", "githuburl":"" }, @@ -105,7 +105,7 @@ "code":"11", "des":"For all API operations, the most common identity authentication is to carry signatures in headers.In the header, the signature is carried in the authorization header fiel", "doc_type":"api", - "kw":"Authentication of Signature in a Header,Authentication,API Reference (OBS)", + "kw":"Authentication of Signature in a Header,Authentication,API Reference", "title":"Authentication of Signature in a Header", "githuburl":"" }, @@ -115,7 +115,7 @@ "code":"12", "des":"OBS allows users to construct a URL for a specific operation. The URL contains information such as the user's AK, signature, validity period, and resources. Any user who ", "doc_type":"api", - "kw":"Authentication of Signature in a URL,Authentication,API Reference (OBS)", + "kw":"Authentication of Signature in a URL,Authentication,API Reference", "title":"Authentication of Signature in a URL", "githuburl":"" }, @@ -135,7 +135,7 @@ "code":"14", "des":"After sending a request, you will receive a response, including the status code, response header, and response body.A status code is a group of digits ranging from 2xx (i", "doc_type":"api", - "kw":"Returned Values,Calling APIs,API Reference (OBS)", + "kw":"Returned Values,Calling APIs,API Reference", "title":"Returned Values", "githuburl":"" }, @@ -155,7 +155,7 @@ "code":"16", "des":"A bucket is a container that stores objects in OBS. You need to create a bucket before storing data in OBS.The following describes how to call the API for creating a buck", "doc_type":"api", - "kw":"Creating a Bucket,Getting Started,API Reference (OBS)", + "kw":"Creating a Bucket,Getting Started,API Reference", "title":"Creating a Bucket", "githuburl":"" }, @@ -165,7 +165,7 @@ "code":"17", "des":"If you want to view information about all buckets created by yourself, you can call the API for listing buckets.The following describes how to call the API for listing bu", "doc_type":"api", - "kw":"Listing Buckets,Getting Started,API Reference (OBS)", + "kw":"Listing Buckets,Getting Started,API Reference", "title":"Listing Buckets", "githuburl":"" }, @@ -175,7 +175,7 @@ "code":"18", "des":"You can upload files of any type to OBS buckets for storage.The following describes how to call the API for uploading objects using the PUT method to a specified bucket. ", "doc_type":"api", - "kw":"Uploading an Object,Getting Started,API Reference (OBS)", + "kw":"Uploading an Object,Getting Started,API Reference", "title":"Uploading an Object", "githuburl":"" }, @@ -203,9 +203,9 @@ "uri":"obs_04_0020.html", "product_code":"obs", "code":"21", - "des":"You can perform this operation to list all buckets that you have created.This request contains no parameter.This request header uses common message fields. For details, s", + "des":"You can perform this operation to list all buckets that you have created.This request contains no parameters.This request header uses common message fields. For details, ", "doc_type":"api", - "kw":"Listing Buckets,Operations on Buckets,API Reference (OBS)", + "kw":"Listing Buckets,Operations on Buckets,API Reference", "title":"Listing Buckets", "githuburl":"" }, @@ -215,7 +215,7 @@ "code":"22", "des":"This operation is used to create a bucket with a specified name.By default, a user can have a maximum of 100 buckets.The name of a deleted bucket can be reused for a buck", "doc_type":"api", - "kw":"Creating a Bucket,Operations on Buckets,API Reference (OBS)", + "kw":"Creating a Bucket,Operations on Buckets,API Reference", "title":"Creating a Bucket", "githuburl":"" }, @@ -225,44 +225,54 @@ "code":"23", "des":"This operation lists objects in a bucket. To use this operation, you must have the permission to read the bucket.If you specify only the bucket name in the request URI, f", "doc_type":"api", - "kw":"Listing Objects in a Bucket,Operations on Buckets,API Reference (OBS)", + "kw":"Listing Objects in a Bucket,Operations on Buckets,API Reference", "title":"Listing Objects in a Bucket", "githuburl":"" }, + { + "uri":"obs_04_0160.html", + "product_code":"obs", + "code":"24", + "des":"This operation lists objects in a bucket. To use this operation, you must have the permission to read the bucket.If the bucket name is specified in a request URI and list", + "doc_type":"api", + "kw":"Listing Objects in a Bucket (V2),Operations on Buckets,API Reference", + "title":"Listing Objects in a Bucket (V2)", + "githuburl":"" + }, { "uri":"obs_04_0023.html", "product_code":"obs", - "code":"24", - "des":"This operation queries the metadata of a bucket. To use this operation, you must have the permission to read the bucket.This request contains no parameter.This request us", + "code":"25", + "des":"This operation queries the metadata of a bucket. To use this operation, you must have the permission to read the bucket.This request contains no parameters.This request u", "doc_type":"api", - "kw":"Obtaining Bucket Metadata,Operations on Buckets,API Reference (OBS)", + "kw":"Obtaining Bucket Metadata,Operations on Buckets,API Reference", "title":"Obtaining Bucket Metadata", "githuburl":"" }, { "uri":"obs_04_0024.html", "product_code":"obs", - "code":"25", + "code":"26", "des":"This operation obtains the location of a bucket. To use this operation, you must have the permission to read the bucket.This request contains no parameters.This request u", "doc_type":"api", - "kw":"Obtaining Bucket Location,Operations on Buckets,API Reference (OBS)", + "kw":"Obtaining Bucket Location,Operations on Buckets,API Reference", "title":"Obtaining Bucket Location", "githuburl":"" }, { "uri":"obs_04_0025.html", "product_code":"obs", - "code":"26", + "code":"27", "des":"This operation deletes specified buckets. This operation can be performed only by the bucket owner and users who have been authorized (via a policy) with the permission t", "doc_type":"api", - "kw":"Deleting Buckets,Operations on Buckets,API Reference (OBS)", + "kw":"Deleting Buckets,Operations on Buckets,API Reference", "title":"Deleting Buckets", "githuburl":"" }, { "uri":"obs_04_0026.html", "product_code":"obs", - "code":"27", + "code":"28", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", "kw":"Advanced Bucket Settings", @@ -272,287 +282,287 @@ { "uri":"obs_04_0027.html", "product_code":"obs", - "code":"28", + "code":"29", "des":"This operation creates or modifies policies for buckets. If the specified bucket already has a policy, the policy in the request will overwrite the existing one. There is", "doc_type":"api", - "kw":"Configuring a Bucket Policy,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring a Bucket Policy,Advanced Bucket Settings,API Reference", "title":"Configuring a Bucket Policy", "githuburl":"" }, { "uri":"obs_04_0028.html", "product_code":"obs", - "code":"29", + "code":"30", "des":"This operation uses the sub-resources of policy to return the policy information of a specified bucket.To perform this operation, the user must be the bucket owner or the", "doc_type":"api", - "kw":"Obtaining Bucket Policy Information,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket Policy Information,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket Policy Information", "githuburl":"" }, { "uri":"obs_04_0029.html", "product_code":"obs", - "code":"30", + "code":"31", "des":"This operation uses the policy sub-resources to delete the policy of a specified bucket.To perform this operation, the user must be the bucket owner or the bucket owner's", "doc_type":"api", - "kw":"Deleting a Bucket Policy,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Deleting a Bucket Policy,Advanced Bucket Settings,API Reference", "title":"Deleting a Bucket Policy", "githuburl":"" }, { "uri":"obs_04_0030.html", "product_code":"obs", - "code":"31", + "code":"32", "des":"This operation controls access permissions for buckets. By default, only the creator of a bucket has the permission to read and write the bucket. You can also set other a", "doc_type":"api", - "kw":"Configuring a Bucket ACL,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring a Bucket ACL,Advanced Bucket Settings,API Reference", "title":"Configuring a Bucket ACL", "githuburl":"" }, { "uri":"obs_04_0031.html", "product_code":"obs", - "code":"32", + "code":"33", "des":"This operation returns the ACL information of a bucket. To obtain the ACL of a bucket, you need to have the READ_ACP or FULL_CONTROL permission for the bucket.This reques", "doc_type":"api", - "kw":"Obtaining Bucket ACL Information,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket ACL Information,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket ACL Information", "githuburl":"" }, { "uri":"obs_04_0032.html", "product_code":"obs", - "code":"33", + "code":"34", "des":"When a bucket is created, the logging function is not enabled by default. To generate logs recording operations on buckets, you need to enable the logging function for th", "doc_type":"api", - "kw":"Configuring Logging for a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Logging for a Bucket,Advanced Bucket Settings,API Reference", "title":"Configuring Logging for a Bucket", "githuburl":"" }, { "uri":"obs_04_0033.html", "product_code":"obs", - "code":"34", + "code":"35", "des":"This operation queries the logging status of a bucket. It uses the logging sub-resource to return the logging status of a bucket.Only the bucket owner or users granted th", "doc_type":"api", - "kw":"Obtaining a Bucket Logging Configuration,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining a Bucket Logging Configuration,Advanced Bucket Settings,API Reference", "title":"Obtaining a Bucket Logging Configuration", "githuburl":"" }, { "uri":"obs_04_0034.html", "product_code":"obs", - "code":"35", + "code":"36", "des":"This operation configures lifecycle rules that can delete or migrate objects from a bucket at a specified time. Typical application scenarios:Delete periodically uploaded", "doc_type":"api", - "kw":"Configuring Bucket Lifecycle Rules,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Bucket Lifecycle Rules,Advanced Bucket Settings,API Reference", "title":"Configuring Bucket Lifecycle Rules", "githuburl":"" }, { "uri":"obs_04_0035.html", "product_code":"obs", - "code":"36", + "code":"37", "des":"This operation obtains the bucket lifecycle configuration.To perform this operation, you must have the GetLifecycleConfiguration permission. By default, only the bucket o", "doc_type":"api", - "kw":"Obtaining Bucket Lifecycle Configuration,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket Lifecycle Configuration,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket Lifecycle Configuration", "githuburl":"" }, { "uri":"obs_04_0036.html", "product_code":"obs", - "code":"37", + "code":"38", "des":"This operation deletes the lifecycle configuration of a bucket. After the lifecycle configuration of a bucket is deleted, OBS will not automatically delete objects in tha", "doc_type":"api", - "kw":"Deleting Lifecycle Rules,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Deleting Lifecycle Rules,Advanced Bucket Settings,API Reference", "title":"Deleting Lifecycle Rules", "githuburl":"" }, { "uri":"obs_04_0037.html", "product_code":"obs", - "code":"38", + "code":"39", "des":"This operation restores an object that is mistakenly overwritten or deleted. You can use versioning to save, query, and restore objects of different versions. Versioning ", "doc_type":"api", - "kw":"Configuring Versioning for a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Versioning for a Bucket,Advanced Bucket Settings,API Reference", "title":"Configuring Versioning for a Bucket", "githuburl":"" }, { "uri":"obs_04_0038.html", "product_code":"obs", - "code":"39", + "code":"40", "des":"This operation allows a bucket owner to get the versioning status of the bucket.If versioning is not configured for a bucket, no versioning status information will be ret", "doc_type":"api", - "kw":"Obtaining Bucket Versioning Status,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket Versioning Status,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket Versioning Status", "githuburl":"" }, { "uri":"obs_04_0039.html", "product_code":"obs", - "code":"40", + "code":"41", "des":"This operation notifies users of their operations on buckets, allowing users know events happened on buckets in a timely manner.By default, the notification function of a", "doc_type":"api", - "kw":"Configuring Event Notification for a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Event Notification for a Bucket,Advanced Bucket Settings,API Reference", "title":"Configuring Event Notification for a Bucket", "githuburl":"" }, { "uri":"obs_04_0040.html", "product_code":"obs", - "code":"41", + "code":"42", "des":"This operation obtains the notification configuration of a bucket.To perform this operation, you must have the GetBucketNotification permission. By default, the permissio", "doc_type":"api", - "kw":"Obtaining the Event Notification Configuration of a Bucket,Advanced Bucket Settings,API Reference (O", + "kw":"Obtaining the Event Notification Configuration of a Bucket,Advanced Bucket Settings,API Reference", "title":"Obtaining the Event Notification Configuration of a Bucket", "githuburl":"" }, { "uri":"obs_04_0044.html", "product_code":"obs", - "code":"42", + "code":"43", "des":"This operation sets or updates the default storage class of a bucket.To perform this operation, you must have the PutBucketStoragePolicy permission. By default, only the ", "doc_type":"api", - "kw":"Configuring Storage Class for a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Storage Class for a Bucket,Advanced Bucket Settings,API Reference", "title":"Configuring Storage Class for a Bucket", "githuburl":"" }, { "uri":"obs_04_0045.html", "product_code":"obs", - "code":"43", + "code":"44", "des":"This operation obtains the default storage class of a bucket.To perform this operation, you must have the GetBucketStoragePolicy permission. By default, only the bucket o", "doc_type":"api", - "kw":"Obtaining Bucket Storage Class Information,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket Storage Class Information,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket Storage Class Information", "githuburl":"" }, { "uri":"obs_04_0049.html", "product_code":"obs", - "code":"44", + "code":"45", "des":"This operation adds tags to a bucket.After tags are added to a bucket, all charging data records (CDRs) generated by the requests for this bucket will take the same tags.", "doc_type":"api", - "kw":"Configuring Tags for a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Tags for a Bucket,Advanced Bucket Settings,API Reference", "title":"Configuring Tags for a Bucket", "githuburl":"" }, { "uri":"obs_04_0050.html", "product_code":"obs", - "code":"45", + "code":"46", "des":"This operation obtains information about tags of a bucket.To perform this operation, you must have the GetBucketTagging permission. By default, only the bucket owner can ", "doc_type":"api", - "kw":"Obtaining Bucket Tags,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket Tags,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket Tags", "githuburl":"" }, { "uri":"obs_04_0051.html", "product_code":"obs", - "code":"46", + "code":"47", "des":"This operation deletes the tags of a bucket.To perform this operation, you must have the PutBucketTagging permission. By default, only the bucket owner can delete the tag", "doc_type":"api", - "kw":"Deleting Tags,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Deleting Tags,Advanced Bucket Settings,API Reference", "title":"Deleting Tags", "githuburl":"" }, { "uri":"obs_04_0052.html", "product_code":"obs", - "code":"47", + "code":"48", "des":"The bucket storage quota must be a positive integer in the unit of byte. The maximum storage quota is 263 – 1 bytes. The default bucket storage quota is 0, indicating tha", "doc_type":"api", - "kw":"Configuring Bucket Storage Quota,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Bucket Storage Quota,Advanced Bucket Settings,API Reference", "title":"Configuring Bucket Storage Quota", "githuburl":"" }, { "uri":"obs_04_0053.html", "product_code":"obs", - "code":"48", + "code":"49", "des":"Only the bucket owner can query information about the bucket storage quota. However, an inactive owner is not allowed to get the bucket quota. The bucket storage quota is", "doc_type":"api", - "kw":"Querying Bucket Storage Quota,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Querying Bucket Storage Quota,Advanced Bucket Settings,API Reference", "title":"Querying Bucket Storage Quota", "githuburl":"" }, { "uri":"obs_04_0054.html", "product_code":"obs", - "code":"49", + "code":"50", "des":"This operation queries the number of bucket objects and the space occupied by the objects. The size of the object space is a positive integer, measured by bytes.The OBS b", "doc_type":"api", - "kw":"Querying Information About Used Space in a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Querying Information About Used Space in a Bucket,Advanced Bucket Settings,API Reference", "title":"Querying Information About Used Space in a Bucket", "githuburl":"" }, { "uri":"obs_04_0059.html", "product_code":"obs", - "code":"50", + "code":"51", "des":"OBS uses the PUT method to configure a custom domain name for a bucket. After the configuration is successful, you can access the bucket through the domain name.Ensure th", "doc_type":"api", - "kw":"Configuring a Custom Domain Name for a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring a Custom Domain Name for a Bucket,Advanced Bucket Settings,API Reference", "title":"Configuring a Custom Domain Name for a Bucket", "githuburl":"" }, { "uri":"obs_04_0060.html", "product_code":"obs", - "code":"51", + "code":"52", "des":"OBS uses the GET method to obtain the custom domain name of a bucket.This request message does not contain the request parameters.This request uses common headers. For de", "doc_type":"api", - "kw":"Obtaining the Custom Domain Name of a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining the Custom Domain Name of a Bucket,Advanced Bucket Settings,API Reference", "title":"Obtaining the Custom Domain Name of a Bucket", "githuburl":"" }, { "uri":"obs_04_0061.html", "product_code":"obs", - "code":"52", + "code":"53", "des":"OBS uses the DELETE method to delete the custom domain name of a bucket.This request uses common headers. For details, see Table 3.This request involves no elements.The r", "doc_type":"api", - "kw":"Deleting the Custom Domain Name of a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Deleting the Custom Domain Name of a Bucket,Advanced Bucket Settings,API Reference", "title":"Deleting the Custom Domain Name of a Bucket", "githuburl":"" }, { "uri":"obs_04_0062.html", "product_code":"obs", - "code":"53", + "code":"54", "des":"OBS uses the PUT method to create or update the default server-side encryption for a bucket.After encryption is enabled for a bucket, objects uploaded to the bucket are e", "doc_type":"api", - "kw":"Configuring Bucket Encryption,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Configuring Bucket Encryption,Advanced Bucket Settings,API Reference", "title":"Configuring Bucket Encryption", "githuburl":"" }, { "uri":"obs_04_0063.html", "product_code":"obs", - "code":"54", + "code":"55", "des":"OBS uses the GET method to obtain the encryption configuration of a specified bucket.To perform this operation, you must have the GetEncryptionConfiguration permission. B", "doc_type":"api", - "kw":"Obtaining Bucket Encryption Configuration,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Obtaining Bucket Encryption Configuration,Advanced Bucket Settings,API Reference", "title":"Obtaining Bucket Encryption Configuration", "githuburl":"" }, { "uri":"obs_04_0064.html", "product_code":"obs", - "code":"55", + "code":"56", "des":"OBS uses the DELETE method to delete the encryption configuration of a specified bucket.To perform this operation, you must have the PutEncryptionConfiguration permission", "doc_type":"api", - "kw":"Deleting the Encryption Configuration of a Bucket,Advanced Bucket Settings,API Reference (OBS)", + "kw":"Deleting the Encryption Configuration of a Bucket,Advanced Bucket Settings,API Reference", "title":"Deleting the Encryption Configuration of a Bucket", "githuburl":"" }, { "uri":"obs_04_0070.html", "product_code":"obs", - "code":"56", + "code":"57", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", "kw":"Static Website Hosting", @@ -562,87 +572,87 @@ { "uri":"obs_04_0071.html", "product_code":"obs", - "code":"57", + "code":"58", "des":"OBS allows you to store static web page resources such as HTML web pages, flash files, videos, and audios in a bucket. When a client accesses these resources from the web", "doc_type":"api", - "kw":"Configuring Static Website Hosting for a Bucket,Static Website Hosting,API Reference (OBS)", + "kw":"Configuring Static Website Hosting for a Bucket,Static Website Hosting,API Reference", "title":"Configuring Static Website Hosting for a Bucket", "githuburl":"" }, { "uri":"obs_04_0072.html", "product_code":"obs", - "code":"58", + "code":"59", "des":"You can perform this operation to get the static website hosting configuration of a bucket.To perform this operation, you must have the GetBucketWebsite permission. By de", "doc_type":"api", - "kw":"Obtaining the Static Website Hosting Configuration of a Bucket,Static Website Hosting,API Reference ", + "kw":"Obtaining the Static Website Hosting Configuration of a Bucket,Static Website Hosting,API Reference", "title":"Obtaining the Static Website Hosting Configuration of a Bucket", "githuburl":"" }, { "uri":"obs_04_0073.html", "product_code":"obs", - "code":"59", + "code":"60", "des":"You can perform this operation to delete the website configuration of a bucket.To perform this operation, you must have the DeleteBucketWebsite permission. By default, on", "doc_type":"api", - "kw":"Deleting the Static Website Hosting Configuration of a Bucket,Static Website Hosting,API Reference (", + "kw":"Deleting the Static Website Hosting Configuration of a Bucket,Static Website Hosting,API Reference", "title":"Deleting the Static Website Hosting Configuration of a Bucket", "githuburl":"" }, { "uri":"obs_04_0074.html", "product_code":"obs", - "code":"60", + "code":"61", "des":"Cross-origin resource sharing (CORS) is a standard mechanism proposed by World Wide Web Consortium (W3C) and allows cross-origin requests from clients. For standard web p", "doc_type":"api", - "kw":"Configuring Bucket CORS,Static Website Hosting,API Reference (OBS)", + "kw":"Configuring Bucket CORS,Static Website Hosting,API Reference", "title":"Configuring Bucket CORS", "githuburl":"" }, { "uri":"obs_04_0075.html", "product_code":"obs", - "code":"61", + "code":"62", "des":"You can perform this operation to obtain CORS configuration information about a specified bucket.To perform this operation, you must have the GetBucketCORS permission. By", "doc_type":"api", - "kw":"Obtaining the CORS Configuration of a Bucket,Static Website Hosting,API Reference (OBS)", + "kw":"Obtaining the CORS Configuration of a Bucket,Static Website Hosting,API Reference", "title":"Obtaining the CORS Configuration of a Bucket", "githuburl":"" }, { "uri":"obs_04_0076.html", "product_code":"obs", - "code":"62", + "code":"63", "des":"This operation is used to delete the CORS configuration of a bucket. After the CORS configuration is deleted, the bucket and objects in it cannot be accessed by requests ", "doc_type":"api", - "kw":"Deleting the CORS Configuration of a Bucket,Static Website Hosting,API Reference (OBS)", + "kw":"Deleting the CORS Configuration of a Bucket,Static Website Hosting,API Reference", "title":"Deleting the CORS Configuration of a Bucket", "githuburl":"" }, { "uri":"obs_04_0077.html", "product_code":"obs", - "code":"63", + "code":"64", "des":"OPTIONS refers to pre-requests that are sent to servers by clients. Generally, the requests are used to check whether clients have permissions to perform operations on se", "doc_type":"api", - "kw":"OPTIONS Bucket,Static Website Hosting,API Reference (OBS)", + "kw":"OPTIONS Bucket,Static Website Hosting,API Reference", "title":"OPTIONS Bucket", "githuburl":"" }, { "uri":"obs_04_0078.html", "product_code":"obs", - "code":"64", + "code":"65", "des":"For details, see OPTIONS Bucket.With the OPTIONS Object, you need to specify an object name in the URL, but an object name is not required with the OPTIONS Bucket, which ", "doc_type":"api", - "kw":"OPTIONS Object,Static Website Hosting,API Reference (OBS)", + "kw":"OPTIONS Object,Static Website Hosting,API Reference", "title":"OPTIONS Object", "githuburl":"" }, { "uri":"obs_04_0079.html", "product_code":"obs", - "code":"65", + "code":"66", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", "kw":"Operations on Objects", @@ -652,107 +662,147 @@ { "uri":"obs_04_0080.html", "product_code":"obs", - "code":"66", + "code":"67", "des":"After bucket creation in OBS, you can use this operation to upload an object to the bucket. Uploading an object adds it to a bucket. This requires users to have the write", "doc_type":"api", - "kw":"Uploading Objects - PUT,Operations on Objects,API Reference (OBS)", + "kw":"Uploading Objects - PUT,Operations on Objects,API Reference", "title":"Uploading Objects - PUT", "githuburl":"" }, { "uri":"obs_04_0081.html", "product_code":"obs", - "code":"67", - "des":"Uploading an object adds it to a bucket. This requires users to have the write operation.The name of each object in a bucket must be unique.With versioning not enabled, i", + "code":"68", + "des":"This operation uploads an object to a bucket. To use this operation, you must have the write permission on the bucket.The name of each object in a bucket must be unique.W", "doc_type":"api", - "kw":"Uploading Objects - POST,Operations on Objects,API Reference (OBS)", + "kw":"Uploading Objects - POST,Operations on Objects,API Reference", "title":"Uploading Objects - POST", "githuburl":"" }, { "uri":"obs_04_0082.html", "product_code":"obs", - "code":"68", + "code":"69", "des":"You can perform this operation to create a copy of an existing object in OBS.Users can determine whether to copy the metadata of the source object to the target object (b", "doc_type":"api", - "kw":"Copying Objects,Operations on Objects,API Reference (OBS)", + "kw":"Copying Objects,Operations on Objects,API Reference", "title":"Copying Objects", "githuburl":"" }, { "uri":"obs_04_0083.html", "product_code":"obs", - "code":"69", + "code":"70", "des":"This operation downloads objects from OBS. Before using this GET operation, check that you have the read permission for the target object. If the object owner has granted", "doc_type":"api", - "kw":"Downloading Objects,Operations on Objects,API Reference (OBS)", + "kw":"Downloading Objects,Operations on Objects,API Reference", "title":"Downloading Objects", "githuburl":"" }, { "uri":"obs_04_0084.html", "product_code":"obs", - "code":"70", + "code":"71", "des":"Users with the read permission on objects can perform the HeadObject operation to obtain metadata of objects. The object metadata is included in the response.This operati", "doc_type":"api", - "kw":"Querying Object Metadata,Operations on Objects,API Reference (OBS)", + "kw":"Querying Object Metadata,Operations on Objects,API Reference", "title":"Querying Object Metadata", "githuburl":"" }, { "uri":"obs_04_0085.html", "product_code":"obs", - "code":"71", + "code":"72", "des":"You can perform this operation to delete an object. If you try to delete an object that does not exist, OBS will return a success message.When versioning is enabled for a", "doc_type":"api", - "kw":"Deleting an Object,Operations on Objects,API Reference (OBS)", + "kw":"Deleting an Object,Operations on Objects,API Reference", "title":"Deleting an Object", "githuburl":"" }, { "uri":"obs_04_0086.html", "product_code":"obs", - "code":"72", + "code":"73", "des":"This operation can be used to batch delete some objects in a bucket. The deletion cannot be undone. After the operation is implemented, the returned information contains ", "doc_type":"api", - "kw":"Deleting Objects,Operations on Objects,API Reference (OBS)", + "kw":"Deleting Objects,Operations on Objects,API Reference", "title":"Deleting Objects", "githuburl":"" }, { "uri":"obs_04_0087.html", "product_code":"obs", - "code":"73", + "code":"74", "des":"To obtain the content of an object in the Cold storage class, you need to restore the object first and then you can download it. After an object is restored, a copy of th", "doc_type":"api", - "kw":"Restoring Cold Objects,Operations on Objects,API Reference (OBS)", + "kw":"Restoring Cold Objects,Operations on Objects,API Reference", "title":"Restoring Cold Objects", "githuburl":"" }, { "uri":"obs_04_0089.html", "product_code":"obs", - "code":"74", + "code":"75", "des":"OBS supports the control of access permission for objects. By default, only the object creator has the read and write permissions for the object. However, the creator can", "doc_type":"api", - "kw":"Configuring an Object ACL,Operations on Objects,API Reference (OBS)", + "kw":"Configuring an Object ACL,Operations on Objects,API Reference", "title":"Configuring an Object ACL", "githuburl":"" }, { "uri":"obs_04_0090.html", "product_code":"obs", - "code":"75", + "code":"76", "des":"The implementation of this operation returns the ACL configuration of an object. You can perform this operation to view the ACL of an object, as long as you have the read", "doc_type":"api", - "kw":"Obtaining Object ACL Configuration,Operations on Objects,API Reference (OBS)", + "kw":"Obtaining Object ACL Configuration,Operations on Objects,API Reference", "title":"Obtaining Object ACL Configuration", "githuburl":"" }, + { + "uri":"obs_04_0091.html", + "product_code":"obs", + "code":"77", + "des":"This operation modifies, deletes, or adds metadata to uploaded objects in a bucket.OBS supports the six HTTP request headers: Cache-Control, Expires, Content-Encoding, Co", + "doc_type":"api", + "kw":"Modifying Object Metadata,Operations on Objects,API Reference", + "title":"Modifying Object Metadata", + "githuburl":"" + }, + { + "uri":"obs_04_0092.html", + "product_code":"obs", + "code":"78", + "des":"This operation can modify an object from a specified position.This API is supported only by parallel file systems. For details about how to create a parallel file system,", + "doc_type":"api", + "kw":"Modifying an Object,Operations on Objects,API Reference", + "title":"Modifying an Object", + "githuburl":"" + }, + { + "uri":"obs_04_0093.html", + "product_code":"obs", + "code":"79", + "des":"This operation can truncate an object to a specified size.This API is supported only by parallel file systems. For details about how to create a parallel file system, see", + "doc_type":"api", + "kw":"Truncating an Object,Operations on Objects,API Reference", + "title":"Truncating an Object", + "githuburl":"" + }, + { + "uri":"obs_04_0094.html", + "product_code":"obs", + "code":"80", + "des":"This operation can rename an object.This API is supported only by parallel file systems. For details about how to create a parallel file system, see Sample Request 4. Ren", + "doc_type":"api", + "kw":"Renaming an Object,Operations on Objects,API Reference", + "title":"Renaming an Object", + "githuburl":"" + }, { "uri":"obs_04_0096.html", "product_code":"obs", - "code":"76", + "code":"81", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", "kw":"Operations on Multipart Upload", @@ -762,77 +812,77 @@ { "uri":"obs_04_0097.html", "product_code":"obs", - "code":"77", + "code":"82", "des":"This operation queries all the multipart upload tasks that are initialized but have not been merged or canceled in a bucket.This request uses parameters to specify the qu", "doc_type":"api", - "kw":"Listing Initialized Multipart Tasks in a Bucket,Operations on Multipart Upload,API Reference (OBS)", - "title":"Listing Initialized Multipart Tasks in a Bucket", + "kw":"Listing Initiated Multipart Uploads in a Bucket,Operations on Multipart Upload,API Reference", + "title":"Listing Initiated Multipart Uploads in a Bucket", "githuburl":"" }, { "uri":"obs_04_0098.html", "product_code":"obs", - "code":"78", + "code":"83", "des":"Before using this operation, make an API operation call to create a multipart upload task. The system will return a globally unique upload ID as the multipart upload iden", "doc_type":"api", - "kw":"Initializing a Multipart Task,Operations on Multipart Upload,API Reference (OBS)", - "title":"Initializing a Multipart Task", + "kw":"Initiating a Multipart Upload,Operations on Multipart Upload,API Reference", + "title":"Initiating a Multipart Upload", "githuburl":"" }, { "uri":"obs_04_0099.html", "product_code":"obs", - "code":"79", + "code":"84", "des":"After initiating a multipart upload, you can use this operation to upload parts for the multipart upload using its task ID. When parts are uploaded in a multipart upload ", "doc_type":"api", - "kw":"Multipart Upload,Operations on Multipart Upload,API Reference (OBS)", + "kw":"Multipart Upload,Operations on Multipart Upload,API Reference", "title":"Multipart Upload", "githuburl":"" }, { "uri":"obs_04_0100.html", "product_code":"obs", - "code":"80", + "code":"85", "des":"After creating a multipart upload job, you can specify its upload ID and upload a part to the job in OBS. Alternatively, you can make an API call to add a part (part of a", "doc_type":"api", - "kw":"Uploading a Part of an Object - Copy,Operations on Multipart Upload,API Reference (OBS)", + "kw":"Uploading a Part of an Object - Copy,Operations on Multipart Upload,API Reference", "title":"Uploading a Part of an Object - Copy", "githuburl":"" }, { "uri":"obs_04_0101.html", "product_code":"obs", - "code":"81", + "code":"86", "des":"You can perform this operation to query all parts associated to a multipart upload. The size of each part listed by this API is the same as the size of the part uploaded.", "doc_type":"api", - "kw":"Listing Uploaded Parts of an Object,Operations on Multipart Upload,API Reference (OBS)", + "kw":"Listing Uploaded Parts of an Object,Operations on Multipart Upload,API Reference", "title":"Listing Uploaded Parts of an Object", "githuburl":"" }, { "uri":"obs_04_0102.html", "product_code":"obs", - "code":"82", + "code":"87", "des":"After uploading all parts for a multipart upload, you can use this operation to complete the multipart upload. Before performing this operation, you cannot download the u", "doc_type":"api", - "kw":"Merging Parts into a Complete Object,Operations on Multipart Upload,API Reference (OBS)", - "title":"Merging Parts into a Complete Object", + "kw":"Completing a Multipart Upload,Operations on Multipart Upload,API Reference", + "title":"Completing a Multipart Upload", "githuburl":"" }, { "uri":"obs_04_0103.html", "product_code":"obs", - "code":"83", + "code":"88", "des":"You can perform this operation to abort a multipart upload. You cannot upload or list parts after operations to merge parts or abort a multipart upload are performed.This", "doc_type":"api", - "kw":"Canceling a Multipart Upload Task,Operations on Multipart Upload,API Reference (OBS)", + "kw":"Canceling a Multipart Upload Task,Operations on Multipart Upload,API Reference", "title":"Canceling a Multipart Upload Task", "githuburl":"" }, { "uri":"obs_04_0104.html", "product_code":"obs", - "code":"84", + "code":"89", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", "kw":"Server-Side Encryption", @@ -842,47 +892,47 @@ { "uri":"obs_04_0105.html", "product_code":"obs", - "code":"85", + "code":"90", "des":"Users can upload and download objects in common mode or using server-side encryption.OBS supports server-side encryption.Users can implement this function based on the ke", "doc_type":"api", - "kw":"Server-Side Encryption Overview,Server-Side Encryption,API Reference (OBS)", + "kw":"Server-Side Encryption Overview,Server-Side Encryption,API Reference", "title":"Server-Side Encryption Overview", "githuburl":"" }, { "uri":"obs_04_0106.html", "product_code":"obs", - "code":"86", + "code":"91", "des":"In the SSE-KMS mode, OBS uses the keys provided by KMS for server-side encryption. When an object encrypted using SSE-KMS is added to a bucket in a region for the first t", "doc_type":"api", - "kw":"Server-Side Encryption (SSE-KMS),Server-Side Encryption,API Reference (OBS)", + "kw":"Server-Side Encryption (SSE-KMS),Server-Side Encryption,API Reference", "title":"Server-Side Encryption (SSE-KMS)", "githuburl":"" }, { "uri":"obs_04_0107.html", "product_code":"obs", - "code":"87", + "code":"92", "des":"In the SSE-C mode, OBS uses the keys and MD5 values provided by customers for server-side encryption.OBS does not store your encryption keys. If you lost your encryption ", "doc_type":"api", - "kw":"Server-Side Encryption (SSE-C),Server-Side Encryption,API Reference (OBS)", + "kw":"Server-Side Encryption (SSE-C),Server-Side Encryption,API Reference", "title":"Server-Side Encryption (SSE-C)", "githuburl":"" }, { "uri":"obs_04_0108.html", "product_code":"obs", - "code":"88", + "code":"93", "des":"This section lists the operations related to server-side encryption and describes HTTP protocols applicable to the operations.The following table describes the requiremen", "doc_type":"api", - "kw":"API Operations Related to Server-Side Encryption,Server-Side Encryption,API Reference (OBS)", + "kw":"API Operations Related to Server-Side Encryption,Server-Side Encryption,API Reference", "title":"API Operations Related to Server-Side Encryption", "githuburl":"" }, { "uri":"obs_04_0113.html", "product_code":"obs", - "code":"89", + "code":"94", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", "kw":"Appendixes", @@ -892,60 +942,60 @@ { "uri":"obs_04_0114.html", "product_code":"obs", - "code":"90", + "code":"95", "des":"Table 1 lists the status codes and prompt message returned by the server to the user.", "doc_type":"api", - "kw":"Status Codes,Appendixes,API Reference (OBS)", + "kw":"Status Codes,Appendixes,API Reference", "title":"Status Codes", "githuburl":"" }, { "uri":"obs_04_0115.html", "product_code":"obs", - "code":"91", + "code":"96", "des":"If an API call fails, no result data is returned. You can locate the cause of the error according to the error code of each API. If an API call fails, HTTP status code 3x", "doc_type":"api", - "kw":"Error Codes,Appendixes,API Reference (OBS)", + "kw":"Error Codes,Appendixes,API Reference", "title":"Error Codes", "githuburl":"" }, { "uri":"obs_04_0116.html", "product_code":"obs", - "code":"92", + "code":"97", "des":"When you call APIs, you need to use the AK and SK for authentication. To obtain the AK and SK, perform the following steps:Keep AKs and SKs properly to prevent informatio", "doc_type":"api", - "kw":"Obtaining Access Keys (AK/SK),Appendixes,API Reference (OBS)", + "kw":"Obtaining Access Keys (AK/SK),Appendixes,API Reference", "title":"Obtaining Access Keys (AK/SK)", "githuburl":"" }, { "uri":"obs_04_0117.html", "product_code":"obs", - "code":"93", - "des":"When an API is called, the domain ID (DomainID) and user ID (UserID) need to be specified in some requests. Therefore, you need to obtain them from the console. The proce", + "code":"98", + "des":"During API calls, the domain ID (DomainID) and user ID (UserID) need to be specified in some requests. Therefore, you need to obtain them from the console. The procedure ", "doc_type":"api", - "kw":"Obtaining the Domain ID and User ID,Appendixes,API Reference (OBS)", + "kw":"Obtaining the Domain ID and User ID,Appendixes,API Reference", "title":"Obtaining the Domain ID and User ID", "githuburl":"" }, { "uri":"obs_04_0118.html", "product_code":"obs", - "code":"94", + "code":"99", "des":"After a success message is returned in response to a client's write or deletion request, the client can obtain the latest data. If a client that initiates a write request", "doc_type":"api", - "kw":"Consistency of Concurrent Operations,Appendixes,API Reference (OBS)", + "kw":"Consistency of Concurrent Operations,Appendixes,API Reference", "title":"Consistency of Concurrent Operations", "githuburl":"" }, { "uri":"obs_04_0000.html", "product_code":"obs", - "code":"95", + "code":"100", "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", "doc_type":"api", - "kw":"Change History,API Reference (OBS)", + "kw":"Change History,API Reference", "title":"Change History", "githuburl":"" } diff --git a/docs/obs/api-ref/CLASS.TXT.json b/docs/obs/api-ref/CLASS.TXT.json index 81972687a..ae0d583c6 100644 --- a/docs/obs/api-ref/CLASS.TXT.json +++ b/docs/obs/api-ref/CLASS.TXT.json @@ -180,7 +180,7 @@ "code":"20" }, { - "desc":"You can perform this operation to list all buckets that you have created.This request contains no parameter.This request header uses common message fields. For details, s", + "desc":"You can perform this operation to list all buckets that you have created.This request contains no parameters.This request header uses common message fields. For details, ", "product_code":"obs", "title":"Listing Buckets", "uri":"obs_04_0020.html", @@ -207,13 +207,22 @@ "code":"23" }, { - "desc":"This operation queries the metadata of a bucket. To use this operation, you must have the permission to read the bucket.This request contains no parameter.This request us", + "desc":"This operation lists objects in a bucket. To use this operation, you must have the permission to read the bucket.If the bucket name is specified in a request URI and list", + "product_code":"obs", + "title":"Listing Objects in a Bucket (V2)", + "uri":"obs_04_0160.html", + "doc_type":"api", + "p_code":"20", + "code":"24" + }, + { + "desc":"This operation queries the metadata of a bucket. To use this operation, you must have the permission to read the bucket.This request contains no parameters.This request u", "product_code":"obs", "title":"Obtaining Bucket Metadata", "uri":"obs_04_0023.html", "doc_type":"api", "p_code":"20", - "code":"24" + "code":"25" }, { "desc":"This operation obtains the location of a bucket. To use this operation, you must have the permission to read the bucket.This request contains no parameters.This request u", @@ -222,7 +231,7 @@ "uri":"obs_04_0024.html", "doc_type":"api", "p_code":"20", - "code":"25" + "code":"26" }, { "desc":"This operation deletes specified buckets. This operation can be performed only by the bucket owner and users who have been authorized (via a policy) with the permission t", @@ -231,7 +240,7 @@ "uri":"obs_04_0025.html", "doc_type":"api", "p_code":"20", - "code":"26" + "code":"27" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -240,7 +249,7 @@ "uri":"obs_04_0026.html", "doc_type":"api", "p_code":"19", - "code":"27" + "code":"28" }, { "desc":"This operation creates or modifies policies for buckets. If the specified bucket already has a policy, the policy in the request will overwrite the existing one. There is", @@ -248,8 +257,8 @@ "title":"Configuring a Bucket Policy", "uri":"obs_04_0027.html", "doc_type":"api", - "p_code":"27", - "code":"28" + "p_code":"28", + "code":"29" }, { "desc":"This operation uses the sub-resources of policy to return the policy information of a specified bucket.To perform this operation, the user must be the bucket owner or the", @@ -257,8 +266,8 @@ "title":"Obtaining Bucket Policy Information", "uri":"obs_04_0028.html", "doc_type":"api", - "p_code":"27", - "code":"29" + "p_code":"28", + "code":"30" }, { "desc":"This operation uses the policy sub-resources to delete the policy of a specified bucket.To perform this operation, the user must be the bucket owner or the bucket owner's", @@ -266,8 +275,8 @@ "title":"Deleting a Bucket Policy", "uri":"obs_04_0029.html", "doc_type":"api", - "p_code":"27", - "code":"30" + "p_code":"28", + "code":"31" }, { "desc":"This operation controls access permissions for buckets. By default, only the creator of a bucket has the permission to read and write the bucket. You can also set other a", @@ -275,8 +284,8 @@ "title":"Configuring a Bucket ACL", "uri":"obs_04_0030.html", "doc_type":"api", - "p_code":"27", - "code":"31" + "p_code":"28", + "code":"32" }, { "desc":"This operation returns the ACL information of a bucket. To obtain the ACL of a bucket, you need to have the READ_ACP or FULL_CONTROL permission for the bucket.This reques", @@ -284,8 +293,8 @@ "title":"Obtaining Bucket ACL Information", "uri":"obs_04_0031.html", "doc_type":"api", - "p_code":"27", - "code":"32" + "p_code":"28", + "code":"33" }, { "desc":"When a bucket is created, the logging function is not enabled by default. To generate logs recording operations on buckets, you need to enable the logging function for th", @@ -293,8 +302,8 @@ "title":"Configuring Logging for a Bucket", "uri":"obs_04_0032.html", "doc_type":"api", - "p_code":"27", - "code":"33" + "p_code":"28", + "code":"34" }, { "desc":"This operation queries the logging status of a bucket. It uses the logging sub-resource to return the logging status of a bucket.Only the bucket owner or users granted th", @@ -302,8 +311,8 @@ "title":"Obtaining a Bucket Logging Configuration", "uri":"obs_04_0033.html", "doc_type":"api", - "p_code":"27", - "code":"34" + "p_code":"28", + "code":"35" }, { "desc":"This operation configures lifecycle rules that can delete or migrate objects from a bucket at a specified time. Typical application scenarios:Delete periodically uploaded", @@ -311,8 +320,8 @@ "title":"Configuring Bucket Lifecycle Rules", "uri":"obs_04_0034.html", "doc_type":"api", - "p_code":"27", - "code":"35" + "p_code":"28", + "code":"36" }, { "desc":"This operation obtains the bucket lifecycle configuration.To perform this operation, you must have the GetLifecycleConfiguration permission. By default, only the bucket o", @@ -320,8 +329,8 @@ "title":"Obtaining Bucket Lifecycle Configuration", "uri":"obs_04_0035.html", "doc_type":"api", - "p_code":"27", - "code":"36" + "p_code":"28", + "code":"37" }, { "desc":"This operation deletes the lifecycle configuration of a bucket. After the lifecycle configuration of a bucket is deleted, OBS will not automatically delete objects in tha", @@ -329,8 +338,8 @@ "title":"Deleting Lifecycle Rules", "uri":"obs_04_0036.html", "doc_type":"api", - "p_code":"27", - "code":"37" + "p_code":"28", + "code":"38" }, { "desc":"This operation restores an object that is mistakenly overwritten or deleted. You can use versioning to save, query, and restore objects of different versions. Versioning ", @@ -338,8 +347,8 @@ "title":"Configuring Versioning for a Bucket", "uri":"obs_04_0037.html", "doc_type":"api", - "p_code":"27", - "code":"38" + "p_code":"28", + "code":"39" }, { "desc":"This operation allows a bucket owner to get the versioning status of the bucket.If versioning is not configured for a bucket, no versioning status information will be ret", @@ -347,8 +356,8 @@ "title":"Obtaining Bucket Versioning Status", "uri":"obs_04_0038.html", "doc_type":"api", - "p_code":"27", - "code":"39" + "p_code":"28", + "code":"40" }, { "desc":"This operation notifies users of their operations on buckets, allowing users know events happened on buckets in a timely manner.By default, the notification function of a", @@ -356,8 +365,8 @@ "title":"Configuring Event Notification for a Bucket", "uri":"obs_04_0039.html", "doc_type":"api", - "p_code":"27", - "code":"40" + "p_code":"28", + "code":"41" }, { "desc":"This operation obtains the notification configuration of a bucket.To perform this operation, you must have the GetBucketNotification permission. By default, the permissio", @@ -365,8 +374,8 @@ "title":"Obtaining the Event Notification Configuration of a Bucket", "uri":"obs_04_0040.html", "doc_type":"api", - "p_code":"27", - "code":"41" + "p_code":"28", + "code":"42" }, { "desc":"This operation sets or updates the default storage class of a bucket.To perform this operation, you must have the PutBucketStoragePolicy permission. By default, only the ", @@ -374,8 +383,8 @@ "title":"Configuring Storage Class for a Bucket", "uri":"obs_04_0044.html", "doc_type":"api", - "p_code":"27", - "code":"42" + "p_code":"28", + "code":"43" }, { "desc":"This operation obtains the default storage class of a bucket.To perform this operation, you must have the GetBucketStoragePolicy permission. By default, only the bucket o", @@ -383,8 +392,8 @@ "title":"Obtaining Bucket Storage Class Information", "uri":"obs_04_0045.html", "doc_type":"api", - "p_code":"27", - "code":"43" + "p_code":"28", + "code":"44" }, { "desc":"This operation adds tags to a bucket.After tags are added to a bucket, all charging data records (CDRs) generated by the requests for this bucket will take the same tags.", @@ -392,8 +401,8 @@ "title":"Configuring Tags for a Bucket", "uri":"obs_04_0049.html", "doc_type":"api", - "p_code":"27", - "code":"44" + "p_code":"28", + "code":"45" }, { "desc":"This operation obtains information about tags of a bucket.To perform this operation, you must have the GetBucketTagging permission. By default, only the bucket owner can ", @@ -401,8 +410,8 @@ "title":"Obtaining Bucket Tags", "uri":"obs_04_0050.html", "doc_type":"api", - "p_code":"27", - "code":"45" + "p_code":"28", + "code":"46" }, { "desc":"This operation deletes the tags of a bucket.To perform this operation, you must have the PutBucketTagging permission. By default, only the bucket owner can delete the tag", @@ -410,8 +419,8 @@ "title":"Deleting Tags", "uri":"obs_04_0051.html", "doc_type":"api", - "p_code":"27", - "code":"46" + "p_code":"28", + "code":"47" }, { "desc":"The bucket storage quota must be a positive integer in the unit of byte. The maximum storage quota is 263 – 1 bytes. The default bucket storage quota is 0, indicating tha", @@ -419,8 +428,8 @@ "title":"Configuring Bucket Storage Quota", "uri":"obs_04_0052.html", "doc_type":"api", - "p_code":"27", - "code":"47" + "p_code":"28", + "code":"48" }, { "desc":"Only the bucket owner can query information about the bucket storage quota. However, an inactive owner is not allowed to get the bucket quota. The bucket storage quota is", @@ -428,8 +437,8 @@ "title":"Querying Bucket Storage Quota", "uri":"obs_04_0053.html", "doc_type":"api", - "p_code":"27", - "code":"48" + "p_code":"28", + "code":"49" }, { "desc":"This operation queries the number of bucket objects and the space occupied by the objects. The size of the object space is a positive integer, measured by bytes.The OBS b", @@ -437,8 +446,8 @@ "title":"Querying Information About Used Space in a Bucket", "uri":"obs_04_0054.html", "doc_type":"api", - "p_code":"27", - "code":"49" + "p_code":"28", + "code":"50" }, { "desc":"OBS uses the PUT method to configure a custom domain name for a bucket. After the configuration is successful, you can access the bucket through the domain name.Ensure th", @@ -446,8 +455,8 @@ "title":"Configuring a Custom Domain Name for a Bucket", "uri":"obs_04_0059.html", "doc_type":"api", - "p_code":"27", - "code":"50" + "p_code":"28", + "code":"51" }, { "desc":"OBS uses the GET method to obtain the custom domain name of a bucket.This request message does not contain the request parameters.This request uses common headers. For de", @@ -455,8 +464,8 @@ "title":"Obtaining the Custom Domain Name of a Bucket", "uri":"obs_04_0060.html", "doc_type":"api", - "p_code":"27", - "code":"51" + "p_code":"28", + "code":"52" }, { "desc":"OBS uses the DELETE method to delete the custom domain name of a bucket.This request uses common headers. For details, see Table 3.This request involves no elements.The r", @@ -464,8 +473,8 @@ "title":"Deleting the Custom Domain Name of a Bucket", "uri":"obs_04_0061.html", "doc_type":"api", - "p_code":"27", - "code":"52" + "p_code":"28", + "code":"53" }, { "desc":"OBS uses the PUT method to create or update the default server-side encryption for a bucket.After encryption is enabled for a bucket, objects uploaded to the bucket are e", @@ -473,8 +482,8 @@ "title":"Configuring Bucket Encryption", "uri":"obs_04_0062.html", "doc_type":"api", - "p_code":"27", - "code":"53" + "p_code":"28", + "code":"54" }, { "desc":"OBS uses the GET method to obtain the encryption configuration of a specified bucket.To perform this operation, you must have the GetEncryptionConfiguration permission. B", @@ -482,8 +491,8 @@ "title":"Obtaining Bucket Encryption Configuration", "uri":"obs_04_0063.html", "doc_type":"api", - "p_code":"27", - "code":"54" + "p_code":"28", + "code":"55" }, { "desc":"OBS uses the DELETE method to delete the encryption configuration of a specified bucket.To perform this operation, you must have the PutEncryptionConfiguration permission", @@ -491,8 +500,8 @@ "title":"Deleting the Encryption Configuration of a Bucket", "uri":"obs_04_0064.html", "doc_type":"api", - "p_code":"27", - "code":"55" + "p_code":"28", + "code":"56" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -501,7 +510,7 @@ "uri":"obs_04_0070.html", "doc_type":"api", "p_code":"19", - "code":"56" + "code":"57" }, { "desc":"OBS allows you to store static web page resources such as HTML web pages, flash files, videos, and audios in a bucket. When a client accesses these resources from the web", @@ -509,8 +518,8 @@ "title":"Configuring Static Website Hosting for a Bucket", "uri":"obs_04_0071.html", "doc_type":"api", - "p_code":"56", - "code":"57" + "p_code":"57", + "code":"58" }, { "desc":"You can perform this operation to get the static website hosting configuration of a bucket.To perform this operation, you must have the GetBucketWebsite permission. By de", @@ -518,8 +527,8 @@ "title":"Obtaining the Static Website Hosting Configuration of a Bucket", "uri":"obs_04_0072.html", "doc_type":"api", - "p_code":"56", - "code":"58" + "p_code":"57", + "code":"59" }, { "desc":"You can perform this operation to delete the website configuration of a bucket.To perform this operation, you must have the DeleteBucketWebsite permission. By default, on", @@ -527,8 +536,8 @@ "title":"Deleting the Static Website Hosting Configuration of a Bucket", "uri":"obs_04_0073.html", "doc_type":"api", - "p_code":"56", - "code":"59" + "p_code":"57", + "code":"60" }, { "desc":"Cross-origin resource sharing (CORS) is a standard mechanism proposed by World Wide Web Consortium (W3C) and allows cross-origin requests from clients. For standard web p", @@ -536,8 +545,8 @@ "title":"Configuring Bucket CORS", "uri":"obs_04_0074.html", "doc_type":"api", - "p_code":"56", - "code":"60" + "p_code":"57", + "code":"61" }, { "desc":"You can perform this operation to obtain CORS configuration information about a specified bucket.To perform this operation, you must have the GetBucketCORS permission. By", @@ -545,8 +554,8 @@ "title":"Obtaining the CORS Configuration of a Bucket", "uri":"obs_04_0075.html", "doc_type":"api", - "p_code":"56", - "code":"61" + "p_code":"57", + "code":"62" }, { "desc":"This operation is used to delete the CORS configuration of a bucket. After the CORS configuration is deleted, the bucket and objects in it cannot be accessed by requests ", @@ -554,8 +563,8 @@ "title":"Deleting the CORS Configuration of a Bucket", "uri":"obs_04_0076.html", "doc_type":"api", - "p_code":"56", - "code":"62" + "p_code":"57", + "code":"63" }, { "desc":"OPTIONS refers to pre-requests that are sent to servers by clients. Generally, the requests are used to check whether clients have permissions to perform operations on se", @@ -563,8 +572,8 @@ "title":"OPTIONS Bucket", "uri":"obs_04_0077.html", "doc_type":"api", - "p_code":"56", - "code":"63" + "p_code":"57", + "code":"64" }, { "desc":"For details, see OPTIONS Bucket.With the OPTIONS Object, you need to specify an object name in the URL, but an object name is not required with the OPTIONS Bucket, which ", @@ -572,8 +581,8 @@ "title":"OPTIONS Object", "uri":"obs_04_0078.html", "doc_type":"api", - "p_code":"56", - "code":"64" + "p_code":"57", + "code":"65" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -582,7 +591,7 @@ "uri":"obs_04_0079.html", "doc_type":"api", "p_code":"19", - "code":"65" + "code":"66" }, { "desc":"After bucket creation in OBS, you can use this operation to upload an object to the bucket. Uploading an object adds it to a bucket. This requires users to have the write", @@ -590,17 +599,17 @@ "title":"Uploading Objects - PUT", "uri":"obs_04_0080.html", "doc_type":"api", - "p_code":"65", - "code":"66" + "p_code":"66", + "code":"67" }, { - "desc":"Uploading an object adds it to a bucket. This requires users to have the write operation.The name of each object in a bucket must be unique.With versioning not enabled, i", + "desc":"This operation uploads an object to a bucket. To use this operation, you must have the write permission on the bucket.The name of each object in a bucket must be unique.W", "product_code":"obs", "title":"Uploading Objects - POST", "uri":"obs_04_0081.html", "doc_type":"api", - "p_code":"65", - "code":"67" + "p_code":"66", + "code":"68" }, { "desc":"You can perform this operation to create a copy of an existing object in OBS.Users can determine whether to copy the metadata of the source object to the target object (b", @@ -608,8 +617,8 @@ "title":"Copying Objects", "uri":"obs_04_0082.html", "doc_type":"api", - "p_code":"65", - "code":"68" + "p_code":"66", + "code":"69" }, { "desc":"This operation downloads objects from OBS. Before using this GET operation, check that you have the read permission for the target object. If the object owner has granted", @@ -617,8 +626,8 @@ "title":"Downloading Objects", "uri":"obs_04_0083.html", "doc_type":"api", - "p_code":"65", - "code":"69" + "p_code":"66", + "code":"70" }, { "desc":"Users with the read permission on objects can perform the HeadObject operation to obtain metadata of objects. The object metadata is included in the response.This operati", @@ -626,8 +635,8 @@ "title":"Querying Object Metadata", "uri":"obs_04_0084.html", "doc_type":"api", - "p_code":"65", - "code":"70" + "p_code":"66", + "code":"71" }, { "desc":"You can perform this operation to delete an object. If you try to delete an object that does not exist, OBS will return a success message.When versioning is enabled for a", @@ -635,8 +644,8 @@ "title":"Deleting an Object", "uri":"obs_04_0085.html", "doc_type":"api", - "p_code":"65", - "code":"71" + "p_code":"66", + "code":"72" }, { "desc":"This operation can be used to batch delete some objects in a bucket. The deletion cannot be undone. After the operation is implemented, the returned information contains ", @@ -644,8 +653,8 @@ "title":"Deleting Objects", "uri":"obs_04_0086.html", "doc_type":"api", - "p_code":"65", - "code":"72" + "p_code":"66", + "code":"73" }, { "desc":"To obtain the content of an object in the Cold storage class, you need to restore the object first and then you can download it. After an object is restored, a copy of th", @@ -653,8 +662,8 @@ "title":"Restoring Cold Objects", "uri":"obs_04_0087.html", "doc_type":"api", - "p_code":"65", - "code":"73" + "p_code":"66", + "code":"74" }, { "desc":"OBS supports the control of access permission for objects. By default, only the object creator has the read and write permissions for the object. However, the creator can", @@ -662,8 +671,8 @@ "title":"Configuring an Object ACL", "uri":"obs_04_0089.html", "doc_type":"api", - "p_code":"65", - "code":"74" + "p_code":"66", + "code":"75" }, { "desc":"The implementation of this operation returns the ACL configuration of an object. You can perform this operation to view the ACL of an object, as long as you have the read", @@ -671,8 +680,44 @@ "title":"Obtaining Object ACL Configuration", "uri":"obs_04_0090.html", "doc_type":"api", - "p_code":"65", - "code":"75" + "p_code":"66", + "code":"76" + }, + { + "desc":"This operation modifies, deletes, or adds metadata to uploaded objects in a bucket.OBS supports the six HTTP request headers: Cache-Control, Expires, Content-Encoding, Co", + "product_code":"obs", + "title":"Modifying Object Metadata", + "uri":"obs_04_0091.html", + "doc_type":"api", + "p_code":"66", + "code":"77" + }, + { + "desc":"This operation can modify an object from a specified position.This API is supported only by parallel file systems. For details about how to create a parallel file system,", + "product_code":"obs", + "title":"Modifying an Object", + "uri":"obs_04_0092.html", + "doc_type":"api", + "p_code":"66", + "code":"78" + }, + { + "desc":"This operation can truncate an object to a specified size.This API is supported only by parallel file systems. For details about how to create a parallel file system, see", + "product_code":"obs", + "title":"Truncating an Object", + "uri":"obs_04_0093.html", + "doc_type":"api", + "p_code":"66", + "code":"79" + }, + { + "desc":"This operation can rename an object.This API is supported only by parallel file systems. For details about how to create a parallel file system, see Sample Request 4. Ren", + "product_code":"obs", + "title":"Renaming an Object", + "uri":"obs_04_0094.html", + "doc_type":"api", + "p_code":"66", + "code":"80" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -681,25 +726,25 @@ "uri":"obs_04_0096.html", "doc_type":"api", "p_code":"19", - "code":"76" + "code":"81" }, { "desc":"This operation queries all the multipart upload tasks that are initialized but have not been merged or canceled in a bucket.This request uses parameters to specify the qu", "product_code":"obs", - "title":"Listing Initialized Multipart Tasks in a Bucket", + "title":"Listing Initiated Multipart Uploads in a Bucket", "uri":"obs_04_0097.html", "doc_type":"api", - "p_code":"76", - "code":"77" + "p_code":"81", + "code":"82" }, { "desc":"Before using this operation, make an API operation call to create a multipart upload task. The system will return a globally unique upload ID as the multipart upload iden", "product_code":"obs", - "title":"Initializing a Multipart Task", + "title":"Initiating a Multipart Upload", "uri":"obs_04_0098.html", "doc_type":"api", - "p_code":"76", - "code":"78" + "p_code":"81", + "code":"83" }, { "desc":"After initiating a multipart upload, you can use this operation to upload parts for the multipart upload using its task ID. When parts are uploaded in a multipart upload ", @@ -707,8 +752,8 @@ "title":"Multipart Upload", "uri":"obs_04_0099.html", "doc_type":"api", - "p_code":"76", - "code":"79" + "p_code":"81", + "code":"84" }, { "desc":"After creating a multipart upload job, you can specify its upload ID and upload a part to the job in OBS. Alternatively, you can make an API call to add a part (part of a", @@ -716,8 +761,8 @@ "title":"Uploading a Part of an Object - Copy", "uri":"obs_04_0100.html", "doc_type":"api", - "p_code":"76", - "code":"80" + "p_code":"81", + "code":"85" }, { "desc":"You can perform this operation to query all parts associated to a multipart upload. The size of each part listed by this API is the same as the size of the part uploaded.", @@ -725,17 +770,17 @@ "title":"Listing Uploaded Parts of an Object", "uri":"obs_04_0101.html", "doc_type":"api", - "p_code":"76", - "code":"81" + "p_code":"81", + "code":"86" }, { "desc":"After uploading all parts for a multipart upload, you can use this operation to complete the multipart upload. Before performing this operation, you cannot download the u", "product_code":"obs", - "title":"Merging Parts into a Complete Object", + "title":"Completing a Multipart Upload", "uri":"obs_04_0102.html", "doc_type":"api", - "p_code":"76", - "code":"82" + "p_code":"81", + "code":"87" }, { "desc":"You can perform this operation to abort a multipart upload. You cannot upload or list parts after operations to merge parts or abort a multipart upload are performed.This", @@ -743,8 +788,8 @@ "title":"Canceling a Multipart Upload Task", "uri":"obs_04_0103.html", "doc_type":"api", - "p_code":"76", - "code":"83" + "p_code":"81", + "code":"88" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -753,7 +798,7 @@ "uri":"obs_04_0104.html", "doc_type":"api", "p_code":"19", - "code":"84" + "code":"89" }, { "desc":"Users can upload and download objects in common mode or using server-side encryption.OBS supports server-side encryption.Users can implement this function based on the ke", @@ -761,8 +806,8 @@ "title":"Server-Side Encryption Overview", "uri":"obs_04_0105.html", "doc_type":"api", - "p_code":"84", - "code":"85" + "p_code":"89", + "code":"90" }, { "desc":"In the SSE-KMS mode, OBS uses the keys provided by KMS for server-side encryption. When an object encrypted using SSE-KMS is added to a bucket in a region for the first t", @@ -770,8 +815,8 @@ "title":"Server-Side Encryption (SSE-KMS)", "uri":"obs_04_0106.html", "doc_type":"api", - "p_code":"84", - "code":"86" + "p_code":"89", + "code":"91" }, { "desc":"In the SSE-C mode, OBS uses the keys and MD5 values provided by customers for server-side encryption.OBS does not store your encryption keys. If you lost your encryption ", @@ -779,8 +824,8 @@ "title":"Server-Side Encryption (SSE-C)", "uri":"obs_04_0107.html", "doc_type":"api", - "p_code":"84", - "code":"87" + "p_code":"89", + "code":"92" }, { "desc":"This section lists the operations related to server-side encryption and describes HTTP protocols applicable to the operations.The following table describes the requiremen", @@ -788,8 +833,8 @@ "title":"API Operations Related to Server-Side Encryption", "uri":"obs_04_0108.html", "doc_type":"api", - "p_code":"84", - "code":"88" + "p_code":"89", + "code":"93" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -798,7 +843,7 @@ "uri":"obs_04_0113.html", "doc_type":"api", "p_code":"", - "code":"89" + "code":"94" }, { "desc":"Table 1 lists the status codes and prompt message returned by the server to the user.", @@ -806,8 +851,8 @@ "title":"Status Codes", "uri":"obs_04_0114.html", "doc_type":"api", - "p_code":"89", - "code":"90" + "p_code":"94", + "code":"95" }, { "desc":"If an API call fails, no result data is returned. You can locate the cause of the error according to the error code of each API. If an API call fails, HTTP status code 3x", @@ -815,8 +860,8 @@ "title":"Error Codes", "uri":"obs_04_0115.html", "doc_type":"api", - "p_code":"89", - "code":"91" + "p_code":"94", + "code":"96" }, { "desc":"When you call APIs, you need to use the AK and SK for authentication. To obtain the AK and SK, perform the following steps:Keep AKs and SKs properly to prevent informatio", @@ -824,17 +869,17 @@ "title":"Obtaining Access Keys (AK/SK)", "uri":"obs_04_0116.html", "doc_type":"api", - "p_code":"89", - "code":"92" + "p_code":"94", + "code":"97" }, { - "desc":"When an API is called, the domain ID (DomainID) and user ID (UserID) need to be specified in some requests. Therefore, you need to obtain them from the console. The proce", + "desc":"During API calls, the domain ID (DomainID) and user ID (UserID) need to be specified in some requests. Therefore, you need to obtain them from the console. The procedure ", "product_code":"obs", "title":"Obtaining the Domain ID and User ID", "uri":"obs_04_0117.html", "doc_type":"api", - "p_code":"89", - "code":"93" + "p_code":"94", + "code":"98" }, { "desc":"After a success message is returned in response to a client's write or deletion request, the client can obtain the latest data. If a client that initiates a write request", @@ -842,8 +887,8 @@ "title":"Consistency of Concurrent Operations", "uri":"obs_04_0118.html", "doc_type":"api", - "p_code":"89", - "code":"94" + "p_code":"94", + "code":"99" }, { "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", @@ -852,6 +897,6 @@ "uri":"obs_04_0000.html", "doc_type":"api", "p_code":"", - "code":"95" + "code":"100" } ] \ No newline at end of file diff --git a/docs/obs/api-ref/obs_04_0000.html b/docs/obs/api-ref/obs_04_0000.html index 676fc7598..b44b78a10 100644 --- a/docs/obs/api-ref/obs_04_0000.html +++ b/docs/obs/api-ref/obs_04_0000.html @@ -8,7 +8,21 @@ -

2022-09-07

+

2023-01-30

+ +

This is the fifth official release.

+

This issue incorporates the following changes:

+ + + +

2022-10-30

+ +

This is the fourth official release.

+

This issue incorporates the following changes:

+ + + +

2022-09-07

This is the third official release.

This issue incorporates the following change:

diff --git a/docs/obs/api-ref/obs_04_0004.html b/docs/obs/api-ref/obs_04_0004.html index 2433f6235..a72c23508 100644 --- a/docs/obs/api-ref/obs_04_0004.html +++ b/docs/obs/api-ref/obs_04_0004.html @@ -2,7 +2,7 @@

Basic Concepts

Basic Concepts Related to OBS APIs

  • Domain

    You can register a domain with the cloud service. The domain has full access permissions for all the resources and cloud services that are subscribed under it. The domain can also reset user passwords and grant permissions to users. A domain is a payment entity. To keep the domain secure, it is recommended that you create users under the domain to perform routine management operations.

    -
  • User

    You can create users under a domain on Identity and Access Management (IAM), and authorize the users with permissions required for accessing cloud services. Each IAM user has its own identity credentials (password and access keys).

    +
  • User

    A user is created using a domain on Identity and Access Management (IAM) to use cloud services. Each IAM user has its own identity credentials (password and access keys).

    On the My Credentials page on the console, you can view the domain ID and user ID, you can also manage the access keys of the domain and IAM users.

    Access keys of the domain and its IAM users are required for authentication when calling APIs.

    diff --git a/docs/obs/api-ref/obs_04_0005.html b/docs/obs/api-ref/obs_04_0005.html index bc7bb4180..5eb953c2a 100644 --- a/docs/obs/api-ref/obs_04_0005.html +++ b/docs/obs/api-ref/obs_04_0005.html @@ -25,7 +25,7 @@

    Obtaining Bucket Metadata

    -

    Checks whether the bucket metadata exists. You can query the information about the bucket region, storage class, OBS version number, enterprise project ID, and CORS configuration.

    +

    Checks whether the bucket metadata exists. You can query the information about the bucket region, storage class, OBS version number, and CORS configuration.

    Obtaining Bucket Location

    @@ -301,6 +301,26 @@

    Obtains the ACL configuration of a specified object.

    +

    Modifying Object Metadata

    + +

    Adds, modifies, or deletes metadata of uploaded objects.

    + + +

    Modifying an Object

    + +

    Modifies the content of an object in a specified parallel file system from the specified location.

    + + +

    Truncating an Object

    + +

    Truncates an object in a specified parallel file system to the specified size.

    + + +

    Renaming an Object

    + +

    Renames an object in a specified parallel file system.

    + +
@@ -312,12 +332,12 @@ -

Listing Initialized Multipart Tasks in a Bucket

+

Listing Initiated Multipart Uploads in a Bucket

Queries all the multipart upload tasks that have not been merged or canceled in a bucket.

-

Initializing a Multipart Task

+

Initiating a Multipart Upload

Initiates a multipart upload task, and obtains the globally unique multipart upload task ID for subsequent operations, such as uploading, merging, and listing parts.

@@ -337,7 +357,7 @@

Queries information about all parts of a multipart task.

-

Merging Parts into a Complete Object

+

Completing a Multipart Upload

Merges the specified parts into a complete object.

diff --git a/docs/obs/api-ref/obs_04_0007.html b/docs/obs/api-ref/obs_04_0007.html index 9ede4dc95..e0b3afa96 100644 --- a/docs/obs/api-ref/obs_04_0007.html +++ b/docs/obs/api-ref/obs_04_0007.html @@ -16,7 +16,7 @@

protocol

-

Protocol used for sending requests, which can be either HTTP or HTTPS. HTTPS is a protocol that ensures secure access to resources. OBS supports both HTTP and HTTPS.

+

Protocol used for sending requests, which can be either HTTP or HTTPS. HTTPS is a protocol that ensures secure access to resources.

Yes

@@ -37,8 +37,8 @@

port

-

Port enabled for protocols used for sending requests. The value varies with software server deployment. If no port number is specified, the protocol uses the default value. Each transmission protocol has its default port number. For example, HTTP uses port number 80 and HTTPS uses port number 443 by default.

-

In OBS, HTTP port number is 80 and that of HTTPS is 443.

+

Port enabled for protocols used for sending requests. The value varies with software server deployment. If no port number is specified, the protocol uses the default value. Each transmission protocol has its default port number.

+

In OBS, the default HTTP port number is 80 and that of HTTPS is 443.

No

@@ -131,7 +131,7 @@

The message length (excluding headers) defined in RFC 2616

Type: string

No default value.

-

Conditional: required for PUT requests and those requests that load XML content.

+

Conditional: optional for PUT requests, but mandatory for the requests that load XML content

Conditionally required

@@ -157,7 +157,7 @@

Host

-

The host address. For example, bucketname.obs.region.example.com.

+

The host address, for example, bucketname.obs.region.example.com.

Type: string

No default value.

diff --git a/docs/obs/api-ref/obs_04_0010.html b/docs/obs/api-ref/obs_04_0010.html index 6314027db..1547a7ba1 100644 --- a/docs/obs/api-ref/obs_04_0010.html +++ b/docs/obs/api-ref/obs_04_0010.html @@ -4,7 +4,7 @@

For all API operations, the most common identity authentication is to carry signatures in headers.

In the header, the signature is carried in the authorization header field of the HTTP message. The format of the message header is as follows:

Authorization: OBS AccessKeyID:signature
-

The signature algorithm process is as follows:

+

The signature calculation process is as follows:

1. Construct the request character string (StringToSign).

2. Perform UTF-8 encoding on the result obtained from the preceding step.

3. Use the SK to perform the HMAC-SHA1 signature calculation on the result obtained from step 2.

@@ -50,14 +50,14 @@

CanonicalizedHeaders

OBS request header field in an HTTP request header, referring to header fields started with x-obs-, for example, x-obs-date, x-obs-acl, and x-obs-meta-*.

-
  1. All characters of keywords in a request header field must be converted to lowercase letters (content values must be case sensitive, for example, x-obs-storage-class:STANDARD). If a request contains multiple header fields, these fields should be organized by keyword in the alphabetical order from a to z.
  2. If multiple header fields in a request have the same prefix, combine the header fields into one. For example, x-obs-meta-name:name1 and x-obs-meta-name:name2 should be reorganized into x-obs-meta-name:name1,name2. Use comma to separate the values.
  3. Keywords in the request header field cannot contain non-ASCII or unrecognizable characters, which are also not advisable for values in the request header field. If the two types of characters are necessary, they should be encoded and decoded on the client side. Either URL encoding or Base64 encoding is acceptable, but the server does not perform decoding.
  4. Delete meaningless spaces and tabs in a header field. For example, x-obs-meta-name: name (with a meaningless space in the front of name) must be changed to x-obs-meta-name:name.
  5. Each header field occupies a separate line. See Table 4.
+
  1. All characters of keywords in a request header field must be converted to lowercase letters (content values must be case sensitive, for example, x-obs-storage-class:STANDARD). If a request contains multiple header fields, these fields should be organized by keyword in the alphabetical order from a to z.
  2. If multiple header fields in a request have the same prefix, combine the header fields into one. For example, x-obs-meta-name:name1 and x-obs-meta-name:name2 should be reorganized into x-obs-meta-name:name1,name2. Use comma to separate the values.
  3. Keywords in the request header field cannot contain non-ASCII or unrecognizable characters, which are also not advisable for values in the request header field. If the two types of characters are necessary, they should be encoded and decoded on the client side. Either URL encoding or Base64 encoding is acceptable, but the server does not perform decoding.
  4. Delete meaningless spaces and tabs in a header field. For example, x-obs-meta-name: name (with a meaningless space before name) must be changed to x-obs-meta-name:name.
  5. Each header field occupies a separate line. See Table 4.

CanonicalizedResource

Indicates the OBS resource specified by an HTTP request. This parameter is constructed as follows:

<Bucket name + Object name> + [Subresource 1] + [Subresource 2] + ...

-
  1. Bucket name and object name, for example, /bucket/object. If no object name is specified, for example, /bucket/, the entire bucket is listed. If no bucket name is specified either, the value of this field is /.
  2. If a subresource (such as ?acl and ?logging) exists, the subresource must be added.

    OBS supports a variety of sub-resources, including acl, attname, cors, customdomain, delete, deletebucket, encryption, length, lifecycle, location, logging, metadata, modify, name, notification, partNumber, policy, position, quota, replication, response-cache-control, response-content-disposition, response-content-encoding, response-content-language, response-content-type, response-expires, restore, storageClass, storagePolicy, storageinfo, tagging, torrent, uploadId, uploads, versionId, versioning, versions, website, and x-obs-security-token.

    +
    1. Bucket name and object name, for example, /bucket/object. If no object name is specified, for example, /bucket/, the entire bucket is listed. If no bucket name is specified either, the value of this field is /.
    2. If a subresource (such as ?acl and ?logging) exists, the subresource must be added.

      OBS supports a variety of sub-resources, including acl, attname, cors, customdomain, delete, deletebucket, encryption, length, lifecycle, location, logging, metadata, modify, name, notification, partNumber, policy, position, quota, rename, replication, response-cache-control, response-content-disposition, response-content-encoding, response-content-language, response-content-type, response-expires, restore, storageClass, storagePolicy, storageinfo, tagging, torrent, truncate, uploadId, uploads, versionId, versioning, versions, website, and x-obs-security-token.

    3. If there are multiple subresources, sort them in the alphabetical order from a to z, and use & to combine the subresources.
    NOTE:
    • A subresource is unique. Do not add subresources with the same keyword (for example, key=value1&key=value2) in the same request URL. In this case, signature is computed only based on the first subresource, and only the value of the first subresource takes effect on the actual service.
    • Using the GetObject API as an example, assume there is a bucket named bucket-test and an object named object-test in the bucket, and the object version is xxx. When obtaining the object, you need to rewrite Content-Type to text/plain. Then, the CanonicalizedResource calculated by the signature is /bucket-test/object-test?response-content-type=text/plain&versionId=xxx.
    @@ -214,45 +214,46 @@
-

Content-MD5 Algorithm in Java

 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
import java.security.MessageDigest;
-import sun.misc.BASE64Encoder;
-import java.io.UnsupportedEncodingException;
-import java.security.NoSuchAlgorithmException;
+

Content-MD5 Algorithm in Java

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
import java.security.MessageDigest;
+import sun.misc.BASE64Encoder;
+import java.io.UnsupportedEncodingException;
+import java.security.NoSuchAlgorithmException;
 
-public class Md5{
-     public static void main(String[] args) {
-          try {
-                 String exampleString = "blog";
-                 MessageDigest messageDigest = MessageDigest.getInstance("MD5"); 
-                 BASE64Encoder encoder = new BASE64Encoder(); 
-                 String contentMd5 = encoder.encode(messageDigest.digest(exampleString.getBytes("utf-8")));
-                 System.out.println("Content-MD5:" + contentMd5);    
-          } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) 
-          {
-                 e.printStackTrace();
-          }
-     }
+public class Md5{
+     public static void main(String[] args) {
+          try {
+                 String exampleString = "blog";
+                 MessageDigest messageDigest = MessageDigest.getInstance("MD5"); 
+                 BASE64Encoder encoder = new BASE64Encoder(); 
+                 String contentMd5 = encoder.encode(messageDigest.digest(exampleString.getBytes("utf-8")));
+                 System.out.println("Content-MD5:" + contentMd5);    
+          } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) 
+          {
+                 e.printStackTrace();
+          }
+     }
 }
-
-
+
+ +
The signature is generated as follows based on the StringToSign and SK. The hash-based message authentication code algorithm (HMAC algorithm) is used to generate the signature.
Signature = Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) )
@@ -270,471 +271,472 @@ Authorization: OBS UDSIAMSTUBTEST000254:ydH8ffpcbS6YpeOMcEZfn0wE90c= </CreateBucketConfiguration>

-

Signature Algorithm in Java

  1
-  2
-  3
-  4
-  5
-  6
-  7
-  8
-  9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-139
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-179
-180
-181
-182
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Base64;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.TreeMap;
+

Signature Calculation in Java

  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TreeMap;
 
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
 
-import org.omg.CosNaming.IstringHelper;
+import org.omg.CosNaming.IstringHelper;
 
 
-public class SignDemo {
-	
-	private static final String SIGN_SEP = "\n";
-	
-	private static final String OBS_PREFIX = "x-obs-";
-	
-	private static final String DEFAULT_ENCODING = "UTF-8";
-	
-	private static final List<String> SUB_RESOURCES = Collections.unmodifiableList(Arrays.asList(
-			"CDNNotifyConfiguration", "acl", "attname",  "cors", "customdomain", "delete",
-			"deletebucket", "encryption", "length", "lifecycle", "location", "logging",
-			"metadata", "modify", "name", "notification", "partNumber", "policy", "position", "quota",
-			"replication", "response-cache-control", "response-content-disposition",
-			"response-content-encoding", "response-content-language", "response-content-type", "response-expires",
-			"restore", " storageClass", "storagePolicy", "storageinfo", "tagging", "torrent", "truncate",
-			"uploadId", "uploads", "versionId", "versioning", "versions", "website", 
-			"x-obs-security-token"));
-	
-	private String ak;
-	
-	private String sk;
-	
-	 public String urlEncode(String input) throws UnsupportedEncodingException
-    {
-		return URLEncoder.encode(input, DEFAULT_ENCODING)
-        .replaceAll("%7E", "~") //for browser
-        .replaceAll("%2F", "/")
-        .replaceAll("%20", "+");
-    }
-	
-	private String join(List<?> items, String delimiter)
-    {
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < items.size(); i++)
-        {
-	String item = items.get(i).toString();
-            sb.append(item);
-            if (i < items.size() - 1)
-            {
-                sb.append(delimiter);
-            }
-        }
-        return sb.toString();
-    }
-	
-	private boolean isValid(String input) {
-		return input != null && !input.equals("");
-	}
-	
-	public String hamcSha1(String input) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException {
-		SecretKeySpec signingKey = new SecretKeySpec(this.sk.getBytes(DEFAULT_ENCODING), "HmacSHA1");
-		Mac mac = Mac.getInstance("HmacSHA1");
-		mac.init(signingKey);
-		return Base64.getEncoder().encodeToString(mac.doFinal(input.getBytes(DEFAULT_ENCODING)));
-	}
-	
-	private String stringToSign(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
-			String bucketName, String objectName) throws Exception{
-		String contentMd5 = "";
-		String contentType = "";
-		String date = "";
-		
-		TreeMap<String, String> canonicalizedHeaders = new TreeMap<String, String>();
-		
-		String key;
-		List<String> temp = new ArrayList<String>();
-		for(Map.Entry<String, String[]> entry : headers.entrySet()) {
-			key = entry.getKey();
-			if(key == null || entry.getValue() == null || entry.getValue().length == 0) {
-				continue;
-			}
-			
-			key = key.trim().toLowerCase(Locale.ENGLISH);
-			if(key.equals("content-md5")) {
-				contentMd5 = entry.getValue()[0];
-				continue;
-			}
-			
-			if(key.equals("content-type")) {
-				contentType = entry.getValue()[0];
-				continue;
-			}
-			
-			if(key.equals("date")) {
-				date = entry.getValue()[0];
-				continue;
-			}
-			
-			if(key.startsWith(OBS_PREFIX)) {
-				
-				for(String value : entry.getValue()) {
-					if(value != null) {
-						temp.add(value.trim());
-					}
-				}
-				canonicalizedHeaders.put(key, this.join(temp, ","));
-				temp.clear();
-			}
-		}
-		
-		if(canonicalizedHeaders.containsKey("x-obs-date")) {
-			date = "";
-		}
-		
-		
-		// handle method/content-md5/content-type/date
-		StringBuilder stringToSign = new StringBuilder();
-		stringToSign.append(httpMethod).append(SIGN_SEP)
-			.append(contentMd5).append(SIGN_SEP)
-			.append(contentType).append(SIGN_SEP)
-			.append(date).append(SIGN_SEP);
-			
-		// handle canonicalizedHeaders
-		for(Map.Entry<String, String> entry : canonicalizedHeaders.entrySet()) {
-			stringToSign.append(entry.getKey()).append(":").append(entry.getValue()).append(SIGN_SEP);
-		}
-		
-		// handle CanonicalizedResource
-		stringToSign.append("/");
-		if(this.isValid(bucketName)) {
-			stringToSign.append(bucketName).append("/");
-			if(this.isValid(objectName)) {
-				stringToSign.append(this.urlEncode(objectName));
-			}
-		}
-		
-		TreeMap<String, String> canonicalizedResource = new TreeMap<String, String>();
-		for(Map.Entry<String, String> entry : queries.entrySet()) {
-			key = entry.getKey();
-			if(key == null) {
-				continue;
-			}
-			
-			if(SUB_RESOURCES.contains(key)) {
-				canonicalizedResource.put(key, entry.getValue());
-			}
-		}
-		
-		if(canonicalizedResource.size() > 0) {
-			stringToSign.append("?");
-			for(Map.Entry<String, String> entry : canonicalizedResource.entrySet()) {
-				stringToSign.append(entry.getKey());
-				if(this.isValid(entry.getValue())) {
-					stringToSign.append("=").append(entry.getValue());
-				}
-                                stringToSign.append("&");
-			}
-                        stringToSign.deleteCharAt(stringToSign.length()-1);
-		}
-		
+public class SignDemo {
+	
+	private static final String SIGN_SEP = "\n";
+	
+	private static final String OBS_PREFIX = "x-obs-";
+	
+	private static final String DEFAULT_ENCODING = "UTF-8";
+	
+	private static final List<String> SUB_RESOURCES = Collections.unmodifiableList(Arrays.asList(
+			"CDNNotifyConfiguration", "acl", "attname",  "cors", "customdomain", "delete",
+			"deletebucket", "encryption", "length", "lifecycle", "location", "logging",
+			"metadata", "mirrorBackToSource", "modify", "name", "notification", "obscompresspolicy", 
+                        "partNumber", "policy", "position", "quota","rename", "replication", "response-cache-control", 
+                        "response-content-disposition","response-content-encoding", "response-content-language", "response-content-type", 
+                        "response-expires","restore", "storageClass", "storagePolicy", "storageinfo", "tagging", "torrent", "truncate",
+			"uploadId", "uploads", "versionId", "versioning", "versions", "website", 
+			"x-obs-security-token"));
+	
+	private String ak;
+	
+	private String sk;
+	
+	 public String urlEncode(String input) throws UnsupportedEncodingException
+    {
+		return URLEncoder.encode(input, DEFAULT_ENCODING)
+        .replaceAll("%7E", "~") //for browser
+        .replaceAll("%2F", "/")
+        .replaceAll("%20", "+");
+    }
+	
+	private String join(List<?> items, String delimiter)
+    {
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < items.size(); i++)
+        {
+	String item = items.get(i).toString();
+            sb.append(item);
+            if (i < items.size() - 1)
+            {
+                sb.append(delimiter);
+            }
+        }
+        return sb.toString();
+    }
+	
+	private boolean isValid(String input) {
+		return input != null && !input.equals("");
+	}
+	
+	public String hamcSha1(String input) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException {
+		SecretKeySpec signingKey = new SecretKeySpec(this.sk.getBytes(DEFAULT_ENCODING), "HmacSHA1");
+		Mac mac = Mac.getInstance("HmacSHA1");
+		mac.init(signingKey);
+		return Base64.getEncoder().encodeToString(mac.doFinal(input.getBytes(DEFAULT_ENCODING)));
+	}
+	
+	private String stringToSign(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
+			String bucketName, String objectName) throws Exception{
+		String contentMd5 = "";
+		String contentType = "";
+		String date = "";
+		
+		TreeMap<String, String> canonicalizedHeaders = new TreeMap<String, String>();
+		
+		String key;
+		List<String> temp = new ArrayList<String>();
+		for(Map.Entry<String, String[]> entry : headers.entrySet()) {
+			key = entry.getKey();
+			if(key == null || entry.getValue() == null || entry.getValue().length == 0) {
+				continue;
+			}
+			
+			key = key.trim().toLowerCase(Locale.ENGLISH);
+			if(key.equals("content-md5")) {
+				contentMd5 = entry.getValue()[0];
+				continue;
+			}
+			
+			if(key.equals("content-type")) {
+				contentType = entry.getValue()[0];
+				continue;
+			}
+			
+			if(key.equals("date")) {
+				date = entry.getValue()[0];
+				continue;
+			}
+			
+			if(key.startsWith(OBS_PREFIX)) {
+				
+				for(String value : entry.getValue()) {
+					if(value != null) {
+						temp.add(value.trim());
+					}
+				}
+				canonicalizedHeaders.put(key, this.join(temp, ","));
+				temp.clear();
+			}
+		}
+		
+		if(canonicalizedHeaders.containsKey("x-obs-date")) {
+			date = "";
+		}
+		
+		
+		// handle method/content-md5/content-type/date
+		StringBuilder stringToSign = new StringBuilder();
+		stringToSign.append(httpMethod).append(SIGN_SEP)
+			.append(contentMd5).append(SIGN_SEP)
+			.append(contentType).append(SIGN_SEP)
+			.append(date).append(SIGN_SEP);
+			
+		// handle canonicalizedHeaders
+		for(Map.Entry<String, String> entry : canonicalizedHeaders.entrySet()) {
+			stringToSign.append(entry.getKey()).append(":").append(entry.getValue()).append(SIGN_SEP);
+		}
+		
+		// handle CanonicalizedResource
+		stringToSign.append("/");
+		if(this.isValid(bucketName)) {
+			stringToSign.append(bucketName).append("/");
+			if(this.isValid(objectName)) {
+				stringToSign.append(this.urlEncode(objectName));
+			}
+		}
+		
+		TreeMap<String, String> canonicalizedResource = new TreeMap<String, String>();
+		for(Map.Entry<String, String> entry : queries.entrySet()) {
+			key = entry.getKey();
+			if(key == null) {
+				continue;
+			}
+			
+			if(SUB_RESOURCES.contains(key)) {
+				canonicalizedResource.put(key, entry.getValue());
+			}
+		}
+		
+		if(canonicalizedResource.size() > 0) {
+			stringToSign.append("?");
+			for(Map.Entry<String, String> entry : canonicalizedResource.entrySet()) {
+				stringToSign.append(entry.getKey());
+				if(this.isValid(entry.getValue())) {
+					stringToSign.append("=").append(entry.getValue());
+				}
+                                stringToSign.append("&");
+			}
+                        stringToSign.deleteCharAt(stringToSign.length()-1);
+		}
+		
 //		System.out.println(String.format("StringToSign:%s%s", SIGN_SEP, stringToSign.toString()));
-		
-		return stringToSign.toString();
-	}
-	
-	public String headerSignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
-			String bucketName, String objectName) throws Exception {
+		
+		return stringToSign.toString();
+	}
+	
+	public String headerSignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
+			String bucketName, String objectName) throws Exception {
 
-		//1. stringToSign
-		String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
-		
-		//2. signature
-		return String.format("OBS %s:%s", this.ak, this.hamcSha1(stringToSign));
-	}
-	
-	
-	public String querySignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
-			String bucketName, String objectName, long expires) throws Exception {
-		if(headers.containsKey("x-obs-date")) {
-			headers.put("x-obs-date", new String[] {String.valueOf(expires)});
-		}else {
-			headers.put("date", new String[] {String.valueOf(expires)});
-		}
-		//1. stringToSign
-		String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
-		
-		//2. signature
-		return this.urlEncode(this.hamcSha1(stringToSign));
-	}
-	
-	public static void main(String[] args) throws Exception {
-		
-		SignDemo demo = new SignDemo();
-		demo.ak = "<your-access-key-id>";
-		demo.sk = "<your-secret-key-id>";
-		
-		String bucketName = "bucket-test";
-		String objectName = "hello.jpg";
-		Map<String, String[]> headers = new HashMap<String, String[]>();
-		headers.put("date", new String[] {"Sat, 12 Oct 2015 08:12:38 GMT"});
-		headers.put("x-obs-acl", new String[] {"public-read"});
-		headers.put("x-obs-meta-key1", new String[] {"value1"});
-		headers.put("x-obs-meta-key2", new String[] {"value2", "value3"});
-		Map<String, String> queries = new HashMap<String, String>();
-		queries.put("acl", null);
-		
-		System.out.println(demo.headerSignature("PUT", headers, queries, bucketName, objectName));
-	}
-	
+		//1. stringToSign
+		String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
+		
+		//2. signature
+		return String.format("OBS %s:%s", this.ak, this.hamcSha1(stringToSign));
+	}
+	
+	
+	public String querySignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
+			String bucketName, String objectName, long expires) throws Exception {
+		if(headers.containsKey("x-obs-date")) {
+			headers.put("x-obs-date", new String[] {String.valueOf(expires)});
+		}else {
+			headers.put("date", new String[] {String.valueOf(expires)});
+		}
+		//1. stringToSign
+		String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
+		
+		//2. signature
+		return this.urlEncode(this.hamcSha1(stringToSign));
+	}
+	
+	public static void main(String[] args) throws Exception {
+		
+		SignDemo demo = new SignDemo();
+		demo.ak = "<your-access-key-id>";
+		demo.sk = "<your-secret-key-id>";
+		
+		String bucketName = "bucket-test";
+		String objectName = "hello.jpg";
+		Map<String, String[]> headers = new HashMap<String, String[]>();
+		headers.put("date", new String[] {"Sat, 12 Oct 2015 08:12:38 GMT"});
+		headers.put("x-obs-acl", new String[] {"public-read"});
+		headers.put("x-obs-meta-key1", new String[] {"value1"});
+		headers.put("x-obs-meta-key2", new String[] {"value2", "value3"});
+		Map<String, String> queries = new HashMap<String, String>();
+		queries.put("acl", null);
+		
+		System.out.println(demo.headerSignature("PUT", headers, queries, bucketName, objectName));
+	}
+	
 }
-
-
+
+ +

The calculation result of the signature is ydH8ffpcbS6YpeOMcEZfn0wE90c=, which varies depending on the execution time.

-

Signature Algorithm in Python

 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
import sys
+

Signature Algorithm in Python

 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
import sys
 import hashlib
 import hmac
 import binascii
@@ -756,8 +758,9 @@ Authorization: OBS UDSIAMSTUBTEST000254:ydH8ffpcbS6YpeOMcEZfn0wE90c=
      hashed = hmac.new(yourSecretAccessKeyID.encode('UTF-8'), canonical_string.encode('UTF-8'),hashlib.sha1)    
      encode_canonical = binascii.b2a_base64(hashed.digest())[:-1].decode('UTF-8')
 print encode_canonical
-
-
+
+ +

The calculation result of the signature is ydH8ffpcbS6YpeOMcEZfn0wE90c=, which varies depending on the execution time.

diff --git a/docs/obs/api-ref/obs_04_0011.html b/docs/obs/api-ref/obs_04_0011.html index 14e48aebb..b6f7fdd20 100644 --- a/docs/obs/api-ref/obs_04_0011.html +++ b/docs/obs/api-ref/obs_04_0011.html @@ -105,7 +105,7 @@ Host: bucketname.obs.region.example.com<

Indicates the OBS resource specified by an HTTP request. This parameter is constructed as follows:

<Bucket name + Object name> + [Subresource 1] + [Subresource 2] + ...

-
  1. Bucket name and object name, for example, /bucket/object. If no object name is specified, for example, /bucket/, the entire bucket is listed. If no bucket name is specified either, the value of this field is /.
  2. If a subresource (such as ?acl and ?logging) exists, the subresource must be added.

    OBS supports a variety of sub-resources, including acl, attname, cors, customdomain, delete, deletebucket, encryption, length, lifecycle, location, logging, metadata, modify, name, notification, partNumber, policy, position, quota, replication, response-cache-control, response-content-disposition, response-content-encoding, response-content-language, response-content-type, response-expires, restore, storageClass, storagePolicy, storageinfo, tagging, torrent, uploadId, uploads, versionId, versioning, versions, website, and x-obs-security-token.

    +
    1. Bucket name and object name, for example, /bucket/object. If no object name is specified, for example, /bucket/, the entire bucket is listed. If no bucket name is specified either, the value of this field is /.
    2. If a subresource (such as ?acl and ?logging) exists, the subresource must be added.

      OBS supports a variety of sub-resources, including acl, attname, cors, customdomain, delete, deletebucket, encryption, length, lifecycle, location, logging, metadata, modify, name, notification, partNumber, policy, position, quota, rename, replication, response-cache-control, response-content-disposition, response-content-encoding, response-content-language, response-content-type, response-expires, restore, storageClass, storagePolicy, storageinfo, tagging, torrent, truncate, uploadId, uploads, versionId, versioning, versions, website, and x-obs-security-token.

    3. If there are multiple subresources, sort them in the alphabetical order from a to z, and use & to combine the subresources.
    NOTE:
    • A subresource is unique. Do not add subresources with the same keyword (for example, key=value1&key=value2) in the same request URL. In this case, signature is computed only based on the first subresource, and only the value of the first subresource takes effect on the actual service.
    • Using the GetObject API as an example, assume there is a bucket named bucket-test and an object named object-test in the bucket, and the object version is xxx. When obtaining the object, you need to rewrite Content-Type to text/plain. Then, the CanonicalizedResource calculated by the signature is /bucket-test/object-test?response-content-type=text/plain&versionId=xxx.
    @@ -170,499 +170,550 @@ Host: bucketname.obs.region.example.com<

    curl http(s)://examplebucket.obs.region.example.com/objectkey?AccessKeyId=AccessKeyID\&Expires=1532779451\&Signature=0Akylf43Bm3mD1bh2rM3dmVp1Bo%3D -X GET -o output

    If you want to use the pre-defined URL generated by the signature carried in the URL in the browser, do not use Content-MD5, Content-Type, or CanonicalizedHeaders that can only be carried in the header to calculate the signature. Otherwise, the browser cannot carry these parameters. After the request is sent to the server, a message is displayed indicating that the signature is incorrect.

    -

    Signature Algorithm in Java

      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    - 28
    - 29
    - 30
    - 31
    - 32
    - 33
    - 34
    - 35
    - 36
    - 37
    - 38
    - 39
    - 40
    - 41
    - 42
    - 43
    - 44
    - 45
    - 46
    - 47
    - 48
    - 49
    - 50
    - 51
    - 52
    - 53
    - 54
    - 55
    - 56
    - 57
    - 58
    - 59
    - 60
    - 61
    - 62
    - 63
    - 64
    - 65
    - 66
    - 67
    - 68
    - 69
    - 70
    - 71
    - 72
    - 73
    - 74
    - 75
    - 76
    - 77
    - 78
    - 79
    - 80
    - 81
    - 82
    - 83
    - 84
    - 85
    - 86
    - 87
    - 88
    - 89
    - 90
    - 91
    - 92
    - 93
    - 94
    - 95
    - 96
    - 97
    - 98
    - 99
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    -185
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    -202
    -203
    -204
    -205
    -206
    -207
    -208
    -209
    -210
    -211
    -212
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    -223
    -224
    -225
    -226
    -227
    -228
    -229
    -230
    -231
    -232
    -233
    -234
    -235
    -236
    -237
    -238
    -239
    -240
    -241
    -242
    -243
    -244
    -245
    -246
    import java.io.UnsupportedEncodingException;
    -import java.net.URLEncoder;
    -import java.security.InvalidKeyException;
    -import java.security.NoSuchAlgorithmException;
    -import java.util.ArrayList;
    -import java.util.Arrays;
    -import java.util.Base64;
    -import java.util.Collections;
    -import java.util.HashMap;
    -import java.util.List;
    -import java.util.Locale;
    -import java.util.Map;
    -import java.util.TreeMap;
    +

    Signature Algorithm in Java

      1
    +  2
    +  3
    +  4
    +  5
    +  6
    +  7
    +  8
    +  9
    + 10
    + 11
    + 12
    + 13
    + 14
    + 15
    + 16
    + 17
    + 18
    + 19
    + 20
    + 21
    + 22
    + 23
    + 24
    + 25
    + 26
    + 27
    + 28
    + 29
    + 30
    + 31
    + 32
    + 33
    + 34
    + 35
    + 36
    + 37
    + 38
    + 39
    + 40
    + 41
    + 42
    + 43
    + 44
    + 45
    + 46
    + 47
    + 48
    + 49
    + 50
    + 51
    + 52
    + 53
    + 54
    + 55
    + 56
    + 57
    + 58
    + 59
    + 60
    + 61
    + 62
    + 63
    + 64
    + 65
    + 66
    + 67
    + 68
    + 69
    + 70
    + 71
    + 72
    + 73
    + 74
    + 75
    + 76
    + 77
    + 78
    + 79
    + 80
    + 81
    + 82
    + 83
    + 84
    + 85
    + 86
    + 87
    + 88
    + 89
    + 90
    + 91
    + 92
    + 93
    + 94
    + 95
    + 96
    + 97
    + 98
    + 99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    import java.io.UnsupportedEncodingException;
    +import java.net.URLEncoder;
    +import java.security.InvalidKeyException;
    +import java.security.NoSuchAlgorithmException;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Base64;
    +import java.util.Collections;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Locale;
    +import java.util.Map;
    +import java.util.TreeMap;
    +import java.util.regex.Pattern;
     
    -import javax.crypto.Mac;
    -import javax.crypto.spec.SecretKeySpec;
    +import javax.crypto.Mac;
    +import javax.crypto.spec.SecretKeySpec;
     
    -import org.omg.CosNaming.IstringHelper;
    +public class SignDemo {
    +
    +    private static final String SIGN_SEP = "\n";
    +
    +    private static final String OBS_PREFIX = "x-obs-";
    +
    +    private static final String DEFAULT_ENCODING = "UTF-8";
    +
    +    private static final List<String> SUB_RESOURCES = Collections.unmodifiableList(Arrays.asList(
    +            "CDNNotifyConfiguration", "acl", "attname",  "cors", "customdomain", "delete",
    +            "deletebucket", "encryption", "length", "lifecycle", "location", "logging",
    +            "metadata", "mirrorBackToSource", "modify", "name", "notification", "obscompresspolicy", 
    +            "partNumber", "policy", "position", "quota","rename", "replication", "response-cache-control", 
    +            "response-content-disposition","response-content-encoding", "response-content-language", "response-content-type", 
    +            "response-expires","restore", "storageClass", "storagePolicy", "storageinfo", "tagging", "torrent", "truncate",
    +            "uploadId", "uploads", "versionId", "versioning", "versions", "website", 
    +            "x-obs-security-token"));
    +
    +    private String ak;
    +
    +    private String sk;
    +
    +    private boolean isBucketNameValid(String bucketName) {
    +        if (bucketName == null || bucketName.length() > 63 || bucketName.length() < 3) {
    +            return false;
    +        }
    +
    +        if (!Pattern.matches("^[a-z0-9][a-z0-9.-]+$", bucketName)) {
    +            return false;
    +        }
    +
    +        if (Pattern.matches("(\\d{1,3}\\.){3}\\d{1,3}", bucketName)) {
    +            return false;
    +        }
    +
    +        String[] fragments = bucketName.split("\\.");
    +        for (int i = 0; i < fragments.length; i++) {
    +            if (Pattern.matches("^-.*", fragments[i]) || Pattern.matches(".*-$", fragments[i])
    +                    || Pattern.matches("^$", fragments[i])) {
    +                return false;
    +            }
    +        }
    +
    +        return true;
    +    }
    +
    +    public String encodeUrlString(String path) throws UnsupportedEncodingException {
    +        return URLEncoder.encode(path, DEFAULT_ENCODING)
    +                .replaceAll("\\+", "%20")
    +                .replaceAll("\\*", "%2A")
    +                .replaceAll("%7E", "~");
    +    }
    +
    +    public String encodeObjectName(String objectName) throws UnsupportedEncodingException {
    +        StringBuilder result = new StringBuilder();
    +        String[] tokens = objectName.split("/");
    +        for (int i = 0; i < tokens.length; i++) {
    +            result.append(this.encodeUrlString(tokens[i]));
    +            if (i < tokens.length - 1) {
    +                result.append("/");
    +            }
    +        }
    +        return result.toString();
    +    }
    +
    +    private String join(List<?> items, String delimiter) {
    +        StringBuilder sb = new StringBuilder();
    +        for (int i = 0; i < items.size(); i++) {
    +            String item = items.get(i).toString();
    +            sb.append(item);
    +            if (i < items.size() - 1) {
    +                sb.append(delimiter);
    +            }
    +        }
    +        return sb.toString();
    +    }
    +
    +    private boolean isValid(String input) {
    +        return input != null && !input.equals("");
    +    }
    +
    +    public String hmacSha1(String input) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException {
    +        SecretKeySpec signingKey = new SecretKeySpec(this.sk.getBytes(DEFAULT_ENCODING), "HmacSHA1");
    +        Mac mac = Mac.getInstance("HmacSHA1");
    +        mac.init(signingKey);
    +        return Base64.getEncoder().encodeToString(mac.doFinal(input.getBytes(DEFAULT_ENCODING)));
    +    }
    +
    +    private String stringToSign(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
    +                                String bucketName, String objectName) throws Exception {
    +        String contentMd5 = "";
    +        String contentType = "";
    +        String date = "";
    +
    +        TreeMap<String, String> canonicalizedHeaders = new TreeMap<String, String>();
    +
    +        String key;
    +        List<String> temp = new ArrayList<String>();
    +        for (Map.Entry<String, String[]> entry : headers.entrySet()) {
    +            key = entry.getKey();
    +            if (key == null || entry.getValue() == null || entry.getValue().length == 0) {
    +                continue;
    +            }
    +
    +            key = key.trim().toLowerCase(Locale.ENGLISH);
    +            if (key.equals("content-md5")) {
    +                contentMd5 = entry.getValue()[0];
    +                continue;
    +            }
    +
    +            if (key.equals("content-type")) {
    +                contentType = entry.getValue()[0];
    +                continue;
    +            }
    +
    +            if (key.equals("date")) {
    +                date = entry.getValue()[0];
    +                continue;
    +            }
    +
    +            if (key.startsWith(OBS_PREFIX)) {
    +
    +                for (String value : entry.getValue()) {
    +                    if (value != null) {
    +                        temp.add(value.trim());
    +                    }
    +                }
    +
    +                canonicalizedHeaders.put(key, this.join(temp, ","));
    +                temp.clear();
    +            }
    +        }
    +
    +        if (canonicalizedHeaders.containsKey("x-obs-date")) {
    +            date = "";
    +        }
     
     
    -public class SignDemo {
    -	
    -	private static final String SIGN_SEP = "\n";
    -	
    -	private static final String OBS_PREFIX = "x-obs-";
    -	
    -	private static final String DEFAULT_ENCODING = "UTF-8";
    -	
    -	private static final List<String> SUB_RESOURCES = Collections.unmodifiableList(Arrays.asList(
    -			"acl", "attname", "cors", "customdomain", "delete",
    -			"deletebucket", "encryption", "length", "lifecycle", "location", "logging",
    -			"metadata", "modify", "name", "notification", "partNumber", "policy", "position", "quota",
    -			"replication", "response-cache-control", "response-content-disposition",
    -			"response-content-encoding", "response-content-language", "response-content-type", "response-expires",
    -			"restore", " storageClass", "storagePolicy", "storageinfo", "tagging", "torrent",
    -			"uploadId", "uploads", "versionId", "versioning", "versions", "website", 
    -			 "x-obs-security-token"));
    -	
    -	private String ak;
    -	
    -	private String sk;
    -	
    -	 public String urlEncode(String input) throws UnsupportedEncodingException
    -    {
    -		return URLEncoder.encode(input, DEFAULT_ENCODING)
    -        .replaceAll("%7E", "~") //for browser
    -        .replaceAll("%2F", "/");
    -    }
    -	
    -	private String join(List<?> items, String delimiter)
    -    {
    -        StringBuilder sb = new StringBuilder();
    -        for (int i = 0; i < items.size(); i++)
    -        {
    -	String item = items.get(i).toString();
    -            sb.append(item);
    -            if (i < items.size() - 1)
    -            {
    -                sb.append(delimiter);
    -            }
    -        }
    -        return sb.toString();
    -    }
    -	
    -	private boolean isValid(String input) {
    -		return input != null && !input.equals("");
    -	}
    -	
    -	public String hamcSha1(String input) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException {
    -		SecretKeySpec signingKey = new SecretKeySpec(this.sk.getBytes(DEFAULT_ENCODING), "HmacSHA1");
    -		Mac mac = Mac.getInstance("HmacSHA1");
    -		mac.init(signingKey);
    -		return Base64.getEncoder().encodeToString(mac.doFinal(input.getBytes(DEFAULT_ENCODING)));
    -	}
    -	
    -	private String stringToSign(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
    -			String bucketName, String objectName) throws Exception{
    -		String contentMd5 = "";
    -		String contentType = "";
    -		String date = "";
    -		
    -		TreeMap<String, String> canonicalizedHeaders = new TreeMap<String, String>();
    -		
    -		String key;
    -		List<String> temp = new ArrayList<String>();
    -		for(Map.Entry<String, String[]> entry : headers.entrySet()) {
    -			key = entry.getKey();
    -			if(key == null || entry.getValue() == null || entry.getValue().length == 0) {
    -				continue;
    -			}
    -			
    -			key = key.trim().toLowerCase(Locale.ENGLISH);
    -			if(key.equals("content-md5")) {
    -				contentMd5 = entry.getValue()[0];
    -				continue;
    -			}
    -			
    -			if(key.equals("content-type")) {
    -				contentType = entry.getValue()[0];
    -				continue;
    -			}
    -			
    -			if(key.equals("date")) {
    -				date = entry.getValue()[0];
    -				continue;
    -			}
    -			
    -			if(key.startsWith(OBS_PREFIX)) {
    -				
    -				for(String value : entry.getValue()) {
    -					if(value != null) {
    -						temp.add(value.trim());
    -					}
    -				}
    -				canonicalizedHeaders.put(key, this.join(temp, ","));
    -				temp.clear();
    -			}
    -		}
    -		
    -		if(canonicalizedHeaders.containsKey("x-obs-date")) {
    -			date = "";
    -		}
    -		
    -		
    -		// handle method/content-md5/content-type/date
    -		StringBuilder stringToSign = new StringBuilder();
    -		stringToSign.append(httpMethod).append(SIGN_SEP)
    -			.append(contentMd5).append(SIGN_SEP)
    -			.append(contentType).append(SIGN_SEP)
    -			.append(date).append(SIGN_SEP);
    -			
    -		// handle canonicalizedHeaders
    -		for(Map.Entry<String, String> entry : canonicalizedHeaders.entrySet()) {
    -			stringToSign.append(entry.getKey()).append(":").append(entry.getValue()).append(SIGN_SEP);
    -		}
    -		
    -		// handle CanonicalizedResource
    -		stringToSign.append("/");
    -		if(this.isValid(bucketName)) {
    -			stringToSign.append(bucketName).append("/");
    -			if(this.isValid(objectName)) {
    -				stringToSign.append(this.urlEncode(objectName));
    -			}
    -		}
    -		
    -		TreeMap<String, String> canonicalizedResource = new TreeMap<String, String>();
    -		for(Map.Entry<String, String> entry : queries.entrySet()) {
    -			key = entry.getKey();
    -			if(key == null) {
    -				continue;
    -			}
    -			
    -			if(SUB_RESOURCES.contains(key)) {
    -				canonicalizedResource.put(key, entry.getValue());
    -			}
    -		}
    -		
    -		if(canonicalizedResource.size() > 0) {
    -			stringToSign.append("?");
    -			for(Map.Entry<String, String> entry : canonicalizedResource.entrySet()) {
    -				stringToSign.append(entry.getKey());
    -				if(this.isValid(entry.getValue())) {
    -					stringToSign.append("=").append(entry.getValue());
    -				}
    -                                stringToSign.append("&");
    -			}
    -                        stringToSign.deleteCharAt(stringToSign.length()-1);
    -		}
    -		
    -//		System.out.println(String.format("StringToSign:%s%s", SIGN_SEP, stringToSign.toString()));
    -		
    -		return stringToSign.toString();
    -	}
    -	
    -	public String headerSignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
    -			String bucketName, String objectName) throws Exception {
    +        // handle method/content-md5/content-type/date
    +        StringBuilder stringToSign = new StringBuilder();
    +        stringToSign.append(httpMethod).append(SIGN_SEP)
    +                .append(contentMd5).append(SIGN_SEP)
    +                .append(contentType).append(SIGN_SEP)
    +                .append(date).append(SIGN_SEP);
     
    -		//1. stringToSign
    -		String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
    -		
    -		//2. signature
    -		return String.format("OBS %s:%s", this.ak, this.hamcSha1(stringToSign));
    -	}
    -	
    -	public String querySignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
    -			String bucketName, String objectName, long expires) throws Exception {
    -		if(headers.containsKey("x-obs-date")) {
    -			headers.put("x-obs-date", new String[] {String.valueOf(expires)});
    -		}else {
    -			headers.put("date", new String[] {String.valueOf(expires)});
    -		}
    -		//1. stringToSign
    -		String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
    -		
    -		//2. signature
    -		return this.urlEncode(this.hamcSha1(stringToSign));
    -	}
     
    -        public String getURL(String endpoint, Map<String, String> queries,
    -                String bucketName, String objectName, String signature, long expires) {
    -                StringBuilder URL = new StringBuilder();
    -                URL.append("https://").append(bucketName).append(".").append(endpoint).append("/").        
    -                    append(objectName).append("?");    
    -                String key;    
    -                for (Map.Entry<String, String> entry : queries.entrySet()) {        
    -                    key = entry.getKey();        
    -                    if (key == null) {
    -                        continue;        
    -                    }
    -                    if (SUB_RESOURCES.contains(key)) {            
    -                        String value = entry.getValue();            
    -                        URL.append(key);            
    -                        if (value != null) {                
    -                            URL.append("=").append(value).append("&");            
    -                        } else {                
    -                            URL.append("&");            
    -                        }        
    -                    }    
    -                }    
    -                URL.append("AccessKeyId=").append(this.ak).append("&Expires=").append(expires).        
    -                    append("&Signature=").append(signature);    
    -                return URL.toString();
    -        }
    +        // handle canonicalizedHeaders
    +        for (Map.Entry<String, String> entry : canonicalizedHeaders.entrySet()) {
    +            stringToSign.append(entry.getKey()).append(":").append(entry.getValue()).append(SIGN_SEP);
    +        }
     
    -	public static void main(String[] args) throws Exception {
    -		
    -		SignDemo demo = new SignDemo();
    -		demo.ak = "<your-access-key-id>";
    -		demo.sk = "<your-secret-key-id>";
    -                String endpoint = "<your-endpoint>";
    -		
    -		String bucketName = "bucket-test";
    -		String objectName = "hello.jpg";
    -// A header cannot be carried if you want to use a URL to access OBS through a browser. If a header is added to headers, the signature does not match. To use the headers, it must be processed by the client.
    -		Map<String, String[]> headers = new HashMap<String, String[]>();
    -		Map<String, String> queries = new HashMap<String, String>();
    -		
    -                //  Expiration time of the request message. Set it to expire in 24 hours.
    -                long expires = (System.currentTimeMillis() + 86400000L) / 1000;
    -                String signature = demo.querySignature("GET", headers, queries, bucketName, objectName, expires);
    -                System.out.println(signature);
    -                String URL = demo.getURL(endpoint, queries, bucketName, objectName, signature, expires);
    -                System.out.println(URL);
    -	}
    -	
    +
    +        // handle CanonicalizedResource
    +        stringToSign.append("/");
    +        if (this.isValid(bucketName)) {
    +            stringToSign.append(bucketName).append("/");
    +            if (this.isValid(objectName)) {
    +                stringToSign.append(this.encodeObjectName(objectName));
    +            }
    +        }
    +
    +        TreeMap<String, String> canonicalizedResource = new TreeMap<String, String>();
    +        for (Map.Entry<String, String> entry : queries.entrySet()) {
    +            key = entry.getKey();
    +            if (key == null) {
    +                continue;
    +            }
    +
    +            if (SUB_RESOURCES.contains(key)) {
    +                canonicalizedResource.put(key, entry.getValue());
    +            }
    +        }
    +
    +        if (canonicalizedResource.size() > 0) {
    +            stringToSign.append("?");
    +            for (Map.Entry<String, String> entry : canonicalizedResource.entrySet()) {
    +                stringToSign.append(entry.getKey());
    +                if (this.isValid(entry.getValue())) {
    +                    stringToSign.append("=").append(entry.getValue());
    +                }
    +                stringToSign.append("&");
    +            }
    +            stringToSign.deleteCharAt(stringToSign.length() - 1);
    +        }
    +        //		System.out.println(String.format("StringToSign:%s%s", SIGN_SEP, stringToSign.toString()));
    +
    +        return stringToSign.toString();
    +    }
    +
    +    public String querySignature(String httpMethod, Map<String, String[]> headers, Map<String, String> queries,
    +                                 String bucketName, String objectName, long expires) throws Exception {
    +        if (!isBucketNameValid(bucketName)) {
    +            throw new IllegalArgumentException("the bucketName is illegal");
    +        }
    +        if (headers.containsKey("x-obs-date")) {
    +            headers.put("x-obs-date", new String[]{String.valueOf(expires)});
    +        } else {
    +            headers.put("date", new String[]{String.valueOf(expires)});
    +        }
    +        //1. stringToSign
    +        String stringToSign = this.stringToSign(httpMethod, headers, queries, bucketName, objectName);
    +
    +        //2. signature
    +        return this.encodeUrlString(this.hmacSha1(stringToSign));
    +    }
    +
    +    public String getURL(String endpoint, Map<String, String> queries,
    +                         String bucketName, String objectName, String signature, long expires) throws UnsupportedEncodingException {
    +        StringBuilder URL = new StringBuilder();
    +        URL.append("https://").append(bucketName).append(".").append(endpoint).append("/").
    +                append(this.encodeObjectName(objectName)).append("?");
    +        String key;
    +        for (Map.Entry<String, String> entry : queries.entrySet()) {
    +            key = entry.getKey();
    +            if (key == null) {
    +                continue;
    +            }
    +            if (SUB_RESOURCES.contains(key)) {
    +                String value = entry.getValue();
    +                URL.append(key);
    +                if (value != null) {
    +                    URL.append("=").append(value).append("&");
    +                } else {
    +                    URL.append("&");
    +                }
    +            }
    +        }
    +        URL.append("AccessKeyId=").append(this.ak).append("&Expires=").append(expires).
    +                append("&Signature=").append(signature);
    +        return URL.toString();
    +    }
    +
    +    public static void main(String[] args) throws Exception {
    +        SignDemo demo = new SignDemo();
    +        demo.ak = "<your-access-key-id>";
    +        demo.sk = "<your-secret-key-id>";
    +        String endpoint = "<your-endpoint>";
    +
    +        String bucketName = "bucket-test";
    +        String objectName = "hello.jpg";
    +
    +                // A header cannot be carried if you want to use a URL to access OBS with a browser. If a header is added to headers, the signature does not match. To use headers, it must be processed by the client.
    +        Map<String, String[]> headers = new HashMap<String, String[]>();
    +        Map<String, String> queries = new HashMap<String, String>();
    +
    +                // Expiration time. Set it to expire in 24 hours.
    +        long expires = (System.currentTimeMillis() + 86400000L) / 1000;
    +        String signature = demo.querySignature("GET", headers, queries, bucketName, objectName, expires);
    +        System.out.println(signature);
    +        String URL = demo.getURL(endpoint, queries, bucketName, objectName, signature, expires);
    +        System.out.println(URL);
    +    }
     }
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0012.html b/docs/obs/api-ref/obs_04_0012.html index 9a08a2274..8514e57c9 100644 --- a/docs/obs/api-ref/obs_04_0012.html +++ b/docs/obs/api-ref/obs_04_0012.html @@ -90,7 +90,7 @@ Signature = Base64( HMAC-SHA1( YourSecretAccessKeyID, StringToSign ) )
    -

    The policy conditions can be matched in the following ways:

    +

    The table below describes how policy conditions can be matched.

    @@ -127,7 +127,7 @@ Signature = Base64( HMAC-SHA1( YourSecretAccessKeyID, StringToSign ) )

    A policy is in the JSON format. Conditions can be put in curly brackets {} and square brackets []. The key and value elements of the table are written in the curly brackets {}, which are separated by colons (:). The square brackets [] contain the condition type, key, and value. These three items are separated by commas (,). The dollar sign ($) in front of the key indicates that the key is a variable.

    -

    The following characters must be escaped in a policy:

    +

    The table below lists the characters that must be escaped in a policy.

    Table 2 Policy condition matching methods

    Matching Method

    diff --git a/docs/obs/api-ref/obs_04_0015.html b/docs/obs/api-ref/obs_04_0015.html index ea2cb22a4..c77ad3ee1 100644 --- a/docs/obs/api-ref/obs_04_0015.html +++ b/docs/obs/api-ref/obs_04_0015.html @@ -7,288 +7,287 @@

    Prerequisites

    • You have obtained the AK and SK. For details about how to obtain the AK and SK, see Obtaining Access Keys (AK/SK).
    • You have planned the region where you want to create a bucket and obtained the endpoint required for API calls. For details, see Regions and Endpoints.

    Once a region is determined, it cannot be modified after the bucket is created.

    -

    Creating a Bucket Named bucket001 in the a1 Region

    In this example, an Apache HttpClient is used.
    Table 3 Characters that must be escaped in a policy

    Character After Escape

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    -98
    package com.obsclient;
    +

    Creating a Bucket Named bucket001 in the a1 Region

    In this example, an Apache HttpClient is used.
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    package com.obsclient;
     
    -import java.io.*;
    +import java.io.*;
     
    -import org.apache.http.Header;
    -import org.apache.http.client.methods.CloseableHttpResponse;
    -import org.apache.http.client.methods.HttpPut;
    -import org.apache.http.entity.StringEntity;
    -import org.apache.http.impl.client.CloseableHttpClient;
    -import org.apache.http.impl.client.HttpClients;
    +import org.apache.http.Header;
    +import org.apache.http.client.methods.CloseableHttpResponse;
    +import org.apache.http.client.methods.HttpPut;
    +import org.apache.http.entity.StringEntity;
    +import org.apache.http.impl.client.CloseableHttpClient;
    +import org.apache.http.impl.client.HttpClients;
     
    -public class TestMain {
    +public class TestMain {
     
    -    public static String accessKey = "UDSIAMSTUBTEST000012"; //The value of this parameter is the AK obtained.
    -     public static String securityKey = "Udsiamstubtest000000UDSIAMSTUBTEST000012";  //The value of this parameter is the SK obtained.
    -    public static String region = "a1"; // The value is the region where the planned bucket resides.
    -    public static String createBucketTemplate =
    -            "<CreateBucketConfiguration " +
    -            "xmlns=\"http://obs.a1.example.com/doc/2015-06-30/\">\n" +
    -            "<Location>" + region + "</Location>\n" +
    -            "</CreateBucketConfiguration>";
    +    public static String accessKey = "UDSIAMSTUBTEST000012"; //The value of this parameter is the AK obtained.
    +     public static String securityKey = "Udsiamstubtest000000UDSIAMSTUBTEST000012";  //The value of this parameter is the SK obtained.
    +    public static String region = "a1"; // The value is the region where the planned bucket resides.
    +    public static String createBucketTemplate =
    +            "<CreateBucketConfiguration " +
    +            "xmlns=\"http://obs.a1.example.com/doc/2015-06-30/\">\n" +
    +            "<Location>" + region + "</Location>\n" +
    +            "</CreateBucketConfiguration>";
     
    -    public static void main(String[] str) {
    +    public static void main(String[] str) {
     
    -         createBucket();
    +         createBucket();
     
    -    }
    +    }
     
    -    private static void createBucket() {
    -        CloseableHttpClient httpClient = HttpClients.createDefault();
    -        String requesttime = DateUtils.formatDate(System.currentTimeMillis());
    -        String contentType = "application/xml";
    -        
    -        
    -        HttpPut httpPut = new HttpPut("http://bucket001.obs.a1.example.com");
    -        httpPut.addHeader("Date", requesttime);
    -        httpPut.addHeader("Content-Type", contentType);
    +    private static void createBucket() {
    +        CloseableHttpClient httpClient = HttpClients.createDefault();
    +        String requesttime = DateUtils.formatDate(System.currentTimeMillis());
    +        String contentType = "application/xml";
    +        HttpPut httpPut = new HttpPut("http://bucket001.obs.a1.example.com");
    +        httpPut.addHeader("Date", requesttime);
    +        httpPut.addHeader("Content-Type", contentType);
     
    -        /**Calculate the signature based on the request.**/
    -        String contentMD5 = "";
    -        String canonicalizedHeaders = "";
    -        String canonicalizedResource = "/bucket001/";
    -        // Content-MD5 and Content-Type fields do not contain line breaks. The data format is RFC 1123, which is the same as the time in the request.
    -        String canonicalString = "PUT" + "\n" + contentMD5 + "\n" + contentType + "\n" + requesttime + "\n" + canonicalizedHeaders + canonicalizedResource;
    -        System.out.println("StringToSign:[" + canonicalString + "]");
    -        String signature = null;
    -        CloseableHttpResponse httpResponse = null;
    -        try {
    -            signature = Signature.signWithHmacSha1(securityKey, canonicalString);
    +        /**Calculate the signature based on the request.**/
    +        String contentMD5 = "";
    +        String canonicalizedHeaders = "";
    +        String canonicalizedResource = "/bucket001/";
    +        // Content-MD5 and Content-Type fields do not contain line breaks. The data format is RFC 1123, which is the same as the time in the request.
    +        String canonicalString = "PUT" + "\n" + contentMD5 + "\n" + contentType + "\n" + requesttime + "\n" + canonicalizedHeaders + canonicalizedResource;
    +        System.out.println("StringToSign:[" + canonicalString + "]");
    +        String signature = null;
    +        CloseableHttpResponse httpResponse = null;
    +        try {
    +            signature = Signature.signWithHmacSha1(securityKey, canonicalString);
     
    -             // Added the Authorization: OBS AccessKeyID:signature field to the header.
    -            httpPut.addHeader("Authorization", "OBS " + accessKey + ":" + signature);
    +             // Added the Authorization: OBS AccessKeyID:signature field to the header.
    +            httpPut.addHeader("Authorization", "OBS " + accessKey + ":" + signature);
     
    -            // Add a body.
    -            httpPut.setEntity(new StringEntity(createBucketTemplate));
    +            // Add a body.
    +            httpPut.setEntity(new StringEntity(createBucketTemplate));
     
    -            httpResponse = httpClient.execute(httpPut);
    +            httpResponse = httpClient.execute(httpPut);
     
    -            // Prints the sending request information and the received response message.
    -            System.out.println("Request Message:");
    -            System.out.println(httpPut.getRequestLine());
    -            for (Header header : httpPut.getAllHeaders()) {
    -                System.out.println(header.getName() + ":" + header.getValue());
    -            }
    +            // Prints the sending request information and the received response message.
    +            System.out.println("Request Message:");
    +            System.out.println(httpPut.getRequestLine());
    +            for (Header header : httpPut.getAllHeaders()) {
    +                System.out.println(header.getName() + ":" + header.getValue());
    +            }
     
    -            System.out.println("Response Message:");
    -            System.out.println(httpResponse.getStatusLine());
    -            for (Header header : httpResponse.getAllHeaders()) {
    -                System.out.println(header.getName() + ":" + header.getValue());
    -            }
    -            BufferedReader reader = new BufferedReader(new InputStreamReader(
    -                    httpResponse.getEntity().getContent()));
    +            System.out.println("Response Message:");
    +            System.out.println(httpResponse.getStatusLine());
    +            for (Header header : httpResponse.getAllHeaders()) {
    +                System.out.println(header.getName() + ":" + header.getValue());
    +            }
    +            BufferedReader reader = new BufferedReader(new InputStreamReader(
    +                    httpResponse.getEntity().getContent()));
     
    -            String inputLine;
    -            StringBuffer response = new StringBuffer();
    +            String inputLine;
    +            StringBuffer response = new StringBuffer();
     
    -            while ((inputLine = reader.readLine()) != null) {
    -                response.append(inputLine);
    -            }
    -            reader.close();
    +            while ((inputLine = reader.readLine()) != null) {
    +                response.append(inputLine);
    +            }
    +            reader.close();
     
    -            // print result
    -            System.out.println(response.toString());
    -        } catch (UnsupportedEncodingException e) {
    -            e.printStackTrace();
    -        } catch (IOException e) {
    -            e.printStackTrace();
    -        } finally {
    -            try {
    -                httpClient.close();
    -            } catch (IOException e) {
    -                e.printStackTrace();
    -            }
    -        }
    +            // print result
    +            System.out.println(response.toString());
    +        } catch (UnsupportedEncodingException e) {
    +            e.printStackTrace();
    +        } catch (IOException e) {
    +            e.printStackTrace();
    +        } finally {
    +            try {
    +                httpClient.close();
    +            } catch (IOException e) {
    +                e.printStackTrace();
    +            }
    +        }
     
    -    }
    +    }
     
     }
    -
    -
    +
    + +

    The format of the Date header field DateUtils is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    package com.obsclient;
     
    -import java.text.DateFormat;
    -import java.text.SimpleDateFormat;
    -import java.util.Locale;
    -import java.util.TimeZone;
    +import java.text.DateFormat;
    +import java.text.SimpleDateFormat;
    +import java.util.Locale;
    +import java.util.TimeZone;
     
    -public class DateUtils {
    +public class DateUtils {
     
    -    public static String formatDate(long time)
    -    {
    -        DateFormat serverDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    -        serverDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    -        return serverDateFormat.format(time);
    -    }
    +    public static String formatDate(long time)
    +    {
    +        DateFormat serverDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    +        serverDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    +        return serverDateFormat.format(time);
    +    }
     }
    -
    -
    +
    + +

    The method of calculating the signature character string is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    package com.obsclient;
     
    -import javax.crypto.Mac;
    -import javax.crypto.spec.SecretKeySpec;
    -import java.io.UnsupportedEncodingException;
    -import java.security.NoSuchAlgorithmException;
    -import java.security.InvalidKeyException;
    -import java.util.Base64;
    +import javax.crypto.Mac;
    +import javax.crypto.spec.SecretKeySpec;
    +import java.io.UnsupportedEncodingException;
    +import java.security.NoSuchAlgorithmException;
    +import java.security.InvalidKeyException;
    +import java.util.Base64;
     
    -public class Signature {
    -    public static String signWithHmacSha1(String sk, String canonicalString) throws UnsupportedEncodingException {
    +public class Signature {
    +    public static String signWithHmacSha1(String sk, String canonicalString) throws UnsupportedEncodingException {
     
    -        try {
    -            SecretKeySpec signingKey = new SecretKeySpec(sk.getBytes("UTF-8"), "HmacSHA1");
    -            Mac mac = Mac.getInstance("HmacSHA1");
    -            mac.init(signingKey);
    -            return Base64.getEncoder().encodeToString(mac.doFinal(canonicalString.getBytes("UTF-8")));
    -        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
    -            e.printStackTrace();
    -        }
    -        return null;
    -    }
    +        try {
    +            SecretKeySpec signingKey = new SecretKeySpec(sk.getBytes("UTF-8"), "HmacSHA1");
    +            Mac mac = Mac.getInstance("HmacSHA1");
    +            mac.init(signingKey);
    +            return Base64.getEncoder().encodeToString(mac.doFinal(canonicalString.getBytes("UTF-8")));
    +        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
    +            e.printStackTrace();
    +        }
    +        return null;
    +    }
     }
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0016.html b/docs/obs/api-ref/obs_04_0016.html index 08621e796..c74f96184 100644 --- a/docs/obs/api-ref/obs_04_0016.html +++ b/docs/obs/api-ref/obs_04_0016.html @@ -7,285 +7,284 @@

    Prerequisites

    • You have obtained the AK and SK. For details about how to obtain the AK and SK, see Obtaining Access Keys (AK/SK).
    • You have specified the region where you want to list buckets and obtained the endpoint required for API calls. For details, see Regions and Endpoints.

    Obtaining the Bucket List in the a1 Region

    In this example, an Apache HttpClient is used.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -86
    -87
    -88
    -89
    -90
    -91
    -92
    -93
    -94
    -95
    -96
    -97
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    package com.obsclient;
     
    -import java.io.*;
    -import java.util.ArrayList;
    -import java.util.List;
    +import java.io.*;
    +import java.util.ArrayList;
    +import java.util.List;
     
    -import org.apache.http.Header;
    -import org.apache.http.HttpEntity;
    -import org.apache.http.NameValuePair;
    -import org.apache.http.client.entity.UrlEncodedFormEntity;
    -import org.apache.http.client.methods.CloseableHttpResponse;
    -import org.apache.http.client.methods.HttpGet;
    -import org.apache.http.client.methods.HttpPost;
    -import org.apache.http.client.methods.HttpPut;
    -import org.apache.http.entity.InputStreamEntity;
    -import org.apache.http.entity.StringEntity;
    -import org.apache.http.impl.client.CloseableHttpClient;
    -import org.apache.http.impl.client.HttpClients;
    -import org.apache.http.message.BasicNameValuePair;
    +import org.apache.http.Header;
    +import org.apache.http.HttpEntity;
    +import org.apache.http.NameValuePair;
    +import org.apache.http.client.entity.UrlEncodedFormEntity;
    +import org.apache.http.client.methods.CloseableHttpResponse;
    +import org.apache.http.client.methods.HttpGet;
    +import org.apache.http.client.methods.HttpPost;
    +import org.apache.http.client.methods.HttpPut;
    +import org.apache.http.entity.InputStreamEntity;
    +import org.apache.http.entity.StringEntity;
    +import org.apache.http.impl.client.CloseableHttpClient;
    +import org.apache.http.impl.client.HttpClients;
    +import org.apache.http.message.BasicNameValuePair;
     
     
    -public class TestMain {
    +public class TestMain {
     
    -    public static String accessKey = "UDSIAMSTUBTEST000012"; //The value of this parameter is the AK obtained.
    -     public static String securityKey = "Udsiamstubtest000000UDSIAMSTUBTEST000012";  //The value of this parameter is the SK obtained.
    +    public static String accessKey = "UDSIAMSTUBTEST000012"; //The value of this parameter is the AK obtained.
    +     public static String securityKey = "Udsiamstubtest000000UDSIAMSTUBTEST000012";  //The value of this parameter is the SK obtained.
     
    -    public static void main(String[] str) {
    +    public static void main(String[] str) {
     
    -        listAllMyBuckets();
    +        listAllMyBuckets();
     
    -    }
    +    }
     
     
    -    private static void listAllMyBuckets() {
    -        CloseableHttpClient httpClient = HttpClients.createDefault();
    -        String requesttime = DateUtils.formatDate(System.currentTimeMillis());
    -        
    -        
    -        HttpGet httpGet = new HttpGet("http://obs.a1.example.com");
    -        httpGet.addHeader("Date", requesttime);
    +    private static void listAllMyBuckets() {
    +        CloseableHttpClient httpClient = HttpClients.createDefault();
    +        String requesttime = DateUtils.formatDate(System.currentTimeMillis());
    +        HttpGet httpGet = new HttpGet("http://obs.a1.example.com");
    +        httpGet.addHeader("Date", requesttime);
     
    -        /**Calculate the signature based on the request.**/
    -        String contentMD5 = "";
    -        String contentType = "";
    -        String canonicalizedHeaders = "";
    -        String canonicalizedResource = "/";
    -        // Content-MD5 and Content-Type fields do not contain line breaks. The data format is RFC 1123, which is the same as the time in the request.
    -        String canonicalString = "GET" + "\n" + contentMD5 + "\n" + contentType + "\n" + requesttime + "\n" + canonicalizedHeaders + canonicalizedResource;
    -        System.out.println("StringToSign:[" + canonicalString + "]");
    -        String signature = null;
    -        try {
    -            signature = Signature.signWithHmacSha1(securityKey, canonicalString);
    +        /**Calculate the signature based on the request.**/
    +        String contentMD5 = "";
    +        String contentType = "";
    +        String canonicalizedHeaders = "";
    +        String canonicalizedResource = "/";
    +        // Content-MD5 and Content-Type fields do not contain line breaks. The data format is RFC 1123, which is the same as the time in the request.
    +        String canonicalString = "GET" + "\n" + contentMD5 + "\n" + contentType + "\n" + requesttime + "\n" + canonicalizedHeaders + canonicalizedResource;
    +        System.out.println("StringToSign:[" + canonicalString + "]");
    +        String signature = null;
    +        try {
    +            signature = Signature.signWithHmacSha1(securityKey, canonicalString);
     
    -             // Added the Authorization: OBS AccessKeyID:signature field to the header.
    -            httpGet.addHeader("Authorization", "OBS " + accessKey + ":" + signature);
    -            CloseableHttpResponse httpResponse = httpClient.execute(httpGet);
    +             // Added the Authorization: OBS AccessKeyID:signature field to the header.
    +            httpGet.addHeader("Authorization", "OBS " + accessKey + ":" + signature);
    +            CloseableHttpResponse httpResponse = httpClient.execute(httpGet);
     
    -            // Prints the sending request information and the received response message.
    -            System.out.println("Request Message:");
    -            System.out.println(httpGet.getRequestLine());
    -            for (Header header : httpGet.getAllHeaders()) {
    -                System.out.println(header.getName() + ":" + header.getValue());
    -            }
    +            // Prints the sending request information and the received response message.
    +            System.out.println("Request Message:");
    +            System.out.println(httpGet.getRequestLine());
    +            for (Header header : httpGet.getAllHeaders()) {
    +                System.out.println(header.getName() + ":" + header.getValue());
    +            }
     
    -            System.out.println("Response Message:");
    -            System.out.println(httpResponse.getStatusLine());
    -            for (Header header : httpResponse.getAllHeaders()) {
    -                System.out.println(header.getName() + ":" + header.getValue());
    -            }
    -            BufferedReader reader = new BufferedReader(new InputStreamReader(
    -                    httpResponse.getEntity().getContent()));
    +            System.out.println("Response Message:");
    +            System.out.println(httpResponse.getStatusLine());
    +            for (Header header : httpResponse.getAllHeaders()) {
    +                System.out.println(header.getName() + ":" + header.getValue());
    +            }
    +            BufferedReader reader = new BufferedReader(new InputStreamReader(
    +                    httpResponse.getEntity().getContent()));
     
    -            String inputLine;
    -            StringBuffer response = new StringBuffer();
    +            String inputLine;
    +            StringBuffer response = new StringBuffer();
     
    -            while ((inputLine = reader.readLine()) != null) {
    -                response.append(inputLine);
    -            }
    -            reader.close();
    -            // print result
    -            System.out.println(response.toString());
    -        } catch (UnsupportedEncodingException e) {
    -            e.printStackTrace();
    +            while ((inputLine = reader.readLine()) != null) {
    +                response.append(inputLine);
    +            }
    +            reader.close();
    +            // print result
    +            System.out.println(response.toString());
    +        } catch (UnsupportedEncodingException e) {
    +            e.printStackTrace();
     
    -        } catch (IOException e) {
    -            e.printStackTrace();
    -        } finally {
    -            try {
    -                httpClient.close();
    -            } catch (IOException e) {
    -                e.printStackTrace();
    -            }
    -        }
    +        } catch (IOException e) {
    +            e.printStackTrace();
    +        } finally {
    +            try {
    +                httpClient.close();
    +            } catch (IOException e) {
    +                e.printStackTrace();
    +            }
    +        }
     
    -    }
    +    }
     
     }
    -
    -
    +
    + +

    The format of the Date header field DateUtils is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    package com.obsclient;
     
    -import java.text.DateFormat;
    -import java.text.SimpleDateFormat;
    -import java.util.Locale;
    -import java.util.TimeZone;
    +import java.text.DateFormat;
    +import java.text.SimpleDateFormat;
    +import java.util.Locale;
    +import java.util.TimeZone;
     
    -public class DateUtils {
    +public class DateUtils {
     
    -    public static String formatDate(long time)
    -    {
    -        DateFormat serverDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    -        serverDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    -        return serverDateFormat.format(time);
    -    }
    +    public static String formatDate(long time)
    +    {
    +        DateFormat serverDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    +        serverDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    +        return serverDateFormat.format(time);
    +    }
     }
    -
    -
    +
    + +

    The method of calculating the signature character string is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    package com.obsclient;
     
    -import javax.crypto.Mac;
    -import javax.crypto.spec.SecretKeySpec;
    -import java.io.UnsupportedEncodingException;
    -import java.security.NoSuchAlgorithmException;
    -import java.security.InvalidKeyException;
    -import java.util.Base64;
    +import javax.crypto.Mac;
    +import javax.crypto.spec.SecretKeySpec;
    +import java.io.UnsupportedEncodingException;
    +import java.security.NoSuchAlgorithmException;
    +import java.security.InvalidKeyException;
    +import java.util.Base64;
     
    -public class Signature {
    -    public static String signWithHmacSha1(String sk, String canonicalString) throws UnsupportedEncodingException {
    +public class Signature {
    +    public static String signWithHmacSha1(String sk, String canonicalString) throws UnsupportedEncodingException {
     
    -        try {
    -            SecretKeySpec signingKey = new SecretKeySpec(sk.getBytes("UTF-8"), "HmacSHA1");
    -            Mac mac = Mac.getInstance("HmacSHA1");
    -            mac.init(signingKey);
    -            return Base64.getEncoder().encodeToString(mac.doFinal(canonicalString.getBytes("UTF-8")));
    -        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
    -            e.printStackTrace();
    -        }
    -        return null;
    -    }
    +        try {
    +            SecretKeySpec signingKey = new SecretKeySpec(sk.getBytes("UTF-8"), "HmacSHA1");
    +            Mac mac = Mac.getInstance("HmacSHA1");
    +            mac.init(signingKey);
    +            return Base64.getEncoder().encodeToString(mac.doFinal(canonicalString.getBytes("UTF-8")));
    +        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
    +            e.printStackTrace();
    +        }
    +        return null;
    +    }
     }
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0017.html b/docs/obs/api-ref/obs_04_0017.html index ea2aad622..420903b90 100644 --- a/docs/obs/api-ref/obs_04_0017.html +++ b/docs/obs/api-ref/obs_04_0017.html @@ -7,303 +7,302 @@

    Prerequisites

    • You have obtained the AK and SK. For details, see Obtaining Access Keys (AK/SK).
    • At least one bucket is available.
    • The file to be uploaded has been prepared and you know the complete local path of the file.
    • You have obtained the region of the bucket which you want to upload files to and determined the endpoint required for API calls. For details, see Regions and Endpoints.

    Uploading the Object objecttest1 to Bucket bucket001 in the a1 Region

    In this example, an Apache HttpClient is used.

    -
      1
    -  2
    -  3
    -  4
    -  5
    -  6
    -  7
    -  8
    -  9
    - 10
    - 11
    - 12
    - 13
    - 14
    - 15
    - 16
    - 17
    - 18
    - 19
    - 20
    - 21
    - 22
    - 23
    - 24
    - 25
    - 26
    - 27
    - 28
    - 29
    - 30
    - 31
    - 32
    - 33
    - 34
    - 35
    - 36
    - 37
    - 38
    - 39
    - 40
    - 41
    - 42
    - 43
    - 44
    - 45
    - 46
    - 47
    - 48
    - 49
    - 50
    - 51
    - 52
    - 53
    - 54
    - 55
    - 56
    - 57
    - 58
    - 59
    - 60
    - 61
    - 62
    - 63
    - 64
    - 65
    - 66
    - 67
    - 68
    - 69
    - 70
    - 71
    - 72
    - 73
    - 74
    - 75
    - 76
    - 77
    - 78
    - 79
    - 80
    - 81
    - 82
    - 83
    - 84
    - 85
    - 86
    - 87
    - 88
    - 89
    - 90
    - 91
    - 92
    - 93
    - 94
    - 95
    - 96
    - 97
    - 98
    - 99
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    package com.obsclient;
    +
      1
    +  2
    +  3
    +  4
    +  5
    +  6
    +  7
    +  8
    +  9
    + 10
    + 11
    + 12
    + 13
    + 14
    + 15
    + 16
    + 17
    + 18
    + 19
    + 20
    + 21
    + 22
    + 23
    + 24
    + 25
    + 26
    + 27
    + 28
    + 29
    + 30
    + 31
    + 32
    + 33
    + 34
    + 35
    + 36
    + 37
    + 38
    + 39
    + 40
    + 41
    + 42
    + 43
    + 44
    + 45
    + 46
    + 47
    + 48
    + 49
    + 50
    + 51
    + 52
    + 53
    + 54
    + 55
    + 56
    + 57
    + 58
    + 59
    + 60
    + 61
    + 62
    + 63
    + 64
    + 65
    + 66
    + 67
    + 68
    + 69
    + 70
    + 71
    + 72
    + 73
    + 74
    + 75
    + 76
    + 77
    + 78
    + 79
    + 80
    + 81
    + 82
    + 83
    + 84
    + 85
    + 86
    + 87
    + 88
    + 89
    + 90
    + 91
    + 92
    + 93
    + 94
    + 95
    + 96
    + 97
    + 98
    + 99
    +100
    +101
    +102
    +103
    +104
    package com.obsclient;
     
    -import java.io.*;
    -import java.util.ArrayList;
    -import java.util.List;
    +import java.io.*;
    +import java.util.ArrayList;
    +import java.util.List;
     
    -import org.apache.http.Header;
    -import org.apache.http.HttpEntity;
    -import org.apache.http.NameValuePair;
    -import org.apache.http.client.entity.UrlEncodedFormEntity;
    -import org.apache.http.client.methods.CloseableHttpResponse;
    -import org.apache.http.client.methods.HttpGet;
    -import org.apache.http.client.methods.HttpPost;
    -import org.apache.http.client.methods.HttpPut;
    -import org.apache.http.entity.InputStreamEntity;
    -import org.apache.http.entity.StringEntity;
    -import org.apache.http.impl.client.CloseableHttpClient;
    -import org.apache.http.impl.client.HttpClients;
    -import org.apache.http.message.BasicNameValuePair;
    +import org.apache.http.Header;
    +import org.apache.http.HttpEntity;
    +import org.apache.http.NameValuePair;
    +import org.apache.http.client.entity.UrlEncodedFormEntity;
    +import org.apache.http.client.methods.CloseableHttpResponse;
    +import org.apache.http.client.methods.HttpGet;
    +import org.apache.http.client.methods.HttpPost;
    +import org.apache.http.client.methods.HttpPut;
    +import org.apache.http.entity.InputStreamEntity;
    +import org.apache.http.entity.StringEntity;
    +import org.apache.http.impl.client.CloseableHttpClient;
    +import org.apache.http.impl.client.HttpClients;
    +import org.apache.http.message.BasicNameValuePair;
     
     
    -public class TestMain {
    +public class TestMain {
     
    -    public static String accessKey = "UDSIAMSTUBTEST000012"; //The value of this parameter is the AK obtained.
    -     public static String securityKey = "Udsiamstubtest000000UDSIAMSTUBTEST000012";  //The value of this parameter is the SK obtained.
    +    public static String accessKey = "UDSIAMSTUBTEST000012"; //The value of this parameter is the AK obtained.
    +     public static String securityKey = "Udsiamstubtest000000UDSIAMSTUBTEST000012";  //The value of this parameter is the SK obtained.
     
    -    public static void main(String[] str) {
    -		
    -        putObjectToBucket();
    +    public static void main(String[] str) {
    +		
    +        putObjectToBucket();
     
    -    }
    +    }
     
     
    -    private static void putObjectToBucket() {
    +    private static void putObjectToBucket() {
     
    -        InputStream inputStream = null;
    -        CloseableHttpClient httpClient = HttpClients.createDefault();
    -        CloseableHttpResponse httpResponse = null;
    -        String requestTime = DateUtils.formatDate(System.currentTimeMillis());
    -        
    -        
    -        HttpPut httpPut = new HttpPut("http://bucket001.obs.a1.example.com/objecttest1");
    -        httpPut.addHeader("Date", requestTime);
    +        InputStream inputStream = null;
    +        CloseableHttpClient httpClient = HttpClients.createDefault();
    +        CloseableHttpResponse httpResponse = null;
    +        String requestTime = DateUtils.formatDate(System.currentTimeMillis());
    +        HttpPut httpPut = new HttpPut("http://bucket001.obs.a1.example.com/objecttest1");
    +        httpPut.addHeader("Date", requestTime);
     
    -         /**Calculate the signature based on the request.**/
    -        String contentMD5 = "";
    -        String contentType = "";
    -        String canonicalizedHeaders = "";
    -        String canonicalizedResource = "/bucket001/objecttest1";
    -        // Content-MD5 and Content-Type fields do not contain line breaks. The data format is RFC 1123, which is the same as the time in the request.
    -        String canonicalString = "PUT" + "\n" + contentMD5 + "\n" + contentType + "\n" + requestTime + "\n" + canonicalizedHeaders + canonicalizedResource;
    -        System.out.println("StringToSign:[" + canonicalString + "]");
    -        String signature = null;
    -        try {
    -            signature = Signature.signWithHmacSha1(securityKey, canonicalString);
    -            // Directory for storing uploaded files
    -            inputStream = new FileInputStream("D:\\OBSobject\\text01.txt");
    -            InputStreamEntity entity = new InputStreamEntity(inputStream);
    -            httpPut.setEntity(entity);
    +         /**Calculate the signature based on the request.**/
    +        String contentMD5 = "";
    +        String contentType = "";
    +        String canonicalizedHeaders = "";
    +        String canonicalizedResource = "/bucket001/objecttest1";
    +        // Content-MD5 and Content-Type fields do not contain line breaks. The data format is RFC 1123, which is the same as the time in the request.
    +        String canonicalString = "PUT" + "\n" + contentMD5 + "\n" + contentType + "\n" + requestTime + "\n" + canonicalizedHeaders + canonicalizedResource;
    +        System.out.println("StringToSign:[" + canonicalString + "]");
    +        String signature = null;
    +        try {
    +            signature = Signature.signWithHmacSha1(securityKey, canonicalString);
    +            // Directory for storing uploaded files
    +            inputStream = new FileInputStream("D:\\OBSobject\\text01.txt");
    +            InputStreamEntity entity = new InputStreamEntity(inputStream);
    +            httpPut.setEntity(entity);
     
    -           // Added the Authorization: OBS AccessKeyID:signature field to the header.
    -            httpPut.addHeader("Authorization", "OBS " + accessKey + ":" + signature);
    -            httpResponse = httpClient.execute(httpPut);
    +           // Added the Authorization: OBS AccessKeyID:signature field to the header.
    +            httpPut.addHeader("Authorization", "OBS " + accessKey + ":" + signature);
    +            httpResponse = httpClient.execute(httpPut);
     
    -           // Prints the sending request information and the received response message.
    -            System.out.println("Request Message:");
    -            System.out.println(httpPut.getRequestLine());
    -            for (Header header : httpPut.getAllHeaders()) {
    -                System.out.println(header.getName() + ":" + header.getValue());
    -            }
    +           // Prints the sending request information and the received response message.
    +            System.out.println("Request Message:");
    +            System.out.println(httpPut.getRequestLine());
    +            for (Header header : httpPut.getAllHeaders()) {
    +                System.out.println(header.getName() + ":" + header.getValue());
    +            }
     
    -            System.out.println("Response Message:");
    -            System.out.println(httpResponse.getStatusLine());
    -            for (Header header : httpResponse.getAllHeaders()) {
    -                System.out.println(header.getName() + ":" + header.getValue());
    -            }
    -            BufferedReader reader = new BufferedReader(new InputStreamReader(
    -                    httpResponse.getEntity().getContent()));
    +            System.out.println("Response Message:");
    +            System.out.println(httpResponse.getStatusLine());
    +            for (Header header : httpResponse.getAllHeaders()) {
    +                System.out.println(header.getName() + ":" + header.getValue());
    +            }
    +            BufferedReader reader = new BufferedReader(new InputStreamReader(
    +                    httpResponse.getEntity().getContent()));
     
    -            String inputLine;
    -            StringBuffer response = new StringBuffer();
    +            String inputLine;
    +            StringBuffer response = new StringBuffer();
     
    -            while ((inputLine = reader.readLine()) != null) {
    -                response.append(inputLine);
    -            }
    -            reader.close();
    +            while ((inputLine = reader.readLine()) != null) {
    +                response.append(inputLine);
    +            }
    +            reader.close();
     
    -            // print result
    -            System.out.println(response.toString());
    +            // print result
    +            System.out.println(response.toString());
     
     
    -        } catch (UnsupportedEncodingException e) {
    -            e.printStackTrace();
    +        } catch (UnsupportedEncodingException e) {
    +            e.printStackTrace();
     
    -        } catch (IOException e) {
    -            e.printStackTrace();
    -        } finally {
    -            try {
    -                httpClient.close();
    -            } catch (IOException e) {
    -                e.printStackTrace();
    -            }
    -        }
    -    }
    +        } catch (IOException e) {
    +            e.printStackTrace();
    +        } finally {
    +            try {
    +                httpClient.close();
    +            } catch (IOException e) {
    +                e.printStackTrace();
    +            }
    +        }
    +    }
     
     }
    -
    -
    +
    + +

    The format of the Date header field DateUtils is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    package com.obsclient;
     
    -import java.text.DateFormat;
    -import java.text.SimpleDateFormat;
    -import java.util.Locale;
    -import java.util.TimeZone;
    +import java.text.DateFormat;
    +import java.text.SimpleDateFormat;
    +import java.util.Locale;
    +import java.util.TimeZone;
     
    -public class DateUtils {
    +public class DateUtils {
     
    -    public static String formatDate(long time)
    -    {
    -        DateFormat serverDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    -        serverDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    -        return serverDateFormat.format(time);
    -    }
    +    public static String formatDate(long time)
    +    {
    +        DateFormat serverDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    +        serverDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
    +        return serverDateFormat.format(time);
    +    }
     }
    -
    -
    +
    + +

    The method of calculating the signature character string is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    package com.obsclient;
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    package com.obsclient;
     
    -import javax.crypto.Mac;
    -import javax.crypto.spec.SecretKeySpec;
    -import java.io.UnsupportedEncodingException;
    -import java.security.NoSuchAlgorithmException;
    -import java.security.InvalidKeyException;
    -import java.util.Base64;
    +import javax.crypto.Mac;
    +import javax.crypto.spec.SecretKeySpec;
    +import java.io.UnsupportedEncodingException;
    +import java.security.NoSuchAlgorithmException;
    +import java.security.InvalidKeyException;
    +import java.util.Base64;
     
    -public class Signature {
    -    public static String signWithHmacSha1(String sk, String canonicalString) throws UnsupportedEncodingException {
    +public class Signature {
    +    public static String signWithHmacSha1(String sk, String canonicalString) throws UnsupportedEncodingException {
     
    -        try {
    -            SecretKeySpec signingKey = new SecretKeySpec(sk.getBytes("UTF-8"), "HmacSHA1");
    -            Mac mac = Mac.getInstance("HmacSHA1");
    -            mac.init(signingKey);
    -            return Base64.getEncoder().encodeToString(mac.doFinal(canonicalString.getBytes("UTF-8")));
    -        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
    -            e.printStackTrace();
    -        }
    -        return null;
    -    }
    +        try {
    +            SecretKeySpec signingKey = new SecretKeySpec(sk.getBytes("UTF-8"), "HmacSHA1");
    +            Mac mac = Mac.getInstance("HmacSHA1");
    +            mac.init(signingKey);
    +            return Base64.getEncoder().encodeToString(mac.doFinal(canonicalString.getBytes("UTF-8")));
    +        } catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
    +            e.printStackTrace();
    +        }
    +        return null;
    +    }
     }
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0019.html b/docs/obs/api-ref/obs_04_0019.html index 6394160e5..ec0f319d2 100644 --- a/docs/obs/api-ref/obs_04_0019.html +++ b/docs/obs/api-ref/obs_04_0019.html @@ -10,6 +10,8 @@
  3. + -

    Response Syntax

    1
    -2
    -3
    HTTP/1.1 status_code
    -Date: date
    -Content-Length: length
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    HTTP/1.1 status_code
    +Date: date
    +Content-Length: length
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -273,47 +275,49 @@ Content-Length: length

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    PUT /?website HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 03:40:29 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:pUK7Yp0yebnq4P6gqzVjoS7whoM=
    -Content-Length: 194
    +

    Sample Request

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    PUT /?website HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 03:40:29 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:pUK7Yp0yebnq4P6gqzVjoS7whoM=
    +Content-Length: 194
     
    -<WebsiteConfiguration xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <RedirectAllRequestsTo>
    -    <HostName>www.example.com</HostName>
    -  </RedirectAllRequestsTo>
    +<WebsiteConfiguration xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <RedirectAllRequestsTo>
    +    <HostName>www.example.com</HostName>
    +  </RedirectAllRequestsTo>
     </WebsiteConfiguration>
    -
    -
    +
    + +
    + +

    Sample Response

    1
    +2
    +3
    +4
    +5
    +6
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF2600000164360D144670B9D02AABC6
    +x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSItqMZ/AoFUX97l1xx8s67V3cCQtXWk
    +Date: WED, 01 Jul 2015 03:40:29 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    -6
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF2600000164360D144670B9D02AABC6
    -x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSItqMZ/AoFUX97l1xx8s67V3cCQtXWk
    -Date: WED, 01 Jul 2015 03:40:29 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0072.html b/docs/obs/api-ref/obs_04_0072.html index 3137339cd..c4099f6fa 100644 --- a/docs/obs/api-ref/obs_04_0072.html +++ b/docs/obs/api-ref/obs_04_0072.html @@ -4,43 +4,45 @@

    Functions

    You can perform this operation to get the static website hosting configuration of a bucket.

    To perform this operation, you must have the GetBucketWebsite permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.

    -

    Request Syntax

    1
    -2
    -3
    -4
    GET /?website HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    GET /?website HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    This request uses common headers. For details, see Table 3.

    Request Elements

    This request involves no elements.

    -

    Response Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    HTTP/1.1 status_code
    -Date: date
    -Content-Type: type
    -Content-Length: length
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<WebsiteConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"> 
    -    <RedirectAllRequestsTo> 
    -        <HostName>hostName</HostName> 
    -    </RedirectAllRequestsTo> 
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    HTTP/1.1 status_code
    +Date: date
    +Content-Type: type
    +Content-Length: length
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<WebsiteConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"> 
    +    <RedirectAllRequestsTo> 
    +        <HostName>hostName</HostName> 
    +    </RedirectAllRequestsTo> 
     </WebsiteConfiguration>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -68,49 +70,51 @@ Content-Length: length

    For other errors, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    GET /?website HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 03:41:54 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:Yxt1Ru+feHE0S94R7dcBp+hfLnI=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    GET /?website HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 03:41:54 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:Yxt1Ru+feHE0S94R7dcBp+hfLnI=
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF2600000164363442EC03A8CA3DD7F5
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSFbGOmlN0BVp1kbwN3har8jbVvtKEKN
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 03:41:54 GMT
    -Content-Length: 250
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF2600000164363442EC03A8CA3DD7F5
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSFbGOmlN0BVp1kbwN3har8jbVvtKEKN
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 03:41:54 GMT
    +Content-Length: 250
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<WebsiteConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"> 
    -  <RedirectAllRequestsTo>
    -    <HostName>www.example.com</HostName>
    -  </RedirectAllRequestsTo>
    +<WebsiteConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"> 
    +  <RedirectAllRequestsTo>
    +    <HostName>www.example.com</HostName>
    +  </RedirectAllRequestsTo>
     </WebsiteConfiguration>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0073.html b/docs/obs/api-ref/obs_04_0073.html index 5babe9f55..cce93f157 100644 --- a/docs/obs/api-ref/obs_04_0073.html +++ b/docs/obs/api-ref/obs_04_0073.html @@ -4,31 +4,33 @@

    Functions

    You can perform this operation to delete the website configuration of a bucket.

    To perform this operation, you must have the DeleteBucketWebsite permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.

    -

    Request Syntax

    1
    -2
    -3
    -4
    DELETE /?website HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    DELETE /?website HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    This request uses common headers. For details, see Table 3.

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    HTTP/1.1 status_code
    -Date: date
    -Content-Type: type
    -Content-Length: length
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    HTTP/1.1 status_code
    +Date: date
    +Content-Type: type
    +Content-Length: length
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -36,31 +38,33 @@ Content-Length: length

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    DELETE /?website HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: bucketname.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 03:44:37 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:AZ1b0N5eLknxNOe/c0BISV1bEqc=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    DELETE /?website HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: bucketname.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 03:44:37 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:AZ1b0N5eLknxNOe/c0BISV1bEqc=
    +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 No Content
    +Server: OBS
    +x-obs-request-id: BF2600000164363786230E2001DC0807
    +x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSFUG4fEyDRgzUiEY2i71bJndBCy+wUZ
    +Date: WED, 01 Jul 2015 03:44:37 GMT
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    HTTP/1.1 204 No Content
    -Server: OBS
    -x-obs-request-id: BF2600000164363786230E2001DC0807
    -x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSFUG4fEyDRgzUiEY2i71bJndBCy+wUZ
    -Date: WED, 01 Jul 2015 03:44:37 GMT
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0074.html b/docs/obs/api-ref/obs_04_0074.html index e8e5ca572..8615095be 100644 --- a/docs/obs/api-ref/obs_04_0074.html +++ b/docs/obs/api-ref/obs_04_0074.html @@ -7,43 +7,44 @@
    • With the support of CORS, you can use JavaScript and HTML5 to construct web applications and directly access the resources in OBS without the need to use proxy servers for transfer.
    • You can enable the dragging function of HTML 5 to directly upload files to the OBS (with the upload progress displayed) or update the OBS contents using web applications.
    • Hosts external web pages, style sheets, and HTML 5 applications in different origins. Web fonts or pictures on OBS can be shared by multiple websites.

    To perform this operation, you must have the PutBucketCORS permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.

    -

    Request Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    PUT /?cors HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Content-Length: length
    -Date: date
    -Authorization: authorization
    -Content-MD5: MD5
    -<?xml version="1.0" encoding="UTF-8"?> 
    -<CORSConfiguration> 
    -    <CORSRule> 
    -        <ID>id</ID> 
    -        <AllowedMethod>method</AllowedMethod> 
    -        <AllowedOrigin>origin</AllowedOrigin> 
    -        <AllowedHeader>header</AllowedHeader> 
    -        <MaxAgeSeconds>seconds</MaxAgeSeconds> 
    -        <ExposeHeader>header</ExposeHeader> 
    -    </CORSRule> 
    +

    Request Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    PUT /?cors HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Content-Length: length
    +Date: date
    +Authorization: authorization
    +Content-MD5: MD5
    +<?xml version="1.0" encoding="UTF-8"?> 
    +<CORSConfiguration> 
    +    <CORSRule> 
    +        <ID>id</ID> 
    +        <AllowedMethod>method</AllowedMethod> 
    +        <AllowedOrigin>origin</AllowedOrigin> 
    +        <AllowedHeader>header</AllowedHeader> 
    +        <MaxAgeSeconds>seconds</MaxAgeSeconds> 
    +        <ExposeHeader>header</ExposeHeader> 
    +    </CORSRule> 
     </CORSConfiguration>
    -
    -
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    This request uses common headers and CORS request headers. For details, see Table 3 and Table 1.

    @@ -59,7 +60,7 @@ Content-MD5: MD5

    Base64-encoded 128-bit MD5 digest of the message according to RFC 1864

    Type: string

    -

    Example: n58IG6hfM7vqI4K0vnWpog==

    +

    Example: n58IG6hfM7vqI4K0vnWpog==

    Yes

    @@ -81,7 +82,7 @@ Content-MD5: MD5

    CORSConfiguration

    Root node of CORSRule and its capacity cannot exceed 64 KB.

    -

    Type: Container

    +

    Type: container

    Ancestor: none

    Yes

    @@ -90,7 +91,7 @@ Content-MD5: MD5

    CORSRule

    CORS rules. CORSConfiguration can contain a maximum of 100 rules.

    -

    Type: Container

    +

    Type: container

    Ancestor: CORSConfiguration

    Yes

    @@ -137,7 +138,7 @@ Content-MD5: MD5

    Indicates the response time of CORS that can be cached by a client. It is expressed in seconds.

    Each CORSRule can contain only one MaxAgeSeconds. It can be set to a negative value.

    -

    Type: Integer

    +

    Type: integer

    Ancestor: CORSRule

    No

    @@ -156,15 +157,16 @@ Content-MD5: MD5
    -

    Response Syntax

    1
    -2
    -3
    -4
    HTTP/1.1 status_code
    +

    Response Syntax

    1
    +2
    +3
    +4
    HTTP/1.1 status_code
     
    -Date: date
    -Content-Length: length
    -
    -
    +Date: date +Content-Length: length +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -172,73 +174,75 @@ Content-Length: length

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    PUT /?cors HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 03:51:52 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:lq7BGoqE9yyhdEwE6KojJ7ysVxU=
    -Content-MD5: NGLzvw81f/A2C9PiGO0aZQ==
    -Content-Length: 617
    +

    Sample Request

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    PUT /?cors HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 03:51:52 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:lq7BGoqE9yyhdEwE6KojJ7ysVxU=
    +Content-MD5: NGLzvw81f/A2C9PiGO0aZQ==
    +Content-Length: 617
     
     <?xml version="1.0" encoding="utf-8"?>
    -<CORSConfiguration> 
    -  <CORSRule> 
    -    <AllowedMethod>POST</AllowedMethod>  
    -    <AllowedMethod>GET</AllowedMethod>  
    -    <AllowedMethod>HEAD</AllowedMethod>  
    -    <AllowedMethod>PUT</AllowedMethod>  
    -    <AllowedMethod>DELETE</AllowedMethod>  
    -    <AllowedOrigin>www.example.com</AllowedOrigin>  
    -    <AllowedHeader>AllowedHeader_1</AllowedHeader>  
    -    <AllowedHeader>AllowedHeader_2</AllowedHeader>  
    -    <MaxAgeSeconds>100</MaxAgeSeconds>  
    -    <ExposeHeader>ExposeHeader_1</ExposeHeader>  
    -    <ExposeHeader>ExposeHeader_2</ExposeHeader> 
    -  </CORSRule>
    +<CORSConfiguration> 
    +  <CORSRule> 
    +    <AllowedMethod>POST</AllowedMethod>  
    +    <AllowedMethod>GET</AllowedMethod>  
    +    <AllowedMethod>HEAD</AllowedMethod>  
    +    <AllowedMethod>PUT</AllowedMethod>  
    +    <AllowedMethod>DELETE</AllowedMethod>  
    +    <AllowedOrigin>www.example.com</AllowedOrigin>  
    +    <AllowedHeader>AllowedHeader_1</AllowedHeader>  
    +    <AllowedHeader>AllowedHeader_2</AllowedHeader>  
    +    <MaxAgeSeconds>100</MaxAgeSeconds>  
    +    <ExposeHeader>ExposeHeader_1</ExposeHeader>  
    +    <ExposeHeader>ExposeHeader_2</ExposeHeader> 
    +  </CORSRule>
     </CORSConfiguration>
    -
    -
    +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 100 Continue
    +HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF26000001643627112BD03512FC94A4
    +x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSYi6wLC4bkrvuS9sqnlRjxK2a5Fe3ry
    +Date: WED, 01 Jul 2015 03:51:52 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 100 Continue
    -HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF26000001643627112BD03512FC94A4
    -x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSYi6wLC4bkrvuS9sqnlRjxK2a5Fe3ry
    -Date: WED, 01 Jul 2015 03:51:52 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0075.html b/docs/obs/api-ref/obs_04_0075.html index d1c794935..24d23ed42 100644 --- a/docs/obs/api-ref/obs_04_0075.html +++ b/docs/obs/api-ref/obs_04_0075.html @@ -4,45 +4,47 @@

    Functions

    You can perform this operation to obtain CORS configuration information about a specified bucket.

    To perform this operation, you must have the GetBucketCORS permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.

    -

    Request Syntax

    1
    -2
    -3
    -4
    GET /?cors HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    GET /?cors HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    This request uses common headers. For details, see Table 3.

    Request Elements

    This request involves no elements.

    -

    Response Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    HTTP/1.1 status_code
    -Content-Type:  application/xml 
    -Date: date
    -Content-Length: length
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    HTTP/1.1 status_code
    +Content-Type:  application/xml 
    +Date: date
    +Content-Length: length
     
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<CORSConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -    <CORSRule> 
    -        ... 
    -    </CORSRule> 
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<CORSConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +    <CORSRule> 
    +        ... 
    +    </CORSRule> 
     </CORSConfiguration>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -57,14 +59,14 @@ Content-Length: length

    CORSConfiguration

    Root node of CORSRules and its capacity cannot exceed 64 KB.

    -

    Type: Container

    +

    Type: container

    Ancestor: none

    CORSRule

    CORS rule. CORSConfiguration can contain a maximum of 100 rules.

    -

    Type: Container

    +

    Type: container

    Ancestor: CORSConfiguration

    @@ -101,7 +103,7 @@ Content-Length: length

    Response time of CORS that can be cached by a client. It is expressed in seconds.

    Each CORSRule can contain only one MaxAgeSeconds. It can be set to a negative value.

    -

    Type: Integer

    +

    Type: integer

    Ancestor: CORSRule

    @@ -138,75 +140,77 @@ Content-Length: length

    For other errors, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    GET /?cors HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 03:54:36 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:WJGghTrPQQXRuCx5go1fHyE+Wwg=
    -
    -
    -
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF2600000164363593F10738B80CACBE
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSpngvwC5TskcLGh7Fz5KRmCFIayuY8p
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 03:54:36 GMT
    -Content-Length: 825
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    GET /?cors HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 03:54:36 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:WJGghTrPQQXRuCx5go1fHyE+Wwg=
    +
    -<?xml version="1.0" encoding="utf-8"?> -<CORSConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/"> - <CORSRule> - <ID>783fc6652cf246c096ea836694f71855</ID> - <AllowedMethod>POST</AllowedMethod> - <AllowedMethod>GET</AllowedMethod> - <AllowedMethod>HEAD</AllowedMethod> - <AllowedMethod>PUT</AllowedMethod> - <AllowedMethod>DELETE</AllowedMethod> - - <AllowedOrigin>obs.example.com</AllowedOrigin> - <AllowedOrigin>www.example.com</AllowedOrigin> - <AllowedHeader>AllowedHeader_1</AllowedHeader> - <AllowedHeader>AllowedHeader_2</AllowedHeader> - <MaxAgeSeconds>100</MaxAgeSeconds> - <ExposeHeader>ExposeHeader_1</ExposeHeader> - <ExposeHeader>ExposeHeader_2</ExposeHeader> - </CORSRule> +
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF2600000164363593F10738B80CACBE
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSpngvwC5TskcLGh7Fz5KRmCFIayuY8p
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 03:54:36 GMT
    +Content-Length: 825
    +
    +<?xml version="1.0" encoding="utf-8"?> 
    +<CORSConfiguration xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +  <CORSRule> 
    +    <ID>783fc6652cf246c096ea836694f71855</ID>  
    +    <AllowedMethod>POST</AllowedMethod>  
    +    <AllowedMethod>GET</AllowedMethod>  
    +    <AllowedMethod>HEAD</AllowedMethod>  
    +    <AllowedMethod>PUT</AllowedMethod>  
    +    <AllowedMethod>DELETE</AllowedMethod>  
    + 
    +    <AllowedOrigin>obs.example.com</AllowedOrigin>  
    +    <AllowedOrigin>www.example.com</AllowedOrigin>  
    +    <AllowedHeader>AllowedHeader_1</AllowedHeader>  
    +    <AllowedHeader>AllowedHeader_2</AllowedHeader>  
    +    <MaxAgeSeconds>100</MaxAgeSeconds>  
    +    <ExposeHeader>ExposeHeader_1</ExposeHeader>  
    +    <ExposeHeader>ExposeHeader_2</ExposeHeader> 
    +  </CORSRule>
     </CORSConfiguration>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0076.html b/docs/obs/api-ref/obs_04_0076.html index 593a76669..01a5ce6a3 100644 --- a/docs/obs/api-ref/obs_04_0076.html +++ b/docs/obs/api-ref/obs_04_0076.html @@ -4,31 +4,33 @@

    Functions

    This operation is used to delete the CORS configuration of a bucket. After the CORS configuration is deleted, the bucket and objects in it cannot be accessed by requests from other websites.

    To perform this operation, you must have the PutBucketCORS permission.

    -

    Request Syntax

    1
    -2
    -3
    -4
    DELETE /?cors HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    DELETE /?cors HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    This request uses common headers. For details, see Table 3.

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    HTTP/1.1 status_code
    -Date: date
    -Content-Type:  application/xml 
    -Content-Length: length
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    HTTP/1.1 status_code
    +Date: date
    +Content-Type:  application/xml 
    +Content-Length: length
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -36,31 +38,33 @@ Content-Length: length

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    DELETE /?cors HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 03:56:41 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mKUs/uIPb8BP0ZhvMd4wEy+EbiI=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    DELETE /?cors HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 03:56:41 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mKUs/uIPb8BP0ZhvMd4wEy+EbiI=
    +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 No Content
    +Server: OBS
    +x-obs-request-id: BF26000001643639F290185BB27F793A
    +x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSLWMRFJfckapW+ktT/+1AnAz7XlNU0b
    +Date: WED, 01 Jul 2015 03:56:41 GMT
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    HTTP/1.1 204 No Content
    -Server: OBS
    -x-obs-request-id: BF26000001643639F290185BB27F793A
    -x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSLWMRFJfckapW+ktT/+1AnAz7XlNU0b
    -Date: WED, 01 Jul 2015 03:56:41 GMT
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0077.html b/docs/obs/api-ref/obs_04_0077.html index 2a839811f..57ef01d64 100644 --- a/docs/obs/api-ref/obs_04_0077.html +++ b/docs/obs/api-ref/obs_04_0077.html @@ -9,21 +9,22 @@
    OPTIONS /object HTTP/1.1
    OPTIONS / HTTP/1.1
    -

    Request Syntax

    1
    -2
    -3
    -4
    -5
    -6
    OPTIONS / HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -Origin: origin
    -Access-Control-Request-Method: method
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    +5
    +6
    OPTIONS / HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +Origin: origin
    +Access-Control-Request-Method: method
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    This request uses the headers described in Table 1.

    @@ -66,25 +67,26 @@ Access-Control-Request-Method: method

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 status_code
    -Content-Type: application/xml 
    -Access-Control-Allow-Origin: origin
    -Access-Control-Allow-Methods: method
    -Access-Control-Allow-Header: header
    -Access-Control-Max-Age: time
    -Access-Control-Expose-Headers: header
    -Date: date
    -Content-Length: length
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 status_code
    +Content-Type: application/xml 
    +Access-Control-Allow-Origin: origin
    +Access-Control-Allow-Methods: method
    +Access-Control-Allow-Header: header
    +Access-Control-Max-Age: time
    +Access-Control-Expose-Headers: header
    +Date: date
    +Content-Length: length
    +
    + +

    Response Headers

    The response uses the following headers as described in Table 2.

    @@ -170,47 +172,49 @@ Content-Length: length

    For other errors, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    OPTIONS / HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:02:15 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:7RqP1vjemo6U+Adv9/Y6eGzWrzA=
    -Origin: www.example.com
    -Access-Control-Request-Method: PUT
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    OPTIONS / HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:02:15 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:7RqP1vjemo6U+Adv9/Y6eGzWrzA=
    +Origin: www.example.com
    +Access-Control-Request-Method: PUT
    +
    + +
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF260000016436314E8FF936946DBC9C
    +Access-Control-Allow-Origin: www.example.com
    +Access-Control-Allow-Methods: POST,GET,HEAD,PUT,DELETE
    +Access-Control-Max-Age: 100
    +Access-Control-Expose-Headers: ExposeHeader_1,ExposeHeader_2
    +Access-Control-Allow-Credentials: true
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTlYimJvOyJncCLNm5y/iz6MAGLNxTuS
    +Date: WED, 01 Jul 2015 04:02:15 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF260000016436314E8FF936946DBC9C
    -Access-Control-Allow-Origin: www.example.com
    -Access-Control-Allow-Methods: POST,GET,HEAD,PUT,DELETE
    -Access-Control-Max-Age: 100
    -Access-Control-Expose-Headers: ExposeHeader_1,ExposeHeader_2
    -Access-Control-Allow-Credentials: true
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTlYimJvOyJncCLNm5y/iz6MAGLNxTuS
    -Date: WED, 01 Jul 2015 04:02:15 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0078.html b/docs/obs/api-ref/obs_04_0078.html index ce52fdd5d..879139102 100644 --- a/docs/obs/api-ref/obs_04_0078.html +++ b/docs/obs/api-ref/obs_04_0078.html @@ -7,21 +7,22 @@
    OPTIONS /object HTTP/1.1
    OPTIONS / HTTP/1.1
    -

    Request Syntax

    1
    -2
    -3
    -4
    -5
    -6
    OPTIONS /object HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -Origin: origin
    -Access-Control-Request-Method: method
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    +5
    +6
    OPTIONS /object HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +Origin: origin
    +Access-Control-Request-Method: method
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    Table 1 describes headers used by this request.

    @@ -64,25 +65,26 @@ Access-Control-Request-Method: method

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 status_code
    -Content-Type: type
    -Access-Control-Allow-Origin: origin
    -Access-Control-Allow-Methods: method
    -Access-Control-Allow-Header: header
    -Access-Control-Max-Age: time
    -Access-Control-Expose-Headers: header
    -Date: date
    -Content-Length: length
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 status_code
    +Content-Type: type
    +Access-Control-Allow-Origin: origin
    +Access-Control-Allow-Methods: method
    +Access-Control-Allow-Header: header
    +Access-Control-Max-Age: time
    +Access-Control-Expose-Headers: header
    +Date: date
    +Content-Length: length
    +
    + +

    Response Headers

    The request uses the headers described in Table 2.

    @@ -168,47 +170,49 @@ Content-Length: length

    For other errors, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    OPTIONS /object_1 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:02:19 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:bQZG9c2aokAJsHOOkuVBK6cHZZQ=
    -Origin: www.example.com
    -Access-Control-Request-Method: PUT
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    OPTIONS /object_1 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:02:19 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:bQZG9c2aokAJsHOOkuVBK6cHZZQ=
    +Origin: www.example.com
    +Access-Control-Request-Method: PUT
    +
    + +
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF26000001643632D12EFCE1C1294555
    +Access-Control-Allow-Origin: www.example.com
    +Access-Control-Allow-Methods: POST,GET,HEAD,PUT,DELETE
    +Access-Control-Max-Age: 100
    +Access-Control-Expose-Headers: ExposeHeader_1,ExposeHeader_2
    +Access-Control-Allow-Credentials: true
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCS+DXV4zZetbTqFehhEcuXywTa/mi3T3
    +Date: WED, 01 Jul 2015 04:02:19 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF26000001643632D12EFCE1C1294555
    -Access-Control-Allow-Origin: www.example.com
    -Access-Control-Allow-Methods: POST,GET,HEAD,PUT,DELETE
    -Access-Control-Max-Age: 100
    -Access-Control-Expose-Headers: ExposeHeader_1,ExposeHeader_2
    -Access-Control-Allow-Credentials: true
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCS+DXV4zZetbTqFehhEcuXywTa/mi3T3
    -Date: WED, 01 Jul 2015 04:02:19 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0079.html b/docs/obs/api-ref/obs_04_0079.html index a3fb7e6eb..9134d5857 100644 --- a/docs/obs/api-ref/obs_04_0079.html +++ b/docs/obs/api-ref/obs_04_0079.html @@ -24,6 +24,14 @@ + + + +

    Versioning

    If versioning is enabled for a bucket, the system automatically generates a unique version ID for the requested object in this bucket and returns the version ID in response header x-obs-version-id. If versioning is suspended for the bucket, the object version ID is null. For details about the versioning statuses of a bucket, see Configuring Versioning for a Bucket.

    -

    Request Syntax

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    PUT /ObjectName HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Content-Type: application/xml 
    -Content-Length: length
    -Authorization: authorization
    -Date: date
    -<Optional Additional Header> 
    -<object Content>
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    PUT /ObjectName HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Content-Type: application/xml 
    +Content-Length: length
    +Authorization: authorization
    +Date: date
    +<Optional Additional Header> 
    +<object Content>
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no parameters.

    Request Headers

    This request uses common headers. For details, see Table 3. The request can use additional headers, as listed in Table 1.

    OBS supports the six HTTP request headers: Cache-Control, Expires, Content-Encoding, Content-Disposition, Content-Type, and Content-Language. If these headers are carried in an object upload request, their values are saved. You can also call the metadata modification API, provided by OBS, to change the values of the six headers. When the object is downloaded or queried, the saved values are set for corresponding HTTP headers and returned to the client.

    @@ -54,7 +55,7 @@ Date: date

    Base64-encoded 128-bit MD5 digest of the message according to RFC 1864.

    Type: string

    -

    Example: n58IG6hfM7vqI4K0vnWpog==

    +

    Example: n58IG6hfM7vqI4K0vnWpog==

    No

    @@ -64,7 +65,7 @@ Date: date

    This header can be added to set access control policies for objects when creating the objects. The access control policies are the predefined common policies, including private, public-read, public-read-write.

    Type: string

    Note: This header is a predefined policy expressed in a character string.

    -

    Example: x-obs-acl: public-read

    +

    Example: x-obs-acl: public-read

    No

    @@ -109,8 +110,8 @@ Date: date

    When creating an object, you can use this header to specify the storage class for the object. If you do not use this header, the object storage class is the default storage class of the bucket.

    Type: string

    -

    Note: There are three storage classes: STANDARD (Standard storage class), WARM (Warm storage class), and COLD (Cold storage class). Therefore, this parameter value can be STANDARD, WARM, or COLD. These values are case sensitive.

    -

    Example: x-obs-storage-class: STANDARD

    +

    Storage class value options: STANDARD (Standard), WARM (Warm), COLD (Cold). These values are case sensitive.

    +

    Example: x-obs-storage-class: STANDARD

    No

    @@ -119,7 +120,7 @@ Date: date

    When creating an object, you can use a header starting with x-obs-meta- to define object metadata in an HTTP request. Custom metadata will be returned in the response header when you retrieve or query the metadata of the object.

    Type: string

    -

    Example: x-obs-meta-test: test metadata

    +

    Example: x-obs-meta-test: test metadata

    No

    @@ -142,7 +143,7 @@ Date: date

    Indicates that SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption: kms

    +

    Example: x-obs-server-side-encryption: kms

    No. This header is required when SSE-KMS is used.

    @@ -154,7 +155,7 @@ Date: date

    The following two formats are supported:

    1. regionID:domainID:key/key_id

    2. key_id

    -

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    +

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    Example:

    1. x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001: key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    2. x-obs-server-side-encryption-kms-key-id: 4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    @@ -166,7 +167,7 @@ Date: date

    Encryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -176,7 +177,7 @@ Date: date

    Indicates a key used to encrypt objects. The header is used in SSE-C mode. This key is used to encrypt objects.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -186,7 +187,7 @@ Date: date

    Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used.

    @@ -206,7 +207,7 @@ Date: date

    Indicates the expiration time of an object, in days. An object will be automatically deleted once it expires (calculated from the last modification time of the object).

    This field can be configured only when an object is uploaded and cannot be modified through the metadata modification API.

    Type: integer

    -

    Example: x-obs-expires:3

    +

    Example: x-obs-expires:3

    No

    @@ -217,13 +218,14 @@ Date: date

    Request Elements

    This request contains no elements. Its body contains only the content of the requested object.

    -

    Response Syntax

    1
    -2
    -3
    HTTP/1.1 status_code
    -Content-Length: length
    -Content-Type: type
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    HTTP/1.1 status_code
    +Content-Length: length
    +Content-Type: type
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 2.

    @@ -244,7 +246,7 @@ Content-Type: type

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -253,21 +255,21 @@ Content-Type: type

    Type: string

    Format: regionID:domainID:key/key_id

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID used in this encryption.

    -

    Example: x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    +

    Example: x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    x-obs-server-side-encryption-customer-algorithm

    An encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    The MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    x-obs-storage-class

    @@ -285,211 +287,221 @@ Content-Type: type

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    Sample Request 1

    Upload an object.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    PUT /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:11:15 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
    -Content-Length: 10240
    -Expect: 100-continue
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    PUT /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:11:15 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
    +Content-Length: 10240
    +Expect: 100-continue
    +
    +[1024 Byte data content]
    +
    + +
    +
    +

    Sample Response 1

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF2600000164364C10805D385E1E3C67
    +ETag: "d41d8cd98f00b204e9800998ecf8427e"
    +x-obs-id-2: 32AAAWJAMAABAAAQAAEAABAAAQAAEAABCTzu4Jp2lquWuXsjnLyPPiT3cfGhqPoY
    +Date: WED, 01 Jul 2015 04:11:15 GMT
    +Content-Length: 0
    +
    -[1024 Byte data content] -
    -
    -

    Sample Response 1

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BF2600000164364C10805D385E1E3C67
    -ETag: "d41d8cd98f00b204e9800998ecf8427e"
    -x-obs-id-2: 32AAAWJAMAABAAAQAAEAABAAAQAAEAABCTzu4Jp2lquWuXsjnLyPPiT3cfGhqPoY
    -Date: WED, 01 Jul 2015 04:11:15 GMT
    -Content-Length: 0
    -
    -

    Sample Request 2

    Set the ACL when uploading an object.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    PUT /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:13:55 GMT
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    PUT /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:13:55 GMT
     x-obs-grant-read:id=52f24s3593as5730ea4f722483579ai7,id=a93fcas852f24s3596ea8366794f7224
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
    -Content-Length: 10240
    -Expect: 100-continue
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:gYqplLq30dEX7GMi2qFWyjdFsyw=
    +Content-Length: 10240
    +Expect: 100-continue
    +
    +[1024 Byte data content]
    +
    + +
    +
    +

    Sample Response 2

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BB7800000164845759E4F3B39ABEE55E
    +ETag: "d41d8cd98f00b204e9800998ecf8427e"
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSReVRNuas0knI+Y96iXrZA7BLUgj06Z
    +Date: WED, 01 Jul 2015 04:13:55 GMT
    +Content-Length: 0
    +
    -[1024 Byte data content] -
    -
    -

    Sample Response 2

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BB7800000164845759E4F3B39ABEE55E
    -ETag: "d41d8cd98f00b204e9800998ecf8427e"
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSReVRNuas0knI+Y96iXrZA7BLUgj06Z
    -Date: WED, 01 Jul 2015 04:13:55 GMT
    -Content-Length: 0
    -
    -

    Sample Request 3

    Upload objects when versioning is enabled for the bucket.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    PUT /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:17:12 GMT
    -x-obs-storage-class: WARM
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    -Content-Length: 10240
    -Expect: 100-continue
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    PUT /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:17:12 GMT
    +x-obs-storage-class: WARM
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    +Content-Length: 10240
    +Expect: 100-continue
    +
    +[1024 Byte data content]
    +
    + +
    +
    +

    Sample Response 3

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577
    +ETag: "d41d8cd98f00b204e9800998ecf8427e"
    +X-OBS-ID-2: GcVgfeOJHx8JZHTHrRqkPsbKdB583fYbr3RBbHT6mMrBstReVILBZbMAdLiBYy1l
    +Date: WED, 01 Jul 2015 04:17:12 GMT
    +x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
    +Content-Length: 0
    +
    -[1024 Byte data content] -
    -
    -

    Sample Response 3

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577
    -ETag: "d41d8cd98f00b204e9800998ecf8427e"
    -X-OBS-ID-2: GcVgfeOJHx8JZHTHrRqkPsbKdB583fYbr3RBbHT6mMrBstReVILBZbMAdLiBYy1l
    -Date: WED, 01 Jul 2015 04:17:12 GMT
    -x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
    -Content-Length: 0
    -
    -

    Sample Request 4

    MD5 is carried when an object is uploaded.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    PUT /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:17:50 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    -Content-Length: 10
    -Content-MD5: 6Afx/PgtEy+bsBjKZzihnw==
    -Expect: 100-continue
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    PUT /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:17:50 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    +Content-Length: 10
    +Content-MD5: 6Afx/PgtEy+bsBjKZzihnw==
    +Expect: 100-continue
     
     1234567890
    -
    -
    -
    -

    Sample Response 4

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BB7800000164B165971F91D82217D105
    -X-OBS-ID-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSEKhBpS4BB3dSMNqMtuNxQDD9XvOw5h
    -ETag: "1072e1b96b47d7ec859710068aa70d57"
    -Date: WED, 01 Jul 2015 04:17:50 GMT
    -Content-Length: 0
    -
    -
    -
    -

    Sample Request 5

    The website hosting function is configured for the bucket. Configure redirection for the object download when uploading the object.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    PUT /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:17:12 GMT
    -x-obs-website-redirect-location: http://www.example.com/
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    -Content-Length: 10240
    -Expect: 100-continue
    +
    + +
    +
    +

    Sample Response 4

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BB7800000164B165971F91D82217D105
    +X-OBS-ID-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSEKhBpS4BB3dSMNqMtuNxQDD9XvOw5h
    +ETag: "1072e1b96b47d7ec859710068aa70d57"
    +Date: WED, 01 Jul 2015 04:17:50 GMT
    +Content-Length: 0
    +
    + +
    +
    +

    Sample Request 5

    If static website hosting has been configured for a bucket, you can configure parameters as follows when you upload an object. Then, users will be redirected when they download the object.

    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    PUT /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:17:12 GMT
    +x-obs-website-redirect-location: http://www.example.com/
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    +Content-Length: 10240
    +Expect: 100-continue
    +
    +[1024 Byte data content]
    +
    + +
    +
    +

    Sample Response 5

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z
    +ETag: "1072e1b96b47d7ec859710068aa70d57"
    +Date: WED, 01 Jul 2015 04:17:12 GMT
    +x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
    +Content-Length: 0
    +
    -[1024 Byte data content] -
    -
    -

    Sample Response 5

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z
    -ETag: "1072e1b96b47d7ec859710068aa70d57"
    -Date: WED, 01 Jul 2015 04:17:12 GMT
    -x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
    -Content-Length: 0
    -
    -

    Sample Request 6

    Upload an object and carry the signature in the URL.

    PUT /object02?AccessKeyId=H4IPJX0TQTHTHEBQQCEC&Expires=1532688887&Signature=EQmDuOhaLUrzrzRNZxwS72CXeXM%3D HTTP/1.1
    @@ -500,64 +512,67 @@ Content-Length: 1024
     
     [1024 Byte data content]
    -

    Sample Response 6

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z
    -ETag: "1072e1b96b47d7ec859710068aa70d57"
    -Date: Fri, 27 Jul 2018 10:52:31 GMT
    -x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
    -Content-Length: 0
    -
    -
    +

    Sample Response 6

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: DCD2FC9CAB78000001439A51DB2B2577
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTmxB5ufMj/7/GzP8TFwTbp33u0xhn2Z
    +ETag: "1072e1b96b47d7ec859710068aa70d57"
    +Date: Fri, 27 Jul 2018 10:52:31 GMT
    +x-obs-version-id: AAABQ4q2M9_c0vycq3gAAAAAVURTRkha
    +Content-Length: 0
    +
    + +

    Sample Request 7

    Upload an object of a specified storage class.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    PUT /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:15:07 GMT
    -x-obs-storage-class: WARM
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    -Content-Length: 10240
    -Expect: 100-continue
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    PUT /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:15:07 GMT
    +x-obs-storage-class: WARM
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:uFVJhp/dJqj/CJIVLrSZ0gpw3ng=
    +Content-Length: 10240
    +Expect: 100-continue
    +
    +[1024 Byte data content]
    +
    + +
    +
    +

    Sample Response 7

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BB7800000164846A2112F98BF970AA7E
    +ETag: "d41d8cd98f00b204e9800998ecf8427e"
    +x-obs-id-2: a39E0UgAIAABAAAQAAEAABAAAQAAEAABCTPOUJu5XlNyU32fvKjM/92MQZK2gtoB
    +Date: WED, 01 Jul 2015 04:15:07 GMT
    +Content-Length: 0
    +
    -[1024 Byte data content] -
    -
    -

    Sample Response 7

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BB7800000164846A2112F98BF970AA7E
    -ETag: "d41d8cd98f00b204e9800998ecf8427e"
    -x-obs-id-2: a39E0UgAIAABAAAQAAEAABAAAQAAEAABCTPOUJu5XlNyU32fvKjM/92MQZK2gtoB
    -Date: WED, 01 Jul 2015 04:15:07 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0081.html b/docs/obs/api-ref/obs_04_0081.html index 883fb7a9d..81903fc85 100644 --- a/docs/obs/api-ref/obs_04_0081.html +++ b/docs/obs/api-ref/obs_04_0081.html @@ -1,7 +1,7 @@

    Uploading Objects - POST

    -

    Functions

    Uploading an object adds it to a bucket. This requires users to have the write operation.

    +

    Functions

    This operation uploads an object to a bucket. To use this operation, you must have the write permission 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 form field. 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 value of the x-obs-acl parameter to configure an access control policy for the object.

    @@ -17,119 +17,120 @@

    Versioning

    If versioning is enabled for a bucket, the system automatically generates a unique version ID for the requested object in this bucket and returns the version ID in response header x-obs-version-id. If versioning is suspended for a bucket, the version ID of the requested object in this bucket is null. For details about the versioning statuses of a bucket, see Configuring Versioning for a Bucket.

    -

    Request Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    POST / HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -User-Agent: browser_data
    -Accept: file_types
    -Accept-Language: Regions
    -Accept-Encoding: encoding
    -Accept-Charset: character_set
    -Keep-Alive: 300 
    -Connection: keep-alive 
    -Content-Type: multipart/form-data; boundary=9431149156168 
    -Content-Length: length
    +

    Request Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    POST / HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +User-Agent: browser_data
    +Accept: file_types
    +Accept-Language: Regions
    +Accept-Encoding: encoding
    +Accept-Charset: character_set
    +Keep-Alive: 300 
    +Connection: keep-alive 
    +Content-Type: multipart/form-data; boundary=9431149156168 
    +Content-Length: length
     
     
    ---9431149156168 
    -Content-Disposition: form-data; name="key" 
    +--9431149156168 
    +Content-Disposition: form-data; name="key" 
     
    -acl 
    ---9431149156168 
    -Content-Disposition: form-data; name="success_action_redirect"
    - 
    -success_redirect 
    ---9431149156168 
    -Content-Disposition: form-data; name="content-Type" 
    +acl 
    +--9431149156168 
    +Content-Disposition: form-data; name="success_action_redirect"
    + 
    +success_redirect 
    +--9431149156168 
    +Content-Disposition: form-data; name="content-Type" 
     
    -content_type 
    ---9431149156168 
    -Content-Disposition: form-data; name="x-obs-meta-uuid" 
    +content_type 
    +--9431149156168 
    +Content-Disposition: form-data; name="x-obs-meta-uuid" 
     
    -uuid 
    ---9431149156168 
    -Content-Disposition: form-data; name="x-obs-meta-tag" 
    +uuid 
    +--9431149156168 
    +Content-Disposition: form-data; name="x-obs-meta-tag" 
     
    -metadata 
    ---9431149156168 
    -Content-Disposition: form-data; name="AccessKeyId" 
    +metadata 
    +--9431149156168 
    +Content-Disposition: form-data; name="AccessKeyId" 
     
    -access-key-id 
    ---9431149156168 
    -Content-Disposition: form-data; name="policy" 
    +access-key-id 
    +--9431149156168 
    +Content-Disposition: form-data; name="policy" 
     
    -encoded_policy 
    ---9431149156168 
    -Content-Disposition: form-data; name="signature" 
    +encoded_policy 
    +--9431149156168 
    +Content-Disposition: form-data; name="signature" 
     
    -signature= 
    ---9431149156168 
    -Content-Disposition: form-data; name="file"; filename="MyFilename" 
    -Content-Type: image/jpeg 
    +signature= 
    +--9431149156168 
    +Content-Disposition: form-data; name="file"; filename="MyFilename" 
    +Content-Type: image/jpeg 
     
    -file_content 
    ---9431149156168 
    -Content-Disposition: form-data; name="submit" 
    +file_content 
    +--9431149156168 
    +Content-Disposition: form-data; name="submit" 
     
    -Upload to OBS 
    +Upload to OBS 
     --9431149156168--
    -
    -
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no parameters.

    Request Headers

    This request uses common headers. For details, see Table 3.

    If you want to get CORS configuration information, you must use the headers in Table 1.

    @@ -285,7 +286,7 @@ Upload to OBS

    When creating an object, you can use this header to specify the storage class for the object. If you do not use this header, the object storage class is the default storage class of the bucket.

    Type: string

    -

    Note: There are three storage classes: STANDARD (Standard storage class), WARM (Warm storage class), and COLD (Cold storage class). Therefore, this parameter value can be STANDARD, WARM, or COLD. These values are case sensitive.

    +

    Storage class value options: STANDARD (Standard), WARM (Warm), COLD (Cold). These values are case sensitive.

    An example is provided as follows:

    In POLICY: {"storage-class": "STANDARD" },

    In HTML: <input type="text" name="x-obs-storage-class" value="STANDARD" />

    @@ -312,7 +313,7 @@ Upload to OBS

    Indicates the address (URL) to which a successfully responded request is redirected.

    • If the value is valid and the request is successful, OBS returns status code 303. Location contains success_action_redirect as well as the bucket name, object name, and object ETag.
    • If this parameter is invalid, OBS ignores this parameter. The response code is 204, and the Location is the object address.
    -

    Type: string.

    +

    Type: string

    An example is provided as follows:

    In POLICY: {"success_action_redirect": "http://123458.com"},

    In HTML: <input type="text" name="success_action_redirect" value="http://123458.com" />

    @@ -356,7 +357,7 @@ Upload to OBS

    Indicates that SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    No. This header is required when SSE-KMS is used.

    @@ -368,7 +369,7 @@ Upload to OBS

    The following two formats are supported:

    1. regionID:domainID:key/key_id

    2. key_id

    -

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    +

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    Example:

    1. x-obs-server-side-encryption-kms-key-id: region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    2. x-obs-server-side-encryption-kms-key-id:4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    @@ -380,7 +381,7 @@ Upload to OBS

    Encryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -390,7 +391,7 @@ Upload to OBS

    A key used to encrypt objects. The header is used in SSE-C mode. This key is used to encrypt objects.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -400,7 +401,7 @@ Upload to OBS

    Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used.

    @@ -410,7 +411,7 @@ Upload to OBS

    Indicates the expiration time of an object, in days. An object will be automatically deleted once it expires (calculated from the last modification time of the object).

    Type: integer

    -

    Example: x-obs-expires:3

    +

    Example: x-obs-expires:3

    No

    @@ -419,17 +420,18 @@ Upload to OBS
    -

    Response Syntax

    1
    -2
    -3
    -4
    -5
    HTTP/1.1 status_code
    -Content-Type: application/xml 
    -Location: location
    -Date: date
    -ETag: etag
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 status_code
    +Content-Type: application/xml 
    +Location: location
    +Date: date
    +ETag: etag
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 3.

    @@ -481,7 +483,7 @@ ETag: etag

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -490,21 +492,21 @@ ETag: etag

    Type: string

    Format: regionID:domainID:key/key_id

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID used in this encryption.

    -

    Example: x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    +

    Example: x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    x-obs-server-side-encryption-customer-algorithm

    Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    @@ -516,280 +518,349 @@ ETag: etag

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    Sample Request 1

    Common POST upload

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    POST / HTTP/1.1
    -Date: WED, 01 Jul 2015 04:15:23 GMT
    -Host: examplebucket.obs.region.example.com
    -Content-Type: multipart/form-data; boundary=7db143f50da2
    -Content-Length: 2424
    -Origin: www.example.com
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    POST / HTTP/1.1
    +Date: WED, 01 Jul 2015 04:15:23 GMT
    +Host: examplebucket.obs.region.example.com
    +Content-Type: multipart/form-data; boundary=7db143f50da2
    +Content-Length: 2424
    +Origin: www.example.com
     Access-Control-Request-Headers:acc_header_1
     
     --7db143f50da2
    -Content-Disposition: form-data; name="key"
    +Content-Disposition: form-data; name="key"
     
     object01
     --7db143f50da2
    -Content-Disposition: form-data; name="acl"
    +Content-Disposition: form-data; name="acl"
     
     public-read
    ---7db143f50da2 
    -Content-Disposition: form-data; name="content-type"
    +--7db143f50da2 
    +Content-Disposition: form-data; name="content-type"
     
     text/plain
     --7db143f50da2
    -Content-Disposition: form-data; name="expires"
    +Content-Disposition: form-data; name="expires"
     
    -WED, 01 Jul 2015 04:16:15 GMT
    +WED, 01 Jul 2015 04:16:15 GMT
     --7db143f50da2
    -Content-Disposition: form-data; name="AccessKeyId"
    +Content-Disposition: form-data; name="AccessKeyId"
     
     14RZT432N80TGDF2Y2G2
     --7db143f50da2
    -Content-Disposition: form-data; name="policy"
    +Content-Disposition: form-data; name="policy"
     
     ew0KICAiZXhaaXJhdGlvbiI6ICIyMDE1LTA3LTAxVDEyOjAwOjAwLjAwMFoiLA0KICAiY29uZGl0aW9ucyI6IFsNCiAgICB7ImJ1Y2tldCI6ICJleG1hcGxlYnVja2V0IiB9LA0KICAgIHsiYWNsIjogInB1YmxpYy1yZWFkIiB9LA0KICAgIHsiRXhaaXJlcyI6ICIxMDAwIiB9LA0KICAgIFsiZXEiLCAiJGtleSIsICJvYmplY3QwMSJdLA0KICAgIFsic3RhcnRzLXdpdGgiLCAiJENvbnRlbnQtVHlwZSIsICJ0ZXh0LyJdLA0KICBdDQp9DQo=
     --7db143f50da2
    -Content-Disposition: form-data; name="signature"
    +Content-Disposition: form-data; name="signature"
     
     Vk6rwO0Nq09BLhvNSIYwSJTRQ+k=
     --7db143f50da2
    -Content-Disposition: form-data; name="file"; filename="C:\Testtools\UpLoadFiles\object\1024Bytes.txt"
    -Content-Type: text/plain
    +Content-Disposition: form-data; name="file"; filename="C:\Testtools\UpLoadFiles\object\1024Bytes.txt"
    +Content-Type: text/plain
     
     01234567890
     --7db143f50da2
    -Content-Disposition: form-data; name="submit"
    +Content-Disposition: form-data; name="submit"
     
     Upload
     --7db143f50da2--
    -
    -
    +
    + +

    Sample Response 1

    After CORS is configured for a bucket, the response contains the Access-Control-* information.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    HTTP/1.1 204 No Content
    -x-obs-request-id: 90E2BA00C26C00000133B442A90063FD
    -x-obs-id-2: OTBFMkJBMDBDMjZDMDAwMDAxMzNCNDQyQTkwMDYzRkRBQUFBQUFBQWJiYmJiYmJi
    -Access-Control-Allow-Origin: www.example.com
    -Access-Control-Allow-Methods: POST,GET,HEAD,PUT
    -Access-Control-Allow-Headers: acc_header_01
    -Access-Control-Max-Age: 100
    -Access-Control-Expose-Headers: exp_header_01
    -Content-Type: text/xml
    -Location: http://examplebucket.obs.region.example.com/object01
    -Date: WED, 01 Jul 2015 04:15:23 GMT
    -ETag: "ab7abb0da4bca5323ab6119bb5dcd296"
    -
    -
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    HTTP/1.1 204 No Content
    +x-obs-request-id: 90E2BA00C26C00000133B442A90063FD
    +x-obs-id-2: OTBFMkJBMDBDMjZDMDAwMDAxMzNCNDQyQTkwMDYzRkRBQUFBQUFBQWJiYmJiYmJi
    +Access-Control-Allow-Origin: www.example.com
    +Access-Control-Allow-Methods: POST,GET,HEAD,PUT
    +Access-Control-Allow-Headers: acc_header_01
    +Access-Control-Max-Age: 100
    +Access-Control-Expose-Headers: exp_header_01
    +Content-Type: text/xml
    +Location: http://examplebucket.obs.region.example.com/object01
    +Date: WED, 01 Jul 2015 04:15:23 GMT
    +ETag: "ab7abb0da4bca5323ab6119bb5dcd296"
    +
    + +

    Sample Request 2

    Upload an object with the x-obs-acl, storage class, and redirection header fields carried in the request message.

    Before encoding, the policy content is as follows:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    {
    -    "expiration":"2018-07-17T04:54:35Z",
    -    "conditions":[
    -        {
    -            "content-type":"text/plain"
    -        },
    -        {
    -            "x-obs-storage-class":"WARM"
    -        },
    -        {
    -            "success_action_redirect":"http://www.example.com"
    -        },
    -        {
    -            "x-obs-acl":"public-read"
    -        },
    -        [
    -            "starts-with",
    -            "$bucket",
    -            ""
    -        ],
    -        [
    -            "starts-with",
    -            "$key",
    -            ""
    -        ]
    -    ]
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    {
    +    "expiration":"2018-07-17T04:54:35Z",
    +    "conditions":[
    +        {
    +            "content-type":"text/plain"
    +        },
    +        {
    +            "x-obs-storage-class":"WARM"
    +        },
    +        {
    +            "success_action_redirect":"http://www.example.com"
    +        },
    +        {
    +            "x-obs-acl":"public-read"
    +        },
    +        [
    +            "starts-with",
    +            "$bucket",
    +            ""
    +        ],
    +        [
    +            "starts-with",
    +            "$key",
    +            ""
    +        ]
    +    ]
     }
    -
    -
    +
    + +

    Sample request:

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    POST / HTTP/1.1
    -Host: examplebucket.obs.region.example.com
    -Accept-Encoding: identity
    -Content-Length: 947
    -Content-Type: multipart/form-data; boundary=9431149156168
    -User-Agent: OBS/Test
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    POST / HTTP/1.1
    +Host: examplebucket.obs.region.example.com
    +Accept-Encoding: identity
    +Content-Length: 947
    +Content-Type: multipart/form-data; boundary=9431149156168
    +User-Agent: OBS/Test
     
     --9431149156168
    -Content-Disposition: form-data; name="x-obs-acl"
    +Content-Disposition: form-data; name="x-obs-acl"
     
     public-read
     --9431149156168
    -Content-Disposition: form-data; name="AccessKeyId"
    +Content-Disposition: form-data; name="AccessKeyId"
     
     H4IPJX0TQTHTHEBQQCEC
     --9431149156168
    -Content-Disposition: form-data; name="key"
    +Content-Disposition: form-data; name="key"
     
     my-obs-object-key-demo
     --9431149156168
    -Content-Disposition: form-data; name="signature"
    +Content-Disposition: form-data; name="signature"
     
     WNwv8P1ZiWdqPQqjXeLmAfzPDAI=
     --9431149156168
    -Content-Disposition: form-data; name="policy"
    +Content-Disposition: form-data; name="policy"
     
     eyJleHBpcmF0aW9uIjoiMjAxOC0wNy0xN1QwODozNDoyM1oiLCAiY29uZGl0aW9ucyI6W3siY29udGVudC10eXBlIjoidGV4dC9wbGFpbiJ9LHsieC1vYnMtYWNsIjoicHVibGljLXJlYWQifSxbInN0YXJ0cy13aXRoIiwgIiRidWNrZXQiLCAiIl0sWyJzdGFydHMtd2l0aCIsICIka2V5IiwgIiJdXX0=
     --9431149156168
    -Content-Disposition: form-data; name="content-type"
    +Content-Disposition: form-data; name="content-type"
     
     text/plain
     --9431149156168
    -Content-Disposition: form-data; name="file"; filename="myfile"
    -Content-Type: text/plain
    +Content-Disposition: form-data; name="file"; filename="myfile"
    +Content-Type: text/plain
     
     c2c6cd0f-898e-11e8-aab6-e567c91fb541
     52b8e8a0-8481-4696-96f3-910635215a78
     
     --9431149156168--
    -
    -
    +
    + +
    +
    +

    Sample Response 2

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 204 No Content
    +Server: OBS
    +Location: http://examplebucket.obs.region.example.com/my-obs-object-key-demo
    +ETag: "17a83fc8d431273405bd266114b7e034"
    +x-obs-request-id: 5DEB00000164A728A7C7F4E032214CFA
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSwj2PcBE0YcoLHUDO7GSj+rVByzjflA
    +Date: Tue, 17 Jul 2018 07:33:36 GMT
    +
    + +
    +
    +

    Sample Request 3

    Use a token for authentication.

    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    POST / HTTP/1.1
    +Content-Type:multipart/form-data; boundary=9431149156168
    +Content-Length: 634
    +Host: examplebucket.obs.region.example.com
    + 
    +--9431149156168
    +Content-Disposition: form-data; name="key"
    +obj01
    + 
    +--9431149156168
    +Content-Disposition: form-data; name="token"
    +UDSIAMSTUBTEST002538:XsVcTzR2/A284oE4VH9qPndGcuE=:eyJjb25kaXRpb25zIjogW3siYnVja2V0IjogInRlc3QzMDAzMDU4NzE2NjI2ODkzNjcuMTIifSwgeyJDb250ZW50LVR5cGUiOiAiYXBwbGljYXRpb24veG1sIn0sIFsiZXEiLCAiJGtleSIsICJvYmoudHh0Il1dLCAiZXhwaXJhdGlvbiI6ICIyMDIyLTA5LTA5VDEyOjA5OjI3WiJ9
    + 
    +--9431149156168
    +Content-Disposition: form-data; name="file"; filename="myfile"
    +Content-Type: text/plain
    +01234567890
    + 
    +--9431149156168--
    +Content-Disposition: form-data; name="submit"
    +Upload to OBS
    +
    + +
    +
    +

    Sample Response 3

    The response to the authentication using a token

    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 204 No Content
    +Server: OBS
    +Location: http://examplebucket.obs.region.example.com/my-obs-object-key-demo
    +ETag: "7eda50a430fed940023acb9c4c6a2fff"
    +x-obs-request-id: 000001832010443D80F30B649B969C47
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCTj0yO9KJd5In+i9pzTgCDVG9vMnk7O/
    +Date: Fri,09Sep 2022 02: 24:40 GMT
    +
    +
    -

    Sample Response 2

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 204 No Content
    -Server: OBS
    -Location: http://examplebucket.obs.region.example.com/my-obs-object-key-demo
    -ETag: "17a83fc8d431273405bd266114b7e034"
    -x-obs-request-id: 5DEB00000164A728A7C7F4E032214CFA
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCSwj2PcBE0YcoLHUDO7GSj+rVByzjflA
    -Date: Tue, 17 Jul 2018 07:33:36 GMT
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0082.html b/docs/obs/api-ref/obs_04_0082.html index d86bf24c9..823ab9c77 100644 --- a/docs/obs/api-ref/obs_04_0082.html +++ b/docs/obs/api-ref/obs_04_0082.html @@ -5,7 +5,7 @@

    Users can determine whether to copy the metadata of the source object to the target object (by default) or replace the metadata of the target object with the metadata contained in the request. The ACL of the source object is not copied to the target object. By default, the ACL of the target object is private. You can set an ACL for the target object by sending an API request.

    The request for copying an object needs to carry the information about the bucket and object to be copied in the header field. The message body cannot be carried.

    This operation supports server-side encryption.

    -

    The target object size range is [0, 5 GB]. If the source object size exceeds 5 GB, you can only copy some objects using the Range API.

    +

    An object copy can be up to 5 GB in size. If the source object size exceeds 5 GB, you can only copy part of the object.

    Versioning

    By default, x-obs-copy-source specifies the latest version of the source object. If the latest version of the source object has a deletion marker, the object is considered to have been deleted. You can add versionId to request header x-obs-copy-source to copy an object with the specified version ID.

    If a bucket has versioning enabled, the system automatically generates a unique version ID for the requested object in this bucket and returns the version ID in response header x-obs-version-id. If versioning is suspended for the bucket, the object version ID is null.

    @@ -13,33 +13,34 @@

    You cannot determine whether a request is executed successfully only using status_code in the header returned by HTTP. If 200 in status_code is returned, the server has received the request and starts to process the request. The body in the response shows whether the copy succeeds. If the body contains ETag, the copy succeeds. Otherwise, the copy failed.

    -

    OBS Cold Objects

    If source objects are OBS Cold objects, check the restore status of the objects. You can copy these objects only after they are restored. If the source object is not retrieved or is being retrieved, the copying fails and error 403 Forbidden is returned. The fault is described as follows:

    +

    Cold Objects

    If source objects are in the Cold 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 fault is described as follows:

    ErrorCode: InvalidObjectState

    ErrorMessage: Operation is not valid for the source object's storage class

    -

    Request Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    PUT /destinationObjectName HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -x-obs-copy-source: /sourceBucket/sourceObject 
    -x-obs-metadata-directive: metadata_directive
    -x-obs-copy-source-if-match: etag
    -x-obs-copy-source-if-none-match: etag
    -x-obs-copy-source-if-unmodified-since: time_stamp
    -x-obs-copy-source-if-modified-since: time_stamp
    -Authorization: signature
    -Date: date
    -
    -
    +

    Request Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    PUT /destinationObjectName HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +x-obs-copy-source: /sourceBucket/sourceObject 
    +x-obs-metadata-directive: metadata_directive
    +x-obs-copy-source-if-match: etag
    +x-obs-copy-source-if-none-match: etag
    +x-obs-copy-source-if-unmodified-since: time_stamp
    +x-obs-copy-source-if-modified-since: time_stamp
    +Authorization: signature
    +Date: date
    +
    +
    -

    Request Parameters

    This request contains no parameter.

    +
    +

    Request Parameters

    This request contains no message parameters.

    Request Headers

    You can add optional headers to specify the object to be copied. Table 3 describes the optional headers.

    @@ -55,7 +56,7 @@ Date: date

    This header can be added to set access control policies for objects when copying the objects. The access control policies are the predefined common policies, including private, public-read, public-read-write.

    Type: string

    -

    Example: x-obs-acl: acl

    +

    Example: x-obs-acl: acl

    No

    @@ -97,7 +98,7 @@ Date: date

    Indicates names of the source bucket and the source object. If the source object has multiple versions, the versionId parameter can be used to specify the desired version.

    Type: string

    Constraint: URL encoding is required for handling Chinese characters.

    -

    Example: x-obs-copy-source: /source_bucket/sourceObject

    +

    Example: x-obs-copy-source: /source_bucket/sourceObject

    Yes

    @@ -108,7 +109,7 @@ Date: date

    Type: string

    Valid values: COPY and REPLACE

    Default value: COPY

    -

    Example: x-obs-metadata-directive: metadata_directive

    +

    Example: x-obs-metadata-directive: metadata_directive

    Constraints: Values other than COPY or REPLACE result in an immediate 400-based error response. If you need to modify the metadata (the same for both the source and target objects), this parameter must be set to REPLACE, otherwise, the request is invalid and the server returns a 400 HTTP status code error. This parameter cannot be used to change an encrypted object to a non-encrypted object (the same for both the source and target objects). If you use this parameter to change the encrypted object, the system returns 400.

    No

    @@ -118,7 +119,7 @@ Date: date

    Copies the source object only if its ETag matches the one specified by this header. Otherwise, a 412 HTTP status code error (failed precondition) is returned.

    Type: string

    -

    Example: x-obs-copy-source-if-match: etag

    +

    Example: x-obs-copy-source-if-match: etag

    Constraint: This parameter can be used with x-obs-copy-source-if-unmodified-since but not other conditional copy parameters.

    No

    @@ -128,17 +129,17 @@ Date: date

    Copies the object only if its ETag does not match the one specified in this header. Otherwise, a 412 HTTP status code error (failed precondition) is returned.

    Type: string

    -

    Example: x-obs-copy-source-if-none-match: etag

    +

    Example: x-obs-copy-source-if-none-match: etag

    Constraint: This parameter can be used with x-obs-copy-source-if-modified-since but not other conditional copy parameters.

    No

    -

    x-obs-copy-source-if-unmodified- since

    +

    x-obs-copy-source-if-unmodified-since

    Copies the source object only if it has not been modified since the time specified by this header. Otherwise, a 412 HTTP status code error (failed precondition) is returned. This header can be used with x-obs-copy-source-if-match, but cannot be used with other conditional copy headers.

    Type: HTTP time character string complying with the format specified at http://www.ietf.org/rfc/rfc2616.txt

    -

    Example: x-obs-copy-source-if-unmodified -since: time-stamp

    +

    Example: x-obs-copy-source-if-unmodified-since: time-stamp

    No

    @@ -147,7 +148,7 @@ Date: date

    Copies the source object only if it has not been modified since the time specified by this header. Otherwise, a 412 HTTP status code error (failed precondition) is returned. This header can be used with x-obs-copy-source-if-none-match, but cannot be used with other conditional copy headers

    Type: HTTP time character string complying with the format specified at http://www.ietf.org/rfc/rfc2616.txt

    -

    Example: x-obs-copy-source-if-modified-since: time-stamp

    +

    Example: x-obs-copy-source-if-modified-since: time-stamp

    No

    @@ -156,8 +157,8 @@ Date: date

    When copying an object, you can use this header to specify the storage class for the object. If you do not use this header, the object storage class is the default storage class of the destination bucket where the object is copied to.

    Type: string

    -

    Note: There are three storage classes: STANDARD (Standard storage class), WARM (Warm storage class), and COLD (Cold storage class). Therefore, this parameter value can be STANDARD, WARM, or COLD. These values are case sensitive.

    -

    Example: x-obs-storage-class: STANDARD

    +

    Storage class value options: STANDARD (Standard), WARM (Warm), COLD (Cold). These values are case sensitive.

    +

    Example: x-obs-storage-class: STANDARD

    No

    @@ -176,7 +177,7 @@ Date: date

    Indicates that SSE-KMS is used. Objects are encrypted using SSE-KMS.

    Type: string

    -

    Example: x-obs-server-side-encryption: kms

    +

    Example: x-obs-server-side-encryption: kms

    No. This header is required when SSE-KMS is used.

    @@ -188,7 +189,7 @@ Date: date

    The following two formats are supported:

    1. regionID:domainID:key/key_id

    2. key_id

    -

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    +

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    Example:

    1. x-obs-server-side-encryption-kms-key-id: region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    2. x-obs-server-side-encryption-kms-key-id: 4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    @@ -200,7 +201,7 @@ Date: date

    Encryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -210,7 +211,7 @@ Date: date

    Indicates the key used to encrypt an object. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -220,7 +221,7 @@ Date: date

    Indicates the MD5 value of a key used to encrypt a destination object. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used.

    @@ -240,7 +241,7 @@ Date: date

    Indicates the key used to decrypt a source object. The header is used in SSE-C mode. SSE-C mode.

    Type: string

    -

    Example: x-obs-copy-source-server-side-encryption-customer-key: K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-copy-source-server-side-encryption-customer-key: K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-copy-source-server-side-encryption-customer-algorithm and x-obs-copy-source-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used to copy a source object.

    @@ -250,7 +251,7 @@ Date: date

    Indicates the MD5 value of the key used to decrypt a source object. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-copy-source-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-copy-source-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-copy-source-server-side-encryption-customer-algorithm and x-obs-copy-source-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used to copy a source object.

    @@ -272,27 +273,28 @@ Date: date

    Request Elements

    This request contains no elements.

    -

    Response Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    HTTP/1.1 status_code
    -Content-Type: application/xml 
    -Date: date
    -Content-Length: length
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    HTTP/1.1 status_code
    +Content-Type: application/xml 
    +Date: date
    +Content-Length: length
     
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<CopyObjectResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -    <LastModified>modifiedDate</LastModified> 
    -    <ETag>etagValue</ETag> 
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<CopyObjectResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +    <LastModified>modifiedDate</LastModified> 
    +    <ETag>etagValue</ETag> 
     </CopyObjectResult>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 2.

    @@ -319,7 +321,7 @@ Content-Length: length

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption: kms

    +

    Example: x-obs-server-side-encryption: kms

    x-obs-server-side-encryption-kms-key-id

    @@ -335,19 +337,19 @@ Content-Length: length

    Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    x-obs-storage-class

    -

    This header is returned when the storage class of an object is not Standard. The value can be WARM or COLD.

    +

    This header is returned when the storage class of an object is not Standard. The value can be WARM or COLD.

    Type: string

    @@ -388,96 +390,100 @@ Content-Length: length

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    Sample Request 1

    Copy the object srcobject in bucket bucket to the destobject object in bucket examplebucket.

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    PUT /destobject HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:19:21 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:2rZR+iaH8xUewvUKuicLhLHpNoU=
    -x-obs-copy-source: /bucket/srcobject
    -
    -
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    PUT /destobject HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:2rZR+iaH8xUewvUKuicLhLHpNoU=
    +x-obs-copy-source: /bucket/srcobject
    +
    +
    -

    Sample Response 1

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 001B21A61C6C00000134031BE8005293
    -x-obs-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMzFCRTgwMDUyOTNBQUFBQUFBQWJiYmJiYmJi
    -Date: WED, 01 Jul 2015 04:19:21 GMT
    -Content-Length: 249
    +
    +

    Sample Response 1

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 001B21A61C6C00000134031BE8005293
    +x-obs-id-2: MDAxQjIxQTYxQzZDMDAwMDAxMzQwMzFCRTgwMDUyOTNBQUFBQUFBQWJiYmJiYmJi
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Content-Length: 249
     
     <?xml version="1.0" encoding="utf-8"?>
    -<CopyObjectResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -  <LastModified>2015-07-01T00:48:07.706Z</LastModified>  
    -  <ETag>"507e3fff69b69bf57d303e807448560b"</ETag> 
    +<CopyObjectResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +  <LastModified>2015-07-01T00:48:07.706Z</LastModified>  
    +  <ETag>"507e3fff69b69bf57d303e807448560b"</ETag> 
     </CopyObjectResult>
    -
    -
    +
    + +

    Sample Request 2

    Copy a multi-version object and copy the object srcobject whose version number is AAABQ4uBLdLc0vycq3gAAAAEVURTRkha in bucket bucket to the destobject object in bucket examplebucket.

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    PUT /destobject HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:20:29 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:4BLYv+1UxfRSHBMvrhVLDszxvcY=
    -x-obs-copy-source: /bucket/srcobject?versionId=AAABQ4uBLdLc0vycq3gAAAAEVURTRkha
    -
    -
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    PUT /destobject HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:20:29 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:4BLYv+1UxfRSHBMvrhVLDszxvcY=
    +x-obs-copy-source: /bucket/srcobject?versionId=AAABQ4uBLdLc0vycq3gAAAAEVURTRkha
    +
    +
    -

    Sample Response 2

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: DCD2FC9CAB78000001438B8A9C898B79
    -x-obs-id-2: DB/qBZmbN6AIoX9mrrSNYdLxwvbO0tLR/l6/XKTT4NmZspzharwp5Z74ybAYVOgr
    -Content-Type: application/xml
    -x-obs-version-id: AAABQ4uKnOrc0vycq3gAAAAFVURTRkha
    -x-obs-copy-source-version-id: AAABQ4uBLdLc0vycq3gAAAAEVURTRkha
    -Date: WED, 01 Jul 2015 04:20:29 GMT
    -Transfer-Encoding: chunked
    +
    +

    Sample Response 2

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: DCD2FC9CAB78000001438B8A9C898B79
    +x-obs-id-2: DB/qBZmbN6AIoX9mrrSNYdLxwvbO0tLR/l6/XKTT4NmZspzharwp5Z74ybAYVOgr
    +Content-Type: application/xml
    +x-obs-version-id: AAABQ4uKnOrc0vycq3gAAAAFVURTRkha
    +x-obs-copy-source-version-id: AAABQ4uBLdLc0vycq3gAAAAEVURTRkha
    +Date: WED, 01 Jul 2015 04:20:29 GMT
    +Transfer-Encoding: chunked
     
     <?xml version="1.0" encoding="utf-8"?>
    -<CopyObjectResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -  <LastModified>2015-07-01T01:48:07.706Z</LastModified>  
    -  <ETag>"507e3fff69b69bf57d303e807448560b"</ETag> 
    +<CopyObjectResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +  <LastModified>2015-07-01T01:48:07.706Z</LastModified>  
    +  <ETag>"507e3fff69b69bf57d303e807448560b"</ETag> 
     </CopyObjectResult>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0083.html b/docs/obs/api-ref/obs_04_0083.html index 1dd7e7850..32cd20c38 100644 --- a/docs/obs/api-ref/obs_04_0083.html +++ b/docs/obs/api-ref/obs_04_0083.html @@ -7,21 +7,22 @@

    Versioning

    By default, the GET operation returns the current version of an object. If the current version of the object is a deletion marker, OBS returns a code meaning non-existence of the object. To obtain an object of a specified version, the versionId parameter can be used to specify the desired version.

    -

    OBS Cold Objects

    If the object to be downloaded is a Cold object, restore it before downloading it. The response varies with the retrieval status of the object. If the object has been restored, the x-obs-restore header is returned indicating the expiry date of the object when it is successfully downloaded. If you request downloading Cold objects that are not restored or are being restored, a 403 Forbidden error is returned.

    +

    Cold Objects

    If the object you want to download is in the Cold storage class, ensure that this object has been restored before you download it. The response varies depending on the object's restore state. If an object has been restored, the x-obs-restore header (indicating the expiry date of the object) is returned when the object is successfully downloaded. If you send a request to download Cold objects that are not restored or are being restored, a 403 Forbidden error will be returned.

    +
    +

    Request Syntax

    1
    +2
    +3
    +4
    +5
    +6
    GET /ObjectName HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +Range:bytes=byte_range 
    +<Optional Additional Header>
    +
    +
    -

    Request Syntax

    1
    -2
    -3
    -4
    -5
    -6
    GET /ObjectName HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -Range:bytes=byte_range 
    -<Optional Additional Header>
    -
    -

    The field is optional. If it does not exist, you can obtain the whole content.

    @@ -99,7 +100,7 @@ Range:bytes=byte_range

    attname

    -

    Rewrites the Content-Disposition header in the response.

    +

    Rewrites the Content-Disposition header in the response.

    Type: string

    Example:

    attname=name1

    @@ -156,7 +157,7 @@ Range:bytes=byte_range

    Returns the object only if its ETag is the same as the one specified by this header. Otherwise, 412 Precondition Failed is returned.

    Type: string

    -

    (Example: 0f64741bf7cb1089e988e4585d0d3434)

    +

    Example: 0f64741bf7cb1089e988e4585d0d3434

    No

    @@ -165,7 +166,7 @@ Range:bytes=byte_range

    Returns the object only if its ETag is different from the one specified by this header. Otherwise, 304 Not Modified is returned.

    Type: string

    -

    (Example: 0f64741bf7cb1089e988e4585d0d3434)

    +

    Example: 0f64741bf7cb1089e988e4585d0d3434

    No

    @@ -174,7 +175,7 @@ Range:bytes=byte_range

    Indicates an encryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -184,7 +185,7 @@ Range:bytes=byte_range

    Indicates a key used to encrypt objects. The header is used in SSE-C mode. This key is used to decrypt objects.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -194,7 +195,7 @@ Range:bytes=byte_range

    Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used.

    @@ -206,23 +207,24 @@ Range:bytes=byte_range

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    HTTP/1.1 status_code 
    -Content-Type: type 
    -Date: date 
    -Content-Length: length 
    -Etag: etag 
    -Last-Modified: time 
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    HTTP/1.1 status_code 
    +Content-Type: type 
    +Date: date 
    +Content-Length: length 
    +Etag: etag 
    +Last-Modified: time 
     
    -<Object Content>
    -
    -
    +<Object Content> +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 3.

    @@ -264,7 +266,7 @@ Last-Modified: time

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -280,14 +282,14 @@ Last-Modified: time

    Indicates a decryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to decrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    x-obs-object-type

    @@ -311,226 +313,235 @@ Last-Modified: time

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    Sample Request 1

    Download the entire object.

    -
    1
    -2
    -3
    -4
    -5
    -6
    GET /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:24:33 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    -
    -
    -
    -

    Sample Response 1

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3F2A89604C49ABEE55E
    -Accept-Ranges: bytes
    -ETag: "3b46eaf02d3b6b1206078bb86a7b7013"
    -Last-Modified: WED, 01 Jul 2015 01:20:29 GMT
    -Content-Type: binary/octet-stream
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSQwxJ2I1VvxD/Xgwuw2G2RQax30gdXU
    -Date: WED, 01 Jul 2015 04:24:33 GMT
    -Content-Length: 4572
    +
    1
    +2
    +3
    +4
    +5
    +6
    GET /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:24:33 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +
    -[4572 Bytes object content] -
    -
    +
    +
    +

    Sample Response 1

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F2A89604C49ABEE55E
    +Accept-Ranges: bytes
    +ETag: "3b46eaf02d3b6b1206078bb86a7b7013"
    +Last-Modified: WED, 01 Jul 2015 01:20:29 GMT
    +Content-Type: binary/octet-stream
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSQwxJ2I1VvxD/Xgwuw2G2RQax30gdXU
    +Date: WED, 01 Jul 2015 04:24:33 GMT
    +Content-Length: 4572
    +
    +[4572 Bytes object content]
    +
    + +

    Sample Request 2

    Download the specified range of an object (download a range of an object).

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    GET /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: Mon, 14 Sep 2020 09:59:04 GMT
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    GET /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: Mon, 14 Sep 2020 09:59:04 GMT
     Range:bytes=20-30
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mNPLWQMDWg30PTkAWiqJaLl3ALg=
    -
    -
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mNPLWQMDWg30PTkAWiqJaLl3ALg= +
    + +

    Download the specified range of an object (download multiple ranges of an object).

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    GET /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: Mon, 14 Sep 2020 10:02:43 GMT
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    GET /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: Mon, 14 Sep 2020 10:02:43 GMT
     Range:bytes=20-30,40-50
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:ZwM7Vk2d7sD9o8zRsRKehgKQDkk=
    -
    -
    -

    Sample Response 2

    Download the specified range of an object (download a range of an object).

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    HTTP/1.1 206 Partial Content
    -Server: OBS
    -x-obs-request-id: 000001748C0DBC35802E360C9E869F31
    -Accept-Ranges: bytes
    -ETag: "2200446c2082f27ed2a569601ca4e360"
    -Last-Modified: Mon, 14 Sep 2020 01:16:20 GMT
    -Content-Range: bytes 20-30/4583
    -Content-Type: binary/octet-stream
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSn2JHu4okx9NBRNZAvBGawa3lt3g31g
    -Date: Mon, 14 Sep 2020 09:59:04 GMT
    -Content-Length: 11
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:ZwM7Vk2d7sD9o8zRsRKehgKQDkk=
    +
    -[ 11 Bytes object content] -
    -
    +
    +

    Sample Response 2

    Download the specified range of an object (download a range of an object).

    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    HTTP/1.1 206 Partial Content
    +Server: OBS
    +x-obs-request-id: 000001748C0DBC35802E360C9E869F31
    +Accept-Ranges: bytes
    +ETag: "2200446c2082f27ed2a569601ca4e360"
    +Last-Modified: Mon, 14 Sep 2020 01:16:20 GMT
    +Content-Range: bytes 20-30/4583
    +Content-Type: binary/octet-stream
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSn2JHu4okx9NBRNZAvBGawa3lt3g31g
    +Date: Mon, 14 Sep 2020 09:59:04 GMT
    +Content-Length: 11
    +
    +[ 11 Bytes object content]
    +
    + +

    Download the specified range of an object (download multiple ranges of an object).

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    HTTP/1.1 206 Partial Content
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3F2A89604C49ABEE55E
    -Accept-Ranges: bytes
    -ETag: "2200446c2082f27ed2a569601ca4e360"
    -Last-Modified: Mon, 14 Sep 2020 01:16:20 GMT
    -Content-Type: multipart/byteranges;boundary=35bcf444-e65f-4c76-9430-7e4a68dd3d26
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSIBWFOVW8eeWujkqSnoIANC2mNR1cdF
    -Date: Mon, 14 Sep 2020 10:02:43 GMT
    -Content-Length: 288
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    HTTP/1.1 206 Partial Content
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F2A89604C49ABEE55E
    +Accept-Ranges: bytes
    +ETag: "2200446c2082f27ed2a569601ca4e360"
    +Last-Modified: Mon, 14 Sep 2020 01:16:20 GMT
    +Content-Type: multipart/byteranges;boundary=35bcf444-e65f-4c76-9430-7e4a68dd3d26
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSIBWFOVW8eeWujkqSnoIANC2mNR1cdF
    +Date: Mon, 14 Sep 2020 10:02:43 GMT
    +Content-Length: 288
     
     --35bcf444-e65f-4c76-9430-7e4a68dd3d26
    -Content-type: binary/octet-stream
    -Content-range: bytes 20-30/4583
    -[ 11 Bytes object content]
    +Content-type: binary/octet-stream
    +Content-range: bytes 20-30/4583
    +[ 11 Bytes object content]
     --35bcf444-e65f-4c76-9430-7e4a68dd3d26
    -Content-type: binary/octet-stream
    -Content-range: bytes 40-50/4583
    -[ 11 Bytes object content]
    +Content-type: binary/octet-stream
    +Content-range: bytes 40-50/4583
    +[ 11 Bytes object content]
     --35bcf444-e65f-4c76-9430-7e4a68dd3d26
    -
    -
    +
    + +

    Sample Request 4

    Download an object if its Etag value matches.

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    GET /object01 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:24:33 GMT
    -If-Match: 682e760adb130c60c120da3e333a8b09
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    -
    -
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    GET /object01 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:24:33 GMT
    +If-Match: 682e760adb130c60c120da3e333a8b09
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +
    + +

    Sample Response 4-1 (Non-Matched Etag)

    If the Etag value of the stored object is not 682e760adb130c60c120da3e333a8b09, the system displays a message indicating that the download fails.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    HTTP/1.1 412 Precondition Failed
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3F2A89604C49ABEE55E
    -Content-Type: application/xml
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSQwxJ2I1VvxD/Xgwuw2G2RQax30gdXU
    -Date: WED, 01 Jul 2015 04:20:51 GMT
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    HTTP/1.1 412 Precondition Failed
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F2A89604C49ABEE55E
    +Content-Type: application/xml
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSQwxJ2I1VvxD/Xgwuw2G2RQax30gdXU
    +Date: WED, 01 Jul 2015 04:20:51 GMT
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
     <Error>
    -  <Code>PreconditionFailed</Code>
    -  <Message>At least one of the pre-conditions you specified did not hold</Message> 
    -  <RequestId>8DF400000163D3F2A89604C49ABEE55E</RequestId>      
    -  <HostId>ha0ZGaSKVm+uLOrCXXtx4Qn1aLzvoeblctVXRAqA7pty10mzUUW/yOzFue04lBqu</HostId>
    -  <Condition>If-Match</Condition>
    +  <Code>PreconditionFailed</Code>
    +  <Message>At least one of the pre-conditions you specified did not hold</Message> 
    +  <RequestId>8DF400000163D3F2A89604C49ABEE55E</RequestId>      
    +  <HostId>ha0ZGaSKVm+uLOrCXXtx4Qn1aLzvoeblctVXRAqA7pty10mzUUW/yOzFue04lBqu</HostId>
    +  <Condition>If-Match</Condition>
     </Error>
    -
    -
    +
    + +

    Sample Response 4-2 (Successful Download)

    If the Etag value of the stored object is 682e760adb130c60c120da3e333a8b09, the download is successful.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 5DEB00000164A21E1FC826C58F6BA001
    -Accept-Ranges: bytes
    -ETag: "682e760adb130c60c120da3e333a8b09"
    -Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    -Content-Type: application/octet-stream
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSbkdml1sLSvKnoHaRcOwRI+6+ustDwk
    -Date: Mon, 16 Jul 2015 08:04:00 GMT
    -Content-Length: 8
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 5DEB00000164A21E1FC826C58F6BA001
    +Accept-Ranges: bytes
    +ETag: "682e760adb130c60c120da3e333a8b09"
    +Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    +Content-Type: application/octet-stream
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSbkdml1sLSvKnoHaRcOwRI+6+ustDwk
    +Date: Mon, 16 Jul 2015 08:04:00 GMT
    +Content-Length: 8
     
    -[ 8 Bytes object content]
    -
    -
    +[ 8 Bytes object content] +
    + +

    Sample Request 5

    Carry the signature in the URL when downloading an object.

    GET /object02?AccessKeyId=H4IPJX0TQTHTHEBQQCEC&Expires=1532688887&Signature=EQmDuOhaLUrzrzRNZxwS72CXeXM%3D HTTP/1.1
    @@ -539,111 +550,116 @@ Host: examplebucket.obs.region.example.co
     Accept: */*
     Date: Fri, 27 Jul 2018 10:52:31 GMT
    -

    Sample Response 5

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    -ETag: "682e760adb130c60c120da3e333a8b09"
    -Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    -Content-Type: application/octet-stream
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    -Date: Fri, 27 Jul 2018 10:52:31 GMT
    -Content-Length: 8
    +

    Sample Response 5

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    +ETag: "682e760adb130c60c120da3e333a8b09"
    +Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    +Content-Type: application/octet-stream
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    +Date: Fri, 27 Jul 2018 10:52:31 GMT
    +Content-Length: 8
     
    -[ 8 Bytes object content]
    -
    -
    +[ 8 Bytes object content] +
    + +

    Sample Request 6

    Use the response-content-disposition parameter to download and rename an object.

    -
    1
    -2
    -3
    -4
    -5
    -6
    GET /object01?response-content-disposition=attachment; filename*=utf-8''name1 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:24:33 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    -
    -
    -
    -

    Sample Response 6

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    -ETag: "682e760adb130c60c120da3e333a8b09"
    -Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    -Content-Type: application/octet-stream
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    -Date: Fri, 27 Jul 2018 10:52:31 GMT
    -Content-Length: 8
    -Content-Disposition: attachment; filename*=utf-8''name1
    +
    1
    +2
    +3
    +4
    +5
    +6
    GET /object01?response-content-disposition=attachment; filename*=utf-8''name1 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:24:33 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +
    -[ 8 Bytes object content] -
    -
    +
    +
    +

    Sample Response 6

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    +ETag: "682e760adb130c60c120da3e333a8b09"
    +Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    +Content-Type: application/octet-stream
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    +Date: Fri, 27 Jul 2018 10:52:31 GMT
    +Content-Length: 8
    +Content-Disposition: attachment; filename*=utf-8''name1
    +
    +[ 8 Bytes object content]
    +
    + +

    Sample Request 7

    Use the attname parameter to download and rename an object.

    -
    1
    -2
    -3
    -4
    -5
    -6
    GET /object01?attname=name1 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:24:33 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    -
    -
    -
    -

    Sample Response 7

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    -ETag: "682e760adb130c60c120da3e333a8b09"
    -Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    -Content-Type: application/octet-stream
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    -Date: Fri, 27 Jul 2018 10:52:31 GMT
    -Content-Length: 8
    -Content-Disposition: attachment; filename*=utf-8''name1
    +
    1
    +2
    +3
    +4
    +5
    +6
    GET /object01?attname=name1 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:24:33 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +
    -[ 8 Bytes object content] -
    -
    +
    +
    +

    Sample Response 7

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    +ETag: "682e760adb130c60c120da3e333a8b09"
    +Last-Modified: Mon, 16 Jul 2015 08:03:34 GMT
    +Content-Type: application/octet-stream
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    +Date: Fri, 27 Jul 2018 10:52:31 GMT
    +Content-Length: 8
    +Content-Disposition: attachment; filename*=utf-8''name1
    +
    +[ 8 Bytes object content]
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0084.html b/docs/obs/api-ref/obs_04_0084.html index 972ce3992..e08b3347e 100644 --- a/docs/obs/api-ref/obs_04_0084.html +++ b/docs/obs/api-ref/obs_04_0084.html @@ -4,17 +4,18 @@

    Functions

    Users with the read permission on objects can perform the HeadObject operation to obtain metadata of objects. The object metadata is included in the response.

    This operation supports server-side encryption.

    -

    Versioning

    By default, this operation returns the latest metadata of an object. If the object has a deletion marker, status code 404 is returned. To obtain the object metadata of a specified version, the versionId parameter can be used to specify the desired version.

    +

    Versioning

    By default, this operation returns the latest metadata of an object. If the object has a delete marker, status code 404 is returned. To obtain the object metadata of a specified version, the versionId parameter can be used to specify the desired version.

    +
    +

    Request Syntax

    1
    +2
    +3
    +4
    HEAD /ObjectName HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    +
    -

    Request Syntax

    1
    -2
    -3
    -4
    HEAD /ObjectName HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -

    Request Parameters

    Table 1 describes the request parameters.

    @@ -54,7 +55,7 @@ Authorization: authorization

    Origin of the cross-domain request specified by the pre-request. Generally, it is a domain name.

    Type: string

    -

    Yes

    +

    No

    Access-Control-Request-Headers

    @@ -69,7 +70,7 @@ Authorization: authorization

    Indicates a decryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -79,7 +80,7 @@ Authorization: authorization

    Indicates a key used to decrypt objects. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -89,7 +90,7 @@ Authorization: authorization

    Indicates the MD5 value of a key used to decrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used.

    @@ -101,19 +102,20 @@ Authorization: authorization

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    -5
    -6
    HTTP/1.1 status_code
    -Content-Type: type
    -Date: date
    -Content-Length: length
    -Etag: etag
    -Last-Modified: time
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    HTTP/1.1 status_code
    +Content-Type: type
    +Date: date
    +Content-Length: length
    +Etag: etag
    +Last-Modified: time
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 3.

    @@ -178,7 +180,7 @@ Last-Modified: time

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -193,25 +195,25 @@ Last-Modified: time

    Indicates a decryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to decrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    x-obs-storage-class

    -

    This header is returned when the storage class of an object is not Standard. The value can be WARM or COLD.

    +

    This header is returned when the storage class of an object is not Standard. The value can be WARM or COLD.

    Type: string

    x-obs-restore

    -

    For a Cold object that is being restored or has been restored, this header is returned. Indicates the object restoring status. Value options are as follows: restoring ongoing-request=true; you have obtained ongoing-request=false, expiry-date=Wed, 07 Nov 2012 00:00:00 GMT. In the preceding information, expiry-date indicates the expiration time after the object is restored.

    +

    This header is returned when a Cold object is being restored or has been restored. It represents the object's restore status, which can be ongoing-request="true" (the object is being restored) or ongoing-request="false", expiry-date="Wed, 07 Nov 2012 00:00:00 GMT" (the object has been restored). In these statuses, expiry-date indicates when the restored object will expire.

    Type: string

    @@ -241,41 +243,43 @@ Last-Modified: time

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    HEAD /object1 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:19:25 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:/cARjk81l2iExMfQqn6iT3qEZ74=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    HEAD /object1 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:19:25 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:/cARjk81l2iExMfQqn6iT3qEZ74=
    +
    + +
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3E4BB5905C41B6E65B6
    +Accept-Ranges: bytes
    +ETag: "3b46eaf02d3b6b1206078bb86a7b7013"
    +Last-Modified: WED, 01 Jul 2015 01:19:21 GMT
    +Content-Type: binary/octet-stream
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Content-Length: 4572
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3E4BB5905C41B6E65B6
    -Accept-Ranges: bytes
    -ETag: "3b46eaf02d3b6b1206078bb86a7b7013"
    -Last-Modified: WED, 01 Jul 2015 01:19:21 GMT
    -Content-Type: binary/octet-stream
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
    -Date: WED, 01 Jul 2015 04:19:21 GMT
    -Content-Length: 4572
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0085.html b/docs/obs/api-ref/obs_04_0085.html index e5cddf2ad..4432ed21a 100644 --- a/docs/obs/api-ref/obs_04_0085.html +++ b/docs/obs/api-ref/obs_04_0085.html @@ -6,15 +6,16 @@

    Versioning

    When versioning is enabled for a bucket, a deletion marker with a unique version number is generated when an object is deleted without specifying the version. However, the object is not actually deleted. If versioning is suspended for a bucket and no version is specified when you delete an object, the object whose version number is null is deleted, and a deletion marker with version number null is generated.

    To delete an object of a specified version, the versionId parameter can be used to specify the desired version.

    -

    Request Syntax

    1
    -2
    -3
    -4
    DELETE /ObjectName HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    DELETE /ObjectName HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    + +

    Request Parameters

    Table 1 describes the request parameters.

    For deleting an object, only parameters listed in Table 1 are supported. If the request contains parameters that cannot be identified by OBS, the server returns the 400 error code.

    @@ -44,11 +45,12 @@ Authorization: authorization

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    HTTP/1.1 status_code
    -Date: date
    -
    -
    +

    Response Syntax

    1
    +2
    HTTP/1.1 status_code
    +Date: date
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 2.

    @@ -82,31 +84,33 @@ Date: date

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    DELETE /object2 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:19:21 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:MfK9JCnSFHCrJmjv7iRkRrrce2s=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    DELETE /object2 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:MfK9JCnSFHCrJmjv7iRkRrrce2s=
    +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 No Content
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F51DEA05AC9CA066F1
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    HTTP/1.1 204 No Content
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3F51DEA05AC9CA066F1
    -x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5
    -Date: WED, 01 Jul 2015 04:19:21 GMT
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0086.html b/docs/obs/api-ref/obs_04_0086.html index 276e43b47..7f535e250 100644 --- a/docs/obs/api-ref/obs_04_0086.html +++ b/docs/obs/api-ref/obs_04_0086.html @@ -5,43 +5,44 @@

    Objects in batches can be deleted in verbose or quiet mode. With verbose mode, OBS returns results of successful and failed deletion in an XML response; with quiet mode, OBS only returns results of failed deletion in an XML response. OBS uses the verbose mode by default and you can specify the quiet mode in the request body.

    For batch deletion, the request header must contain Content-MD5 and Content-Length, so that the message body can be identified if network transmission error is detected at the server side.

    -

    Request Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    POST /?delete HTTP/1.1  
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -Content-MD5: MD5
    -Content-Length: length
    +

    Request Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    POST /?delete HTTP/1.1  
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +Content-MD5: MD5
    +Content-Length: length
     
    -<?xml version="1.0" encoding="UTF-8"?>   
    -<Delete> 
    -    <Quiet>true</Quiet>  
    -    <Object> 
    -        <Key>Key</Key> 
    -        <VersionId>VersionId</VersionId> 
    -    </Object>  
    -    <Object>  
    -        <Key>Key</Key> 
    -    </Object> 
    +<?xml version="1.0" encoding="UTF-8"?>   
    +<Delete> 
    +    <Quiet>true</Quiet>  
    +    <Object> 
    +        <Key>Key</Key> 
    +        <VersionId>VersionId</VersionId> 
    +    </Object>  
    +    <Object>  
    +        <Key>Key</Key> 
    +    </Object> 
     </Delete>
    -
    -
    +
    + +

    Request Parameters

    This request involves no parameters.

    @@ -49,7 +50,7 @@ Content-Length: length

    Request Elements

    This request uses elements to specify the list of objects to be deleted in a batch. Table 1 describes the elements.

    -
    - - - @@ -89,11 +89,12 @@ Content-MD5: MD5
    Table 1 Request Elements

    Element

    +
    @@ -103,39 +104,40 @@ Content-Length: length

    A maximum of 1000 objects can be deleted at a time. If you send a request for deleting more than 1000 objects, OBS returns an error message.

    After concurrent tasks are assigned, OBS may encounter an internal error during cyclic deletion of multiple objects. In that case, the metadata still exists when the object index data is deleted, which means data inconsistency.

    -

    Response Syntax

    Table 1 Request elements

    Element

    Description

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    HTTP/1.1 status_code
    -Date: date
    -Content-Type: application/xml 
    -Content-Length: length
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    HTTP/1.1 status_code
    +Date: date
    +Content-Type: application/xml 
    +Content-Length: length
     
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<DeleteResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -<Deleted> 
    -    <Key>Key</Key> 
    -</Deleted> 
    -<Error> 
    -    <Key>Key</Key> 
    -    <Code>ErrorCode</Code> 
    -    <Message>message</Message> 
    -</Error> 
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<DeleteResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +<Deleted> 
    +    <Key>Key</Key> 
    +</Deleted> 
    +<Error> 
    +    <Key>Key</Key> 
    +    <Code>ErrorCode</Code> 
    +    <Message>message</Message> 
    +</Error> 
     </DeleteResult>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -212,67 +214,69 @@ Content-Length: length

    3. If the request header does not contain Content-MD5, OBS returns 400 Bad Request.

    Other errors are included in Table 2.

    -

    Sample Request

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    POST /test333?delete HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: 127.0.0.1
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:34:21 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:8sjZWJlWmYmYnK5JqXaFFQ+vHEg=
    -Content-MD5: ZPzz8L+hdRJ6qCqYbU/pCw==
    -Content-Length: 188
    +

    Sample Request

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    POST /test333?delete HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: 127.0.0.1
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:34:21 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:8sjZWJlWmYmYnK5JqXaFFQ+vHEg=
    +Content-MD5: ZPzz8L+hdRJ6qCqYbU/pCw==
    +Content-Length: 188
     
     <?xml version="1.0" encoding="utf-8"?>
    -<Delete> 
    -  <Quiet>true</Quiet>  
    -  <Object> 
    -    <Key>obja02</Key> 
    -  </Object>  
    -  <Object> 
    -    <Key>obja02</Key> 
    -  </Object> 
    +<Delete> 
    +  <Quiet>true</Quiet>  
    +  <Object> 
    +    <Key>obja02</Key> 
    +  </Object>  
    +  <Object> 
    +    <Key>obja02</Key> 
    +  </Object> 
     </Delete>
    -
    -
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3FE4CE80340D30B0542
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCRhY0FBWRm6qjOE1ACBZwS+0KYlPBq0f
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 04:34:21 GMT
    -Content-Length: 120
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3FE4CE80340D30B0542
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCRhY0FBWRm6qjOE1ACBZwS+0KYlPBq0f
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 04:34:21 GMT
    +Content-Length: 120
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<DeleteResult xmlns="http://obs.example.com/doc/2015-06-30/"/>
    -
    -
    +<DeleteResult xmlns="http://obs.example.com/doc/2015-06-30/"/> +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0087.html b/docs/obs/api-ref/obs_04_0087.html index 04c8ceac9..c75b02171 100644 --- a/docs/obs/api-ref/obs_04_0087.html +++ b/docs/obs/api-ref/obs_04_0087.html @@ -1,9 +1,9 @@

    Restoring Cold Objects

    -

    Functions

    To obtain the content of an object in the Cold storage class, you need to restore the object first and then you can download it. After an object is restored, a copy of the object is saved in the Standard storage class. By doing so, the object in the Cold storage class and its copy in the Standard storage class co-exist in the bucket. The copy will be automatically deleted upon the expiration of its retention period.

    +

    Functions

    To obtain the content of an object in the Cold storage class, you need to restore the object first and then you can download it. After an object is restored, a copy of the object is saved in the Standard storage class. By doing so, the object in the Cold storage class and its copy in the Standard storage class co-exist in the bucket. The copy will be automatically deleted once its retention period expires.

    -

    Versioning

    By default, this operation returns the latest version of an object. If the object has a deletion marker, status code 404 is returned. To restore an object of a specified version, the versionId parameter can be used to specify the desired version.

    +

    Versioning

    By default, this operation returns the latest version of an object. If the object has a delete marker, status code 404 is returned. To restore an object of a specified version, the versionId parameter can be used to specify the desired version.

    Request Syntax

    POST /ObjectName?restore&versionId=VersionID HTTP/1.1 
     Host: bucketname.obs.region.example.com
    @@ -52,7 +52,7 @@ Content-MD5: MD5
     

    RestoreRequest

    Container for restoration information

    +

    Container for the restore information

    Type: container

    Yes

    @@ -61,14 +61,14 @@ Content-MD5: MD5

    Days

    Indicates the storage duration of the restored object. The minimum value is 1 and the maximum value is 30.

    -

    Type: positive integer

    +

    Type: integer

    Yes

    RestoreJob

    Container for restoring options

    +

    Container for the restore options

    Type: container

    No

    @@ -76,9 +76,9 @@ Content-MD5: MD5

    Tier

    Restoring options: Expedited | Standard

    -

    Expedited indicates that data can be restored within 1 to 5 minutes.

    -

    Standard indicates that the data can be restored within 3 to 5 hours.

    +

    Restore options: Expedited | Standard

    +

    Expedited indicates that objects can be quickly restored within 1 to 5 minutes from Archive storage and within 3 to 5 hours from Deep Archive storage.

    +

    Standard indicates that objects can be restored within 3 to 5 hours from Archive storage and within 5 to 12 hours from Deep Archive storage.

    The default value is Standard.

    Type: string

    -

    Response Syntax

    1
    -2
    HTTP/1.1 status_code
    -Date: date
    -
    -
    +

    Response Syntax

    1
    +2
    HTTP/1.1 status_code
    +Date: date
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -150,7 +151,7 @@ Date: date

    InvalidObjectState

    -

    The restored object is not a Cold object.

    +

    The restored object is not in the Cold storage.

    ErrorMessage: Restore is not allowed, as object's storage class is not COLD

    403 Forbidden

    @@ -160,47 +161,49 @@ Date: date
    -

    Sample Request

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    POST /object?restore HTTP/1.1
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:39:46 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:kaEwOixnSVuS6If3Q0Lnd6kxm5A=
    -Content-Length: 183
    +

    Sample Request

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    POST /object?restore HTTP/1.1
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:39:46 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:kaEwOixnSVuS6If3Q0Lnd6kxm5A=
    +Content-Length: 183
     
     <RestoreRequest>
    -   <Days>2</Days> 
    -   <RestoreJob>
    -     <Tier>Expedited</Tier>
    -   </RestoreJob> 
    -</RestoreRequest> 
    -
    -
    + <Days>2</Days> + <RestoreJob> + <Tier>Expedited</Tier> + </RestoreJob> +</RestoreRequest> +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    +6
    HTTP/1.1 202 Accepted
    +Server: OBS
    +x-obs-request-id: A2F500000163F374CCBB2063F834C6C4
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSLbWIs23RR95NVpkbWlJdlm8Dq+wQBw
    +Date: WED, 01 Jul 2015 04:39:46 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    -6
    HTTP/1.1 202 Accepted
    -Server: OBS
    -x-obs-request-id: A2F500000163F374CCBB2063F834C6C4
    -x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSLbWIs23RR95NVpkbWlJdlm8Dq+wQBw
    -Date: WED, 01 Jul 2015 04:39:46 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0089.html b/docs/obs/api-ref/obs_04_0089.html index a952f05bf..dcaf93d92 100644 --- a/docs/obs/api-ref/obs_04_0089.html +++ b/docs/obs/api-ref/obs_04_0089.html @@ -7,45 +7,46 @@

    Versioning

    By default, this operation modifies the ACL of the latest version of an object. To specify a specified version, the request can carry the versionId parameter.

    -

    Request Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    PUT /ObjectName?acl HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    +

    Request Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    PUT /ObjectName?acl HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
     
    -<AccessControlPolicy> 
    -    <Owner> 
    -        <ID>ID</ID> 
    -    </Owner> 
    -    <Delivered>true</Delivered>
    -    <AccessControlList> 
    -        <Grant> 
    -            <Grantee>
    -               <ID>ID</ID>
    -            </Grantee> 
    -            <Permission>permission</Permission> 
    -        </Grant> 
    -    </AccessControlList> 
    +<AccessControlPolicy> 
    +    <Owner> 
    +        <ID>ID</ID> 
    +    </Owner> 
    +    <Delivered>true</Delivered>
    +    <AccessControlList> 
    +        <Grant> 
    +            <Grantee>
    +               <ID>ID</ID>
    +            </Grantee> 
    +            <Permission>permission</Permission> 
    +        </Grant> 
    +    </AccessControlList> 
     </AccessControlPolicy>
    -
    -
    +
    + +

    Request Parameters

    Table 1 describes the request parameters.

    @@ -117,7 +118,7 @@ Authorization: authorization

    Grants permissions to all users.

    Value range: Everyone

    -

    Type: enumeration

    +

    Type: string

    No

    @@ -125,7 +126,8 @@ Authorization: authorization

    Delivered

    Indicates whether an object ACL inherits the ACL of a bucket.

    -

    Type: boolean Default value: true

    +

    Type: boolean

    +

    Default value: true

    No

    @@ -133,7 +135,8 @@ Authorization: authorization

    Permission

    Authorized permission.

    -

    Type: enumeration

    +

    Value options: READ | READ_ACP | WRITE_ACP | FULL_CONTROL

    +

    Type: string

    No

    @@ -150,13 +153,14 @@ Authorization: authorization
    -

    Response Syntax

    1
    -2
    -3
    HTTP/1.1 status_code
    -Content-Length: length
    -Content-Type: application/xml
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    HTTP/1.1 status_code
    +Content-Length: length
    +Content-Type: application/xml
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 3.

    @@ -181,89 +185,91 @@ Content-Type: application/xml

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    PUT /obj2?acl HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:42:34 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:8xAODun1ofjkwHm8YhtN0QEcy9M=
    -Content-Length: 727
    +

    Sample Request

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    PUT /obj2?acl HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:42:34 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:8xAODun1ofjkwHm8YhtN0QEcy9M=
    +Content-Length: 727
     
    -<AccessControlPolicy xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <Owner> 
    -    <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    -  </Owner>  
    -  <Delivered>false</Delivered>
    -  <AccessControlList> 
    -    <Grant> 
    -      <Grantee> 
    -        <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    -      </Grantee>  
    -      <Permission>FULL_CONTROL</Permission> 
    -    </Grant>  
    -    <Grant> 
    -      <Grantee> 
    -        <ID>783fc6652cf246c096ea836694f71855</ID> 
    -      </Grantee>  
    -      <Permission>READ</Permission>
    -    </Grant>  
    -    <Grant> 
    -      <Grantee> 
    -        <Canned>Everyone</Canned> 
    -      </Grantee>  
    -      <Permission>READ</Permission> 
    -    </Grant> 
    -  </AccessControlList> 
    +<AccessControlPolicy xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <Owner> 
    +    <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    +  </Owner>  
    +  <Delivered>false</Delivered>
    +  <AccessControlList> 
    +    <Grant> 
    +      <Grantee> 
    +        <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    +      </Grantee>  
    +      <Permission>FULL_CONTROL</Permission> 
    +    </Grant>  
    +    <Grant> 
    +      <Grantee> 
    +        <ID>783fc6652cf246c096ea836694f71855</ID> 
    +      </Grantee>  
    +      <Permission>READ</Permission>
    +    </Grant>  
    +    <Grant> 
    +      <Grantee> 
    +        <Canned>Everyone</Canned> 
    +      </Grantee>  
    +      <Permission>READ</Permission> 
    +    </Grant> 
    +  </AccessControlList> 
     </AccessControlPolicy>
    -
    -
    +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    +6
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F0FD2A03D2D30B0542
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCTjCqTmsA1XRpIrmrJdvcEWvZyjbztdd
    +Date: WED, 01 Jul 2015 04:42:34 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    -6
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3F0FD2A03D2D30B0542
    -x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCTjCqTmsA1XRpIrmrJdvcEWvZyjbztdd
    -Date: WED, 01 Jul 2015 04:42:34 GMT
    -Content-Length: 0
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0090.html b/docs/obs/api-ref/obs_04_0090.html index 894d47c4a..3f890ec6d 100644 --- a/docs/obs/api-ref/obs_04_0090.html +++ b/docs/obs/api-ref/obs_04_0090.html @@ -5,15 +5,16 @@

    Versioning

    By default, this operation obtains the ACL of the latest version of an object. If the object has a delete marker, status code 404 is returned. To obtain the ACL of a specified version, the versionId parameter can be used to specify the desired version.

    -

    Request Syntax

    1
    -2
    -3
    -4
    GET /ObjectName?acl HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    GET /ObjectName?acl HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    + +

    Request Parameters

    The request parameter specifies the object ACL to be obtained. For details about the parameters, see Table 1.

    @@ -49,47 +50,48 @@ Authorization: authorization

    Request Elements

    This request involves no elements.

    -

    Response Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    HTTP/1.1 status_code
    -Date: date
    -Content-Length: length
    -Content-Type: application/xml 
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    HTTP/1.1 status_code
    +Date: date
    +Content-Length: length
    +Content-Type: application/xml 
     
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<AccessControlPolicy xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -    <Owner> 
    -        <ID>id</ID> 
    -    </Owner> 
    -    <Delivered>true</Delivered>
    -    <AccessControlList> 
    -        <Grant> 
    -            <Grantee> 
    -                <ID>id</ID> 
    -            </Grantee> 
    -            <Permission>permission</Permission> 
    -        </Grant> 
    -    </AccessControlList> 
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<AccessControlPolicy xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +    <Owner> 
    +        <ID>id</ID> 
    +    </Owner> 
    +    <Delivered>true</Delivered>
    +    <AccessControlList> 
    +        <Grant> 
    +            <Grantee> 
    +                <ID>id</ID> 
    +            </Grantee> 
    +            <Permission>permission</Permission> 
    +        </Grant> 
    +    </AccessControlList> 
     </AccessControlPolicy>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 2.

    @@ -161,91 +163,93 @@ Content-Type: application/xml

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    GET /object011?acl HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:45:55 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:YcmvNQxItGjFeeC1K2HeUEp8MMM=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    GET /object011?acl HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:45:55 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:YcmvNQxItGjFeeC1K2HeUEp8MMM=
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D3E650F3065C2295674C
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCS+wsHqRuA2Tx+mXUpNtBbWLPMle9CIx
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 04:45:55 GMT
    -Content-Length: 769
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3E650F3065C2295674C
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCS+wsHqRuA2Tx+mXUpNtBbWLPMle9CIx
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 04:45:55 GMT
    +Content-Length: 769
     
     <?xml version="1.0" encoding="utf-8"?>
    -<AccessControlPolicy xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -  <Owner> 
    -    <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    -  </Owner>  
    -  <Delivered>false</Delivered> 
    -  <AccessControlList> 
    -    <Grant> 
    -      <Grantee> 
    -        <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    -      </Grantee>  
    -      <Permission>FULL_CONTROL</Permission> 
    -    </Grant>  
    -    <Grant> 
    -      <Grantee> 
    -        <ID>783fc6652cf246c096ea836694f71855</ID> 
    -      </Grantee>  
    -      <Permission>READ</Permission>  
    -      </Grant>  
    -    <Grant> 
    -      <Grantee> 
    -        <Canned>Everyone</Canned> 
    -      </Grantee>  
    -      <Permission>READ_ACP</Permission> 
    -    </Grant> 
    -  </AccessControlList> 
    +<AccessControlPolicy xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +  <Owner> 
    +    <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    +  </Owner>  
    +  <Delivered>false</Delivered> 
    +  <AccessControlList> 
    +    <Grant> 
    +      <Grantee> 
    +        <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID> 
    +      </Grantee>  
    +      <Permission>FULL_CONTROL</Permission> 
    +    </Grant>  
    +    <Grant> 
    +      <Grantee> 
    +        <ID>783fc6652cf246c096ea836694f71855</ID> 
    +      </Grantee>  
    +      <Permission>READ</Permission>  
    +      </Grant>  
    +    <Grant> 
    +      <Grantee> 
    +        <Canned>Everyone</Canned> 
    +      </Grantee>  
    +      <Permission>READ_ACP</Permission> 
    +    </Grant> 
    +  </AccessControlList> 
     </AccessControlPolicy>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0091.html b/docs/obs/api-ref/obs_04_0091.html new file mode 100644 index 000000000..6d6cdb071 --- /dev/null +++ b/docs/obs/api-ref/obs_04_0091.html @@ -0,0 +1,373 @@ + + +

    Modifying Object Metadata

    +

    Functions

    This operation modifies, deletes, or adds metadata to uploaded objects in a bucket.

    +
    +

    Request Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    PUT /ObjectName?metadata HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Content-Type: application/xml 
    +Content-Length: length
    +Authorization: authorization
    +Date: date
    +<Optional Additional Header> 
    +<object Content>
    +
    + +
    +
    +

    Request Parameters

    +
    + + + + + + + + + +
    Table 1 Request parameters

    Parameter

    +

    Description

    +

    Mandatory

    +

    versionId

    +

    Object version ID

    +

    Type: string

    +

    No

    +
    +
    +
    +

    Request Headers

    OBS supports the six HTTP request headers: Cache-Control, Expires, Content-Encoding, Content-Disposition, Content-Type, and Content-Language. It saves these header values in the metadata of the object. When the object is downloaded or queried, the saved values are set for corresponding HTTP headers and returned to the client.

    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 2 Request headers

    Header

    +

    Description

    +

    Mandatory

    +

    x-obs-metadata-directive

    +

    Metadata operation indicator.

    +

    The value can be REPLACE_NEW or REPLACE.

    +

    REPLACE_NEW: The metadata that has an existing value is replaced. A value is assigned to the metadata that does not have a value. The metadata that is not specified remains unchanged. (Note: a header with custom metadata is replaced.)

    +

    REPLACE: Use the header field carried in the current request to replace the original metadata. The metadata that is not specified (except x-obs-storage-class) will be deleted.

    +

    Type: string

    +

    Yes

    +

    Cache-Control

    +

    Specifies the cache behavior of the web page when the object is downloaded.

    +

    Type: string

    +

    No

    +

    Content-Disposition

    +

    Specifies the name of the object when it is downloaded.

    +

    Type: string

    +

    No

    +

    Content-Encoding

    +

    Specifies the content encoding format when an object is being uploaded.

    +

    Type: string

    +

    No

    +

    Content-Language

    +

    Specifies the content language format when an object is downloaded.

    +

    Type: string

    +

    No

    +

    Content-Type

    +

    Object file type.

    +

    Type: string

    +

    No

    +

    Expires

    +

    Specifies the cache expiration time of the web page when the object is downloaded.

    +

    Type: string

    +

    No

    +

    x-obs-website-redirect-location

    +

    When the bucket is configured with the website redirection, the request for obtaining the object can be redirected to another object or an external URL in the bucket.

    +

    In the following example, the request header sets the redirection to an object (anotherPage.html) in the same bucket:

    +

    x-obs-website-redirect-location:/anotherPage.html

    +

    In the following example, the request header sets the object redirection to an external URL:

    +

    x-obs-website-redirect-location:http://www.example.com/

    +

    Type: string

    +

    Constraint: The value must be prefixed by a slash (/), http://, or https://. The length of the value cannot exceed 2 KB.

    +

    No

    +

    x-obs-storage-class

    +

    Specifies the storage class of an object.

    +

    Type: string

    +

    Storage class value options: STANDARD (OBS Standard), WARM (OBS Warm), COLD (OBS Cold). These values are case sensitive.

    +

    Example: x-obs-storage-class: STANDARD

    +

    No

    +

    x-obs-meta-*

    +

    A message header starting with x-obs-meta- can be added to a request to add custom metadata for object management. Custom metadata will be returned in the response header when you retrieve or query the metadata of the object.

    +

    Type: string

    +

    Example: x-obs-meta-test: test metadata

    +

    No

    +
    +
    +
    +

    Request Elements

    This request involves no elements.

    +
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 status_code
    +Date: date
    +Content-Length: length
    +Etag: etag
    +Last-Modified: time
    +
    + +
    +
    +

    Response Headers

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 3 Additional response header parameters

    Header

    +

    Description

    +

    x-obs-metadata-directive

    +

    Metadata operation indicator.

    +

    The value can be REPLACE_NEW or REPLACE.

    +

    Type: string

    +

    Cache-Control

    +

    Specifies the cache behavior of the web page when the object is downloaded. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    Content-Disposition

    +

    Specifies the name of the object when it is downloaded. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    Content-Encoding

    +

    Specifies the content encoding format when an object is being uploaded. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    Content-Language

    +

    Specifies the content language format when an object is downloaded. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    Expires

    +

    Specifies the cache expiration time of the web page when the object is downloaded. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    x-obs-website-redirect-location

    +

    When the bucket is configured with the website redirection, the request for obtaining the object can be redirected to another object or an external URL in the bucket. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    x-obs-storage-class

    +

    Specifies the storage class of an object. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +

    x-obs-meta-*

    +

    Custom metadata is used to manage objects in a customized manner. If a request carries this header field, the response message must contain this header field.

    +

    Type: string

    +
    +
    +
    +

    Response Elements

    This response involves no elements.

    +
    +

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    +
    +

    Sample Request 1

    Adding Object Metadata

    +

    Add the following metadata to the object: Content-Type:application/zip and x-obs-meta-test:meta.

    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    PUT /object?metadata HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 14:24:33 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +x-obs-metadata-directive:REPLACE_NEW
    +Content-Type:application/zip
    +x-obs-meta-test:meta
    +
    + +
    +
    +

    Sample Response 1

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3E4BB5905C41B6E65B6
    +Accept-Ranges: bytes
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Content-Length: 0
    +x-obs-metadata-directive:REPLACE_NEW
    +x-obs-meta-test:meta
    +
    + +
    +
    +

    Sample Request 2

    Modifying Object Metadata

    +

    If metadata x-obs-meta-test:testmeta exists in the object and the value of x-obs-storage-class is WARM, change the metadata x-obs-meta-test of the object to newmeta and change x-obs-storage-class to COLD.

    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    PUT /object?metadata HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 14:24:33 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +x-obs-metadata-directive:REPLACE_NEW
    +x-obs-meta-test:newmeta
    +x-obs-storage-class:COLD
    +
    + +
    +
    +

    Sample Response 2

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3E4BB5905C41B6E65B6
    +Accept-Ranges: bytes
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Content-Length: 0
    +x-obs-metadata-directive:REPLACE_NEW
    +x-obs-meta-test:newmeta
    +x-obs-storage-class:COLD
    +
    + +
    +
    +

    Sample Request 3

    Deleting Object Metadata

    +

    Metadata x-obs-meta-test:newmeta and Content-Type:application/zip exist in the object, and delete x-obs-meta-test.

    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    PUT /object?metadata HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 14:24:33 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:NxtSMS0jaVxlLnxlO9awaMTn47s=
    +x-obs-metadata-directive:REPLACE
    +Content-Type:application/zip
    +
    + +
    +
    +

    Sample Response 3

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3E4BB5905C41B6E65B6
    +Accept-Ranges: bytes
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSD3nAiTaBoeyt9oHp9vTYtXnLDmwV6D
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +Content-Length: 0
    +x-obs-metadata-directive:REPLACE
    +
    + +
    +
    +
    +
    + +
    + diff --git a/docs/obs/api-ref/obs_04_0092.html b/docs/obs/api-ref/obs_04_0092.html new file mode 100644 index 000000000..cc43b8fd7 --- /dev/null +++ b/docs/obs/api-ref/obs_04_0092.html @@ -0,0 +1,105 @@ + + +

    Modifying an Object

    +

    Functions

    This operation can modify an object from a specified position.

    +

    This API is supported only by parallel file systems. For details about how to create a parallel file system, see Sample Request 4.

    +
    +
    +

    Request Syntax

    PUT /ObjectName?modify&position=Position HTTP/1.1
    +Host: bucketname.obs.region.example.com
    +Content-Type: type
    +Content-Length: length
    +Authorization: authorization
    +Date: date
    +<object Content>
    +
    +

    Request Parameters

    The request needs to specify parameters in the message, indicating that the upload is for modification, and specifying the position in the object to be modified. Table 1 describes the parameters.

    + +
    + + + + + + + + + + + + + +
    Table 1 Request parameters

    Parameter

    +

    Description

    +

    Mandatory

    +

    modify

    +

    Indicates that the file is uploaded for modification.

    +

    Type: string

    +

    Yes

    +

    position

    +

    Position in the object where the modification starts

    +

    Type: integer

    +

    Yes

    +
    +
    +
    +

    Request headers

    This request uses common request headers. For details, see Table 3.

    +
    +

    Request Elements

    This request involves no elements.

    +
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 status_code
    +Date: Date
    +ETag: etag
    +Content-Length: length
    +Server: OBS
    +x-obs-request-id: request-id
    +x-obs-id-2: id
    +
    + +
    +
    +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    +
    +

    Response Elements

    This response involves no elements.

    +
    +

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    +
    +

    Sample Request

    PUT /ObjectName?modify&position=Position HTTP/1.1
    +Host: examplebucket.obs.region.example.com
    +Date: Wed, 08 Jul 2015 06:57:01 GMT
    +Content-Type: image/jpg
    +Content-Length: 1458
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:kZoYNv66bsmc10+dcGKw5x2PRrk=
    +
    +[1458 bytes of object data]
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 200
    +Date: Wed, 08 Jul 2015 06:57:02 GMT
    +ETag: "d41d8cd98f00b204e9800998ecf8427e"
    +Content-Length: 0
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F0FD2A03D2D30B0542
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCTjCqTmsA1XRpIrmrJdvcEWvZyjbztd
    +
    + +
    +
    +
    +
    + +
    + diff --git a/docs/obs/api-ref/obs_04_0093.html b/docs/obs/api-ref/obs_04_0093.html new file mode 100644 index 000000000..f0dc8eaea --- /dev/null +++ b/docs/obs/api-ref/obs_04_0093.html @@ -0,0 +1,92 @@ + + +

    Truncating an Object

    +

    Functions

    This operation can truncate an object to a specified size.

    +

    This API is supported only by parallel file systems. For details about how to create a parallel file system, see Sample Request 4.

    +
    +
    +

    Request Syntax

    PUT /ObjectName?truncate&length=Length HTTP/1.1
    +Host: bucketname.obs.region.example.com
    +Authorization: authorization
    +Content-Length: length
    +Date: date
    +
    +

    Request Parameters

    The request needs to specify parameters in the message, indicating that this is to truncate an object to a specified size. Table 1 describes the parameters.

    + +
    + + + + + + + + + + + + + +
    Table 1 Request parameters

    Parameter

    +

    Description

    +

    Mandatory

    +

    truncate

    +

    Indicates that the upload is for truncation.

    +

    Type: string

    +

    Yes

    +

    length

    +

    Size of the object after the truncation

    +

    Type: integer

    +

    Yes

    +
    +
    +
    +

    Request headers

    This request uses common request headers. For details, see Table 3.

    +
    +

    Request Elements

    This request involves no elements.

    +
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 status_code
    +Server: OBS
    +x-obs-request-id: request-id
    +x-obs-id-2: id
    +Date: Date
    +
    + +
    +
    +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    +
    +

    Response Elements

    This response involves no elements.

    +
    +

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    +
    +

    Sample Request

    PUT /ObjectName?truncate&length=1000 HTTP/1.1
    +Host: examplebucket.obs.region.example.com
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
    +Content-Length: 1
    +Date: WED, 01 Jul 2015 04:19:20 GMT
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 No Content
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F51DEA05AC9CA066F1
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +
    + +
    +
    +
    +
    + +
    + diff --git a/docs/obs/api-ref/obs_04_0094.html b/docs/obs/api-ref/obs_04_0094.html new file mode 100644 index 000000000..9ee26828f --- /dev/null +++ b/docs/obs/api-ref/obs_04_0094.html @@ -0,0 +1,90 @@ + + +

    Renaming an Object

    +

    Functions

    This operation can rename an object.

    +

    This API is supported only by parallel file systems. For details about how to create a parallel file system, see Sample Request 4. Renaming an object is a non-idempotent operation.

    +
    +
    +

    Request Syntax

    POST /ObjectName?name=Name&rename HTTP/1.1
    +Host: bucketname.obs.region.example.com
    +Authorization: authorization
    +Date: date
    +
    +

    Request Parameters

    The request needs to specify parameters in the message, indicating that this is a renaming operation, specifying the new name. Table 1 describes the parameters.

    + +
    + + + + + + + + + + + + + +
    Table 1 Request parameters

    Parameter

    +

    Description

    +

    Mandatory

    +

    name

    +

    New name for the object. Use the absolute path.

    +

    Type: string

    +

    Yes

    +

    rename

    +

    Indicates that this is a renaming operation.

    +

    Type: string

    +

    Yes

    +
    +
    +
    +

    Request Headers

    This request uses common request headers. For details, see Table 3.

    +
    +

    Request Elements

    This request involves no elements.

    +
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 status_code
    +Server: OBS
    +x-obs-request-id: request-id
    +x-obs-id-2: id
    +Date: Date
    +
    + +
    +
    +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    +
    +

    Response Elements

    This response involves no elements.

    +
    +

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    +
    +

    Sample Request

    POST /ObjectName?name=file2&rename HTTP/1.1
    +Host: examplebucket.obs.region.example.com
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=
    +Date: WED, 01 Jul 2015 04:19:20 GMT
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 No Content
    +Server: OBS
    +x-obs-request-id: 8DF400000163D3F51DEA05AC9CA066F1
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5
    +Date: WED, 01 Jul 2015 04:19:21 GMT
    +
    + +
    +
    +
    +
    + +
    + diff --git a/docs/obs/api-ref/obs_04_0096.html b/docs/obs/api-ref/obs_04_0096.html index bc5c96fcb..5c783c1ac 100644 --- a/docs/obs/api-ref/obs_04_0096.html +++ b/docs/obs/api-ref/obs_04_0096.html @@ -4,9 +4,9 @@

    Sample Request 1

    List the initialized multipart tasks without any parameter.

    -
    1
    -2
    -3
    -4
    -5
    -6
    GET /?uploads HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 04:51:21 GMT
    -Authorization: OBS UDSIAMSTUBTEST000008:XdmZgYQ+ZVy1rjxJ9/KpKq+wrU0=
    -
    -
    +
    1
    +2
    +3
    +4
    +5
    +6
    GET /?uploads HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 04:51:21 GMT
    +Authorization: OBS UDSIAMSTUBTEST000008:XdmZgYQ+ZVy1rjxJ9/KpKq+wrU0=
    +
    +
    -

    Sample Response 1

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D405534D046A2295674C
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSDaHP+a+Bp0RI6Mm9XvCOrf7q3qvBQW
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 04:51:21 GMT
    -Content-Length: 681
    +
    +

    Sample Response 1

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D405534D046A2295674C
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSDaHP+a+Bp0RI6Mm9XvCOrf7q3qvBQW
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 04:51:21 GMT
    +Content-Length: 681
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<ListMultipartUploadsResult xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <Bucket>examplebucket</Bucket>
    -  <KeyMarker/>
    -  <UploadIdMarker/>
    -  <Delimiter/>
    -  <Prefix/>
    -  <MaxUploads>1000</MaxUploads>
    -  <IsTruncated>false</IsTruncated>
    -  <Upload>
    -    <Key>obj2</Key>
    -    <UploadId>00000163D40171ED8DF4050919BD02B8</UploadId>
    -    <Initiator>
    -      <ID>domainID/b4bf1b36d9ca43d984fbcb9491b6fce9:userID/71f390117351534r88115ea2c26d1999</ID>
    -    </Initiator>
    -    <Owner>
    -      <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID>
    -    </Owner>
    -    <StorageClass>STANDARD</StorageClass>
    -    <Initiated>2015-07-01T02:30:54.582Z</Initiated>
    -  </Upload>
    +<ListMultipartUploadsResult xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <Bucket>examplebucket</Bucket>
    +  <KeyMarker/>
    +  <UploadIdMarker/>
    +  <Delimiter/>
    +  <Prefix/>
    +  <MaxUploads>1000</MaxUploads>
    +  <IsTruncated>false</IsTruncated>
    +  <Upload>
    +    <Key>obj2</Key>
    +    <UploadId>00000163D40171ED8DF4050919BD02B8</UploadId>
    +    <Initiator>
    +      <ID>domainID/b4bf1b36d9ca43d984fbcb9491b6fce9:userID/71f390117351534r88115ea2c26d1999</ID>
    +    </Initiator>
    +    <Owner>
    +      <ID>b4bf1b36d9ca43d984fbcb9491b6fce9</ID>
    +    </Owner>
    +    <StorageClass>STANDARD</StorageClass>
    +    <Initiated>2015-07-01T02:30:54.582Z</Initiated>
    +  </Upload>
     </ListMultipartUploadsResult>
    -
    -
    +
    + +

    Sample Request 2

    List the initialized multipart tasks with the prefix and delimiter.

    -

    The following example describes how to list initialized multipart tasks when there are two multipart tasks in the bucket examplebucket, and their object names are multipart-object001 and part2-key02. Set prefix to multipart and set delimiter to object001.

    +

    The following example describes how to list two initiated multipart uploads (with objects multipart-object001 and part2-key02 in bucket examplebucket. In this listing operation, prefix is set to multipart and object001 is set to delimiter.

    GET /?uploads&delimiter=object001&prefix=multipart HTTP/1.1
     User-Agent: curl/7.29.0
     Host: examplebucket.obs.region.example.com
    @@ -367,49 +370,50 @@ Accept: */*
     Date: WED, 01 Jul 2015 04:51:21 GMT
     Authorization: OBS UDSIAMSTUBTEST000008:XdmZgYQ+ZVy1rjxJ9/KpKq+wrU0=
    -

    Sample Response 2

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 5DEB00000164A27A1610B8250790D703
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSq3ls2ZtLDD6pQLcJq1yGITXgspSvBR
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 04:51:21 GMT
    -Content-Length: 681
    +

    Sample Response 2

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 5DEB00000164A27A1610B8250790D703
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSq3ls2ZtLDD6pQLcJq1yGITXgspSvBR
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 04:51:21 GMT
    +Content-Length: 681
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<ListMultipartUploadsResult xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <Bucket>newbucket0001</Bucket>
    -  <KeyMarker></KeyMarker>
    -  <UploadIdMarker>
    -  </UploadIdMarker>
    -  <Delimiter>object</Delimiter>
    -  <Prefix>multipart</Prefix>
    -  <MaxUploads>1000</MaxUploads>
    -  <IsTruncated>false</IsTruncated>
    -  <CommonPrefixes>
    -    <Prefix>multipart-object001</Prefix>
    -  </CommonPrefixes>
    +<ListMultipartUploadsResult xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <Bucket>newbucket0001</Bucket>
    +  <KeyMarker></KeyMarker>
    +  <UploadIdMarker>
    +  </UploadIdMarker>
    +  <Delimiter>object</Delimiter>
    +  <Prefix>multipart</Prefix>
    +  <MaxUploads>1000</MaxUploads>
    +  <IsTruncated>false</IsTruncated>
    +  <CommonPrefixes>
    +    <Prefix>multipart-object001</Prefix>
    +  </CommonPrefixes>
     </ListMultipartUploadsResult>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0098.html b/docs/obs/api-ref/obs_04_0098.html index 782d26380..ad147dc66 100644 --- a/docs/obs/api-ref/obs_04_0098.html +++ b/docs/obs/api-ref/obs_04_0098.html @@ -1,18 +1,19 @@ -

    Initializing a Multipart Task

    +

    Initiating a Multipart Upload

    Functions

    Before using this operation, make an API operation call to create a multipart upload task. The system will return a globally unique upload ID as the multipart upload identifier. This identifier can be used in subsequent requests including UploadPart, CompleteMultipartUpload, and ListParts. Create a multipart upload task does not affect the object that has the same name as object to be uploaded in multiple parts. You can create more than one multipart upload tasks for an object. This operation request can contain headers x-obs-acl, x-obs-meta-*, Content-Type, and Content-Encoding. The headers are recorded in the multipart upload metadata.

    This operation supports server-side encryption.

    -

    Request Syntax

    1
    -2
    -3
    -4
    POST /ObjectName?uploads  HTTP/1.1  
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: authorization
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    POST /ObjectName?uploads  HTTP/1.1  
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    + +

    Request Parameters

    This request uses parameters to specify a multipart upload. Table 1 describes the parameters.

    @@ -96,8 +97,8 @@ Authorization: authorization

    When initiating a multi-part upload task, you can add this header to specify the storage class for the object. If you do not use this header, the object storage class is the default storage class of the bucket.

    Type: string

    -

    Note: There are three storage classes: STANDARD (Standard storage class), WARM (Warm storage class), and COLD (Cold storage class). Therefore, this parameter value can be STANDARD, WARM, or COLD. These values are case sensitive.

    -

    Example: x-obs-storage-class: STANDARD

    +

    Storage class value options: STANDARD (Standard), WARM (Warm), COLD (Cold). These values are case sensitive.

    +

    Example: x-obs-storage-class: STANDARD

    No

    @@ -116,7 +117,7 @@ Authorization: authorization

    Indicates that SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    No. This header is required when SSE-KMS is used.

    @@ -128,7 +129,7 @@ Authorization: authorization

    The following two formats are supported:

    1. regionID:domainID:key/key_id

    2. key_id

    -

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    +

    regionID is the ID of the region to which the key belongs. domainID is the account ID of the tenant to which the key belongs. key_id is the key ID created in KMS.

    Example:

    1. x-obs-server-side-encryption-kms-key-id:region:domainiddomainiddomainiddoma0001:key/4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    2. x-obs-server-side-encryption-kms-key-id:4f1cd4de-ab64-4807-920a-47fc42e7f0d0

    @@ -140,7 +141,7 @@ Authorization: authorization

    Indicates an encryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -150,7 +151,7 @@ Authorization: authorization

    The key used to encrypt objects. The header is used in SSE-C mode. This key is used to encrypt objects.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used.

    @@ -160,7 +161,7 @@ Authorization: authorization

    Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used.

    @@ -170,7 +171,7 @@ Authorization: authorization

    Indicates the expiration time of an object, in days. An object will be automatically deleted once it expires (calculated from the last modification time of the object).

    Type: integer

    -

    Example: x-obs-expires:3

    +

    Example: x-obs-expires:3

    No

    @@ -182,29 +183,30 @@ Authorization: authorization

    Request Elements

    This request involves no elements.

    -

    Response Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    HTTP/1.1 status_code
    -Date: date
    -Content-Length: length
    -Connection: status
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    HTTP/1.1 status_code
    +Date: date
    +Content-Length: length
    +Connection: status
     
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<InitiateMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -    <Bucket>BucketName</Bucket>  
    -    <Key>ObjectName</Key>  
    -    <UploadId>uploadID</UploadId> 
    -</InitiateMultipartUploadResult> 
    -
    -
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<InitiateMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/"> + <Bucket>BucketName</Bucket> + <Key>ObjectName</Key> + <UploadId>uploadID</UploadId> +</InitiateMultipartUploadResult> +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -218,7 +220,7 @@ Connection: status

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -234,14 +236,14 @@ Connection: status

    Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    @@ -285,89 +287,93 @@ Connection: status

    Error Responses

    1. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.

    -

    2. If the bucket does not exist, OBS returns 404 Not Found and the error code is NoSuchBucket.

    +

    2. If the bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.

    3. Check whether the user has the write permission for the specified bucket. If no, OBS returns 403 Forbidden and the error code is AccessDenied.

    Other errors are included in Table 2.

    Sample Request 1

    Initialize a multipart task.

    -
    1
    -2
    -3
    -4
    POST /objectkey?uploads  HTTP/1.1 
    -Host: examplebucket.obs.region.example.com
    -Date: WED, 01 Jul 2015 05:14:52 GMT 
    -Authorization: OBS AKIAIOSFODNN7EXAMPLE:VGhpcyBtZXNzYWdlIHNpZ25lZGGieSRlbHZpbmc=
    -
    -
    -
    -

    Sample Response 1

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    HTTP/1.1 200 OK 
    -Server: OBS
    -x-obs-id-2: Weag1LuByRx9e6j5Onimru9pO4ZVKnJ2Qz7/C1NPcfTWAtRPfTaOFg== 
    -x-obs-request-id: 996c76696e6727732072657175657374 
    -Date: WED, 01 Jul 2015 05:14:52 GMT
    -Content-Length: 303
    +
    1
    +2
    +3
    +4
    POST /objectkey?uploads  HTTP/1.1 
    +Host: examplebucket.obs.region.example.com
    +Date: WED, 01 Jul 2015 05:14:52 GMT 
    +Authorization: OBS AKIAIOSFODNN7EXAMPLE:VGhpcyBtZXNzYWdlIHNpZ25lZGGieSRlbHZpbmc=
    +
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<InitiateMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/"> - <Bucket>bucketname</Bucket> - <Key>objectkey</Key> - <UploadId>DCD2FC98B4F70000013DF578ACA318E7</UploadId> +
    +
    +

    Sample Response 1

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    HTTP/1.1 200 OK 
    +Server: OBS
    +x-obs-id-2: Weag1LuByRx9e6j5Onimru9pO4ZVKnJ2Qz7/C1NPcfTWAtRPfTaOFg== 
    +x-obs-request-id: 996c76696e6727732072657175657374 
    +Date: WED, 01 Jul 2015 05:14:52 GMT
    +Content-Length: 303
    +
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<InitiateMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +  <Bucket>bucketname</Bucket>  
    +  <Key>objectkey</Key>  
    +  <UploadId>DCD2FC98B4F70000013DF578ACA318E7</UploadId> 
     </InitiateMultipartUploadResult>
    -
    -
    +
    + +

    Sample Request 2

    The ACL is carried when the multipart task is initialized.

    -
    1
    -2
    -3
    -4
    -5
    POST /objectkey?uploads  HTTP/1.1 
    -Host: examplebucket.obs.region.example.com
    -Date: WED, 01 Jul 2015 05:15:43 GMT
    +
    1
    +2
    +3
    +4
    +5
    POST /objectkey?uploads  HTTP/1.1 
    +Host: examplebucket.obs.region.example.com
    +Date: WED, 01 Jul 2015 05:15:43 GMT
     x-obs-grant-write-acp:ID=52f24s3593as5730ea4f722483579ai7,ID=a93fcas852f24s3596ea8366794f7224
    -Authorization: OBS AKIAIOSFODNN7EXAMPLE:VGhpcyBtZXNzYWdlIHNpZ25lZGGieSRlbHZpbmc=
    -
    -
    -
    -

    Sample Response 2

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    HTTP/1.1 200 OK 
    -Server: OBS
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTnv+daB51p+IVhAvWN7s5rSKhcWqDFs 
    -x-obs-request-id: BB78000001648457112DF37FDFADD7AD 
    -Date: WED, 01 Jul 2015 05:15:43 GMT
    -Content-Length: 303
    +Authorization: OBS AKIAIOSFODNN7EXAMPLE:VGhpcyBtZXNzYWdlIHNpZ25lZGGieSRlbHZpbmc=
    +
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<InitiateMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/"> - <Bucket>bucketname</Bucket> - <Key>objectkey</Key> - <UploadId>000001648453845DBB78F2340DD460D8</UploadId> +
    +
    +

    Sample Response 2

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    HTTP/1.1 200 OK 
    +Server: OBS
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTnv+daB51p+IVhAvWN7s5rSKhcWqDFs 
    +x-obs-request-id: BB78000001648457112DF37FDFADD7AD 
    +Date: WED, 01 Jul 2015 05:15:43 GMT
    +Content-Length: 303
    +
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<InitiateMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +  <Bucket>bucketname</Bucket>  
    +  <Key>objectkey</Key>  
    +  <UploadId>000001648453845DBB78F2340DD460D8</UploadId> 
     </InitiateMultipartUploadResult>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0099.html b/docs/obs/api-ref/obs_04_0099.html index 8b9e9ad54..f7c21fa29 100644 --- a/docs/obs/api-ref/obs_04_0099.html +++ b/docs/obs/api-ref/obs_04_0099.html @@ -59,7 +59,7 @@ Content-MD5:md5

    Indicates an encryption algorithm. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used. The encryption algorithm must be the same as that used to initiate multipart upload tasks.

    @@ -69,7 +69,7 @@ Content-MD5:md5

    Indicates a key used to encrypt objects. The header is used in SSE-C mode. This key is used to encrypt objects.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used. The key must be the same as that used to initiate multipart upload tasks.

    @@ -79,7 +79,7 @@ Content-MD5:md5

    Indicates the MD5 value of a key used to encrypt objects. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used. The MD5 value must be the same as that used to initiate multipart upload tasks.

    @@ -91,15 +91,16 @@ Content-MD5:md5

    Request Elements

    This request involves no elements.

    -

    Response Syntax

    1
    -2
    -3
    -4
    HTTP/1.1 status_code
    -Date: date
    -ETag: etag
    -Content-Length: length
    -
    -
    +

    Response Syntax

    1
    +2
    +3
    +4
    HTTP/1.1 status_code
    +Date: date
    +ETag: etag
    +Content-Length: length
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -113,7 +114,7 @@ Content-Length: length

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -129,14 +130,14 @@ Content-Length: length

    Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    @@ -145,7 +146,7 @@ Content-Length: length

    Response Elements

    This response involves no elements.

    -

    Error Responses

    1. If a part number is not within the range from 1 to 10000, OBS returns 400 Bad Request.
    2. If a part size has exceeded 5 GB, the error code 400 Bad Request is returned.
    3. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    4. Check whether the bucket exists. If the bucket does not exist, OBS returns 404 Not Found and the error code is NoSuchBucket.
    5. View the bucket ACL to check whether the user has the read permission for the requested bucket. If the user does not have the read permission, OBS returns 403 AccessDenied.
    6. Check whether the multipart upload task exists. If the task does not exist, OBS returns 404 Not Found and the error code is NoSuchUpload.
    7. Check whether the request user is the initiator of the multipart upload task. If not, OBS returns 403 Forbidden and the error code is AccessDenied.
    +

    Error Responses

    1. If a part number is not within the range from 1 to 10000, OBS returns 400 Bad Request.
    2. If a part size has exceeded 5 GB, the error code 400 Bad Request is returned.
    3. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    4. Check whether the bucket exists. If the bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.
    5. View the bucket ACL to check whether the user has the read permission for the requested bucket. If the user does not have the read permission, OBS returns 403 AccessDenied.
    6. Check whether the multipart upload task exists. If the task does not exist, OBS returns 404 Not Found and the error code is NoSuchUpload.
    7. Check whether the request user is the initiator of the multipart upload task. If not, OBS returns 403 Forbidden and the error code is AccessDenied.

    Other errors are included in Table 2.

    Sample Request

    PUT /object02?partNumber=1&uploadId=00000163D40171ED8DF4050919BD02B8 HTTP/1.1
    @@ -158,21 +159,22 @@ Content-Length: 102015348
     
     [102015348 Byte part content]
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    -6
    -7
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D40956A703289CA066F1
    -ETag: "b026324c6904b2a9cb4b88d6d61c81d1"
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCUQu/EOEVSMa04GXVwy0z9WI+BsDKvfh
    -Date: WED, 01 Jul 2015 05:15:55 GMT
    -Content-Length: 0
    -
    -
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    +6
    +7
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D40956A703289CA066F1
    +ETag: "b026324c6904b2a9cb4b88d6d61c81d1"
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCUQu/EOEVSMa04GXVwy0z9WI+BsDKvfh
    +Date: WED, 01 Jul 2015 05:15:55 GMT
    +Content-Length: 0
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0100.html b/docs/obs/api-ref/obs_04_0100.html index fb0d78616..f3399cbf4 100644 --- a/docs/obs/api-ref/obs_04_0100.html +++ b/docs/obs/api-ref/obs_04_0100.html @@ -7,7 +7,7 @@

    Copy the source object and save it as part1. If a part1 already exists before the copying, the original part1 will be overwritten by the newly copied part1. After the copy is successful, only the latest part1 is displayed. The old part1 data will be deleted. Therefore, ensure that the target part does not exist or has no value when using the part copy operation. Otherwise, data may be deleted by mistake. The source object in the copy process does not change.

    -

    OBS Cold Objects

    If source objects are Cold objects, check the restoration status of the objects. You can copy these objects only after they are restored. If the source object is not restored or is being restored, the copy fails and error 403 Forbidden is returned. The fault is described as follows:

    +

    Cold Objects

    If source objects are in the Cold storage class, ensure that these objects have been restored before you copy them. If the source object is not restored or is being restored, the copy fails and error 403 Forbidden is returned. The fault is described as follows:

    ErrorCode: InvalidObjectState

    ErrorMessage: Operation is not valid for the source object's storage class

    @@ -79,7 +79,7 @@ Content-Length: length

    Indicates an algorithm used to encrypt a destination part. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-server-side-encryption-customer-key and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used. The encryption algorithm must be the same as that used to initiate multipart upload tasks.

    @@ -89,7 +89,7 @@ Content-Length: length

    Indicates a key used to encrypt a destination part. The header is used in SSE-C mode. This key is used to encrypt objects.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used. The key must be the same as that used to initiate multipart upload tasks.

    @@ -99,7 +99,7 @@ Content-Length: length

    Indicates the MD5 value of a key used to encrypt a destination part. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-server-side-encryption-customer-algorithm and x-obs-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used. The MD5 value must be the same as that used to initiate multipart upload tasks.

    @@ -109,7 +109,7 @@ Content-Length: length

    Indicates an algorithm used by a source object. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-copy-source-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-copy-source-server-side-encryption-customer-algorithm:AES256

    Constraint: This header must be used together with x-obs-copy-source-server-side-encryption-customer-key and x-obs-copy-source-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used to copy a source object.

    @@ -119,7 +119,7 @@ Content-Length: length

    Indicates the algorithm used to decrypt a source object. The header is used in SSE-C mode.

    Type: string

    -

    Example: x-obs-copy-source-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-copy-source-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    Constraint: This header is a Base64-encoded 256-bit key and must be used together with x-obs-copy-source-server-side-encryption-customer-algorithm and x-obs-copy-source-server-side-encryption-customer-key-MD5.

    No. This header is required when SSE-C is used to copy a source object.

    @@ -129,7 +129,7 @@ Content-Length: length

    Indicates the MD5 value of the key used for the source object. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    Type: string

    -

    Example: x-obs-copy-source-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-copy-source-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    Constraint: This header is a Base64-encoded 128-bit MD5 value and must be used together with x-obs-copy-source-server-side-encryption-customer-algorithm and x-obs-copy-source-server-side-encryption-customer-key.

    No. This header is required when SSE-C is used to copy a source object.

    @@ -162,7 +162,7 @@ Date: date

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -178,14 +178,14 @@ Date: date

    Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of a key used to encrypt objects. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    @@ -227,33 +227,34 @@ Date: WED, 01 Jul 2015 05:16:32 GMT Authorization: OBS H4IPJX0TQTHTHEBQQCEC:dSnpnNpawDSsLg/xXxaqFzrAmMw= x-obs-copy-source: /destbucket/object01
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D40ABBD20405D30B0542
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTIJpD2efLy5o8sTTComwBb2He0j11Ne
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 05:16:32 GMT
    -Transfer-Encoding: chunked
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D40ABBD20405D30B0542
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTIJpD2efLy5o8sTTComwBb2He0j11Ne
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 05:16:32 GMT
    +Transfer-Encoding: chunked
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<CopyPartResult xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <LastModified>2015-07-01T05:16:32.344Z</LastModified>
    -  <ETag>"3b46eaf02d3b6b1206078bb86a7b7013"</ETag>
    +<CopyPartResult xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <LastModified>2015-07-01T05:16:32.344Z</LastModified>
    +  <ETag>"3b46eaf02d3b6b1206078bb86a7b7013"</ETag>
     </CopyPartResult>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0101.html b/docs/obs/api-ref/obs_04_0101.html index 23b822360..cd00cd9e0 100644 --- a/docs/obs/api-ref/obs_04_0101.html +++ b/docs/obs/api-ref/obs_04_0101.html @@ -54,61 +54,62 @@ Authorization: auth

    Request Elements

    This request involves no elements.

    -

    Response Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    HTTP/1.1 status_code
    -Date: date
    -Content-Length: length
    +

    Response Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    HTTP/1.1 status_code
    +Date: date
    +Content-Length: length
     
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<ListPartsResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -    <Bucket>BucketName</Bucket> 
    -    <Key>object</Key> 
    -    <UploadId>uploadid</UploadId> 
    -    <Initiator> 
    -        <ID>id</ID>  
    -    </Initiator> 
    -    <Owner> 
    -        <ID>ownerid</ID> 
    -    </Owner> 
    -    <StorageClass>storageclass</StorageClass> 
    -    <PartNumberMarker>partNmebermarker</PartNumberMarker> 
    -    <NextPartNumberMarker>nextPartnumberMarker</NextPartNumberMarker> 
    -    <MaxParts>maxParts</MaxParts> 
    -    <IsTruncated>true</IsTruncated> 
    -    <Part> 
    -        <PartNumber>partNumber</PartNumber> 
    -        <LastModified>modifiedDate</LastModified> 
    -        <ETag>etag</ETag> 
    -        <Size>size</Size> 
    -    </Part> 
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<ListPartsResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +    <Bucket>BucketName</Bucket> 
    +    <Key>object</Key> 
    +    <UploadId>uploadid</UploadId> 
    +    <Initiator> 
    +        <ID>id</ID>  
    +    </Initiator> 
    +    <Owner> 
    +        <ID>ownerid</ID> 
    +    </Owner> 
    +    <StorageClass>storageclass</StorageClass> 
    +    <PartNumberMarker>partNmebermarker</PartNumberMarker> 
    +    <NextPartNumberMarker>nextPartnumberMarker</NextPartNumberMarker> 
    +    <MaxParts>maxParts</MaxParts> 
    +    <IsTruncated>true</IsTruncated> 
    +    <Part> 
    +        <PartNumber>partNumber</PartNumber> 
    +        <LastModified>modifiedDate</LastModified> 
    +        <ETag>etag</ETag> 
    +        <Size>size</Size> 
    +    </Part> 
     </ListPartsResult>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    @@ -175,7 +176,7 @@ Content-Length: length

    StorageClass

    Indicates the storage type.

    -

    Type: enumeration

    +

    Type: string

    Value options: STANDARD | WARM | COLD

    Ancestor: ListPartsResult

    @@ -249,98 +250,100 @@ Content-Length: length
    -

    Error Responses

    1. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    2. If the requested bucket does not exist, OBS returns 404 Forbidden and the error code is NoSuchBucket.
    3. If the requested multipart upload task does not exist, OBS returns 404 Not Found and the error code is NoSuchUpload.
    4. OBS determines whether the use's domain ID has the read permission for the specified bucket. If the user does not have the permission, OBS returns 403 Forbidden and the error code is AccessDenied.
    +

    Error Responses

    1. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    2. If the requested bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.
    3. If the requested multipart upload task does not exist, OBS returns 404 Not Found and the error code is NoSuchUpload.
    4. OBS determines whether the use's domain ID has the read permission for the specified bucket. If the user does not have the permission, OBS returns 403 Forbidden and the error code is AccessDenied.

    Other errors are included in Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    GET /object02?uploadId=00000163D40171ED8DF4050919BD02B8 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 05:20:35 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:xkABdSrBPrz5yqzuZdJnK5oL/yU=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    GET /object02?uploadId=00000163D40171ED8DF4050919BD02B8 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 05:20:35 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:xkABdSrBPrz5yqzuZdJnK5oL/yU=
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D40C099A04EF4DD1BDD9
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSK71fr+hDnzB0JBvQC1B9+S12AWxC41
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 05:20:35 GMT
    -Content-Length: 888
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D40C099A04EF4DD1BDD9
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSK71fr+hDnzB0JBvQC1B9+S12AWxC41
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 05:20:35 GMT
    +Content-Length: 888
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<ListPartsResult xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <Bucket>test333</Bucket>
    -  <Key>obj2</Key>
    -  <UploadId>00000163D40171ED8DF4050919BD02B8</UploadId>
    -  <Initiator>
    -    <ID>domainID/domainiddomainiddomainiddo000008:userID/useriduseriduseriduseridus000008</ID>
    -  </Initiator>
    -  <Owner>
    -    <ID>domainiddomainiddomainiddo000008</ID>
    -  </Owner>
    -  <StorageClass>STANDARD</StorageClass>
    -  <PartNumberMarker>0</PartNumberMarker>
    -  <NextPartNumberMarker>2</NextPartNumberMarker>
    -  <MaxParts>1000</MaxParts>
    -  <IsTruncated>false</IsTruncated>
    -  <Part>
    -    <PartNumber>1</PartNumber>
    -    <LastModified>2018-06-06T07:39:32.522Z</LastModified>
    -    <ETag>"b026324c6904b2a9cb4b88d6d61c81d1"</ETag>
    -    <Size>2058462721</Size>
    -  </Part>
    -  <Part>
    -    <PartNumber>2</PartNumber>
    -    <LastModified>2018-06-06T07:41:03.344Z</LastModified>
    -    <ETag>"3b46eaf02d3b6b1206078bb86a7b7013"</ETag>
    -    <Size>4572</Size>
    -  </Part>
    +<ListPartsResult xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <Bucket>test333</Bucket>
    +  <Key>obj2</Key>
    +  <UploadId>00000163D40171ED8DF4050919BD02B8</UploadId>
    +  <Initiator>
    +    <ID>domainID/domainiddomainiddomainiddo000008:userID/useriduseriduseriduseridus000008</ID>
    +  </Initiator>
    +  <Owner>
    +    <ID>domainiddomainiddomainiddo000008</ID>
    +  </Owner>
    +  <StorageClass>STANDARD</StorageClass>
    +  <PartNumberMarker>0</PartNumberMarker>
    +  <NextPartNumberMarker>2</NextPartNumberMarker>
    +  <MaxParts>1000</MaxParts>
    +  <IsTruncated>false</IsTruncated>
    +  <Part>
    +    <PartNumber>1</PartNumber>
    +    <LastModified>2018-06-06T07:39:32.522Z</LastModified>
    +    <ETag>"b026324c6904b2a9cb4b88d6d61c81d1"</ETag>
    +    <Size>2058462721</Size>
    +  </Part>
    +  <Part>
    +    <PartNumber>2</PartNumber>
    +    <LastModified>2018-06-06T07:41:03.344Z</LastModified>
    +    <ETag>"3b46eaf02d3b6b1206078bb86a7b7013"</ETag>
    +    <Size>4572</Size>
    +  </Part>
     </ListPartsResult>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0102.html b/docs/obs/api-ref/obs_04_0102.html index 3c9ea5639..59c7035d3 100644 --- a/docs/obs/api-ref/obs_04_0102.html +++ b/docs/obs/api-ref/obs_04_0102.html @@ -1,6 +1,6 @@ -

    Merging Parts into a Complete Object

    +

    Completing a Multipart Upload

    Functions

    After uploading all parts for a multipart upload, you can use this operation to complete the multipart upload. Before performing this operation, you cannot download the uploaded data. When merging parts, you need to copy the additional message header information recorded during the initialization of the multipart upload task to the object metadata. The processing process is the same as that of the common upload object with these message headers. In the case of merging parts concurrently, the Last Write Win policy must be followed but the time for initiating Last Write is specified as the time when a part multipart upload is initiated.

    If a multipart upload has not been aborted, the uploaded parts occupy your storage quota. After all parts in the multipart upload are merged to an object, only the object occupies your storage quota. If a part uploaded in a multipart upload is not used in any merging parts multipart uploads, the part will be deleted to release storage quota.

    You can send a request for downloading all or some data of the generated multipart by specifying a range.

    @@ -12,45 +12,46 @@

    If 10 parts are uploaded but only nine parts are selected for merge, the parts that are not merged will be automatically deleted by the system. The parts that are not merged cannot be restored after being deleted. Before combining the parts, adopt the interface used to list the parts that have been uploaded to check all parts to ensure that no part is missed.

    -

    Request Syntax

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    POST /ObjectName?uploadId=uploadID HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Content-Length: length
    -Authorization: authorization
    -<CompleteMultipartUpload> 
    -    <Part> 
    -        <PartNumber>partNum</PartNumber> 
    -        <ETag>etag</ETag> 
    -    </Part> 
    -    <Part> 
    -        <PartNumber>partNum</PartNumber> 
    -        <ETag>etag</ETag> 
    -    </Part> 
    -    <Part> 
    -        <PartNumber>partNum</PartNumber> 
    -        <ETag>etag</ETag> 
    -    </Part> 
    +

    Request Syntax

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    POST /ObjectName?uploadId=uploadID HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Content-Length: length
    +Authorization: authorization
    +<CompleteMultipartUpload> 
    +    <Part> 
    +        <PartNumber>partNum</PartNumber> 
    +        <ETag>etag</ETag> 
    +    </Part> 
    +    <Part> 
    +        <PartNumber>partNum</PartNumber> 
    +        <ETag>etag</ETag> 
    +    </Part> 
    +    <Part> 
    +        <PartNumber>partNum</PartNumber> 
    +        <ETag>etag</ETag> 
    +    </Part> 
     </CompleteMultipartUpload>
    -
    -
    +
    + +

    Request Parameters

    This request uses parameters to specify the ID of a multipart upload whose parts will be merged. Table 1 describes the parameters.

    @@ -114,25 +115,26 @@ Authorization: authorization
    -

    Response Syntax

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 status_code
    -Date: date
    -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    -<CompleteMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    -    <Location>http://example-Bucket.obs.region.example.com/example-Object</Location> 
    -    <Bucket>bucketname</Bucket> 
    -    <Key>ObjectName</Key> 
    -    <ETag>ETag</ETag> 
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 status_code
    +Date: date
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    +<CompleteMultipartUploadResult xmlns="http://obs.region.example.com/doc/2015-06-30/">
    +    <Location>http://example-Bucket.obs.region.example.com/example-Object</Location> 
    +    <Bucket>bucketname</Bucket> 
    +    <Key>ObjectName</Key> 
    +    <ETag>ETag</ETag> 
     </CompleteMultipartUploadResult>
    -
    -
    +
    + +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    In addition to the common response headers, the following message headers may also be used. For details, see Table 3.

    @@ -153,7 +155,7 @@ Date: date

    This header is included in a response if SSE-KMS is used.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -169,7 +171,7 @@ Date: date

    Indicates an encryption algorithm. This header is included in a response if SSE-C is used.

    Type: string

    -

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm:AES256

    @@ -186,13 +188,13 @@ Date: date

    Location

    -

    URL of the object after parts being merged.

    +

    Path of the object after parts have been merged.

    Type: string

    Bucket

    -

    Bucket in which parts are combined

    +

    Bucket in which parts are merged.

    Type: string

    @@ -212,88 +214,90 @@ Date: date
    -

    Error Responses

    1. If no message body exists, OBS returns 400 Bad Request.
    2. If the message body format is incorrect, OBS returns 400 Bad Request.
    3. If the part information in the message body is not sorted by part sequence number, OBS returns 400 Bad Request and the error code is InvalidPartOrder.
    4. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    5. If the requested bucket does not exist, OBS returns 404 Not Found and the error code is NoSuchBucket.
    6. If the requested multipart upload does not exist, OBS returns 404 Not Found and error code NoSuchUpload.
    7. If the user is not the initiator of the task, OBS returns 403 Forbidden and the error code is AccessDenied.
    8. If the request part list contains a part that does not exist, OBS returns 400 Bad Request and the error code is InvalidPart.
    9. If the Etag of the part contained in the request part list is incorrect, OBS returns 400 Bad Request and the error code is InvalidPart.
    10. If the size of a part other than the last part is smaller than 100 KB, OBS returns 400 Bad Request.
    11. If the size of the object is greater than 48.8 TB after parts being merged, OBS returns status code 400 Bad Request.
    +

    Error Responses

    1. If no message body exists, OBS returns 400 Bad Request.
    2. If the message body format is incorrect, OBS returns 400 Bad Request.
    3. If the part information in the message body is not sorted by part sequence number, OBS returns 400 Bad Request and the error code is InvalidPartOrder.
    4. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    5. If the requested bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.
    6. If the requested multipart upload does not exist, OBS returns 404 Not Found and error code NoSuchUpload.
    7. If the user is not the initiator of the task, OBS returns 403 Forbidden and the error code is AccessDenied.
    8. If the request part list contains a part that does not exist, OBS returns 400 Bad Request and the error code is InvalidPart.
    9. If the Etag of the part contained in the request part list is incorrect, OBS returns 400 Bad Request and the error code is InvalidPart.
    10. If the size of a part other than the last part is smaller than 100 KB, OBS returns 400 Bad Request.
    11. If the size of the object is greater than 48.8 TB after parts being merged, OBS returns status code 400 Bad Request.

    Other errors are included in Table 2.

    -

    Sample Request

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    POST /object02?uploadId=00000163D46218698DF407362295674C HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 05:23:46 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:dOfK9iILcKxo58tRp3fWeDoYzKA=
    -Content-Length: 422
    +

    Sample Request

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    POST /object02?uploadId=00000163D46218698DF407362295674C HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 05:23:46 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:dOfK9iILcKxo58tRp3fWeDoYzKA=
    +Content-Length: 422
     
     <?xml version="1.0" encoding="utf-8"?>
    -<CompleteMultipartUpload> 
    -  <Part> 
    -    <PartNumber>1</PartNumber>  
    -    <ETag>a54357aff0632cce46d942af68356b38</ETag> 
    -  </Part>  
    -  <Part> 
    -    <PartNumber>2</PartNumber>  
    -    <ETag>0c78aef83f66abc1fa1e8477f296d394</ETag> 
    -  </Part>  
    -  <Part> 
    -    <PartNumber>3</PartNumber>  
    -    <ETag>acbd18db4cc2f85cedef654fccc4a4d8</ETag> 
    -  </Part>
    +<CompleteMultipartUpload> 
    +  <Part> 
    +    <PartNumber>1</PartNumber>  
    +    <ETag>a54357aff0632cce46d942af68356b38</ETag> 
    +  </Part>  
    +  <Part> 
    +    <PartNumber>2</PartNumber>  
    +    <ETag>0c78aef83f66abc1fa1e8477f296d394</ETag> 
    +  </Part>  
    +  <Part> 
    +    <PartNumber>3</PartNumber>  
    +    <ETag>acbd18db4cc2f85cedef654fccc4a4d8</ETag> 
    +  </Part>
     </CompleteMultipartUpload>
    -
    -
    +
    +
    -

    Sample Response

     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D4625BE3075019BD02B8
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSN8D1AfQcIvyGBZ9+Ee+jU6zv1iYdO4
    -Content-Type: application/xml
    -Date: WED, 01 Jul 2015 05:23:46 GMT
    -Content-Length: 326
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D4625BE3075019BD02B8
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSN8D1AfQcIvyGBZ9+Ee+jU6zv1iYdO4
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 05:23:46 GMT
    +Content-Length: 326
     
     <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    -<CompleteMultipartUploadResult xmlns="http://obs.example.com/doc/2015-06-30/">
    -  <Location>/examplebucket/object02</Location>
    -  <Bucket>examplebucket</Bucket>
    -  <Key>object02</Key>
    -  <ETag>"03f814825e5a691489b947a2e120b2d3-3"</ETag>
    +<CompleteMultipartUploadResult xmlns="http://obs.example.com/doc/2015-06-30/">
    +  <Location>/examplebucket/object02</Location>
    +  <Bucket>examplebucket</Bucket>
    +  <Key>object02</Key>
    +  <ETag>"03f814825e5a691489b947a2e120b2d3-3"</ETag>
     </CompleteMultipartUploadResult>
    -
    -
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0103.html b/docs/obs/api-ref/obs_04_0103.html index 4e5389cc9..2908ace6a 100644 --- a/docs/obs/api-ref/obs_04_0103.html +++ b/docs/obs/api-ref/obs_04_0103.html @@ -3,15 +3,16 @@

    Canceling a Multipart Upload Task

    Functions

    You can perform this operation to abort a multipart upload. You cannot upload or list parts after operations to merge parts or abort a multipart upload are performed.

    -

    Request Syntax

    1
    -2
    -3
    -4
    DELETE /ObjectName?uploadId=uplaodID HTTP/1.1 
    -Host: bucketname.obs.region.example.com
    -Date: date
    -Authorization: auth
    -
    -
    +

    Request Syntax

    1
    +2
    +3
    +4
    DELETE /ObjectName?uploadId=uplaodID HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: auth
    +
    + +

    Request Parameters

    This request uses message parameters to specify the multipart upload task number of the segment task. Table 1 describes the parameters.

    @@ -46,34 +47,36 @@ Date: date

    Response Elements

    This response involves no elements.

    -

    Error Responses

    1. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    2. If the requested bucket does not exist, OBS returns 404 Not Found and the error code is NoSuchBucket.
    3. If you are neither the initiator of a multipart upload nor the bucket owner, OBS returns 403 Forbidden.
    4. If the operation is successful, OBS returns 204 No Content to the user.
    +

    Error Responses

    1. If the AK or signature is invalid, OBS returns 403 Forbidden and the error code is AccessDenied.
    2. If the requested bucket is not found, OBS returns 404 Not Found and the error code is NoSuchBucket.
    3. If you are neither the initiator of a multipart upload nor the bucket owner, OBS returns 403 Forbidden.
    4. If the operation is successful, OBS returns 204 No Content to the user.

    Other errors are included in Table 2.

    -

    Sample Request

    1
    -2
    -3
    -4
    -5
    -6
    DELETE /object02?uploadId=00000163D46218698DF407362295674C HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: WED, 01 Jul 2015 05:28:27 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:QmM2d1DBXZ/b8drqtEv1QJHPbM0=
    -
    -
    +

    Sample Request

    1
    +2
    +3
    +4
    +5
    +6
    DELETE /object02?uploadId=00000163D46218698DF407362295674C HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 05:28:27 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:QmM2d1DBXZ/b8drqtEv1QJHPbM0=
    +
    + +
    +
    +

    Sample Response

    1
    +2
    +3
    +4
    +5
    HTTP/1.1 204 No Content
    +Server: OBS
    +x-obs-request-id: 8DF400000163D463E02A07EC2295674C
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTp5YDlzn0UgqG3laRfkHLGyz7RpR9ON
    +Date: WED, 01 Jul 2015 05:28:27 GMT
    +
    +
    -

    Sample Response

    1
    -2
    -3
    -4
    -5
    HTTP/1.1 204 No Content
    -Server: OBS
    -x-obs-request-id: 8DF400000163D463E02A07EC2295674C
    -x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCTp5YDlzn0UgqG3laRfkHLGyz7RpR9ON
    -Date: WED, 01 Jul 2015 05:28:27 GMT
    -
    -
    diff --git a/docs/obs/api-ref/obs_04_0106.html b/docs/obs/api-ref/obs_04_0106.html index 3619dbc44..0800d532f 100644 --- a/docs/obs/api-ref/obs_04_0106.html +++ b/docs/obs/api-ref/obs_04_0106.html @@ -15,7 +15,7 @@

    Indicates that SSE-KMS is used. Objects are encrypted using SSE-KMS.

    Type: string

    -

    Example: x-obs-server-side-encryption:kms

    +

    Example: x-obs-server-side-encryption:kms

    x-obs-server-side-encryption-kms-key-id

    @@ -35,7 +35,7 @@

    API operations to which the newly added headers apply:

    -
    • PUT operation for uploading objects
    • POST operation for uploading objects (x-obs-server-side-encryption and x-obs-server-side-encryption-kms-key-id need to be placed in the table instead of the header field)
    • PutObject-Copy (the newly added headers apply to target objects)
    • API operations for initiating a multipart upload task
    +
    • PUT operation for uploading objects
    • POST operation for uploading objects (x-obs-server-side-encryption and x-obs-server-side-encryption-kms-key-id need to be placed in the form instead of the header)
    • PutObject-Copy (the newly added headers apply to target objects)
    • API operations for initiating a multipart upload task

    OBS supports bucket policies. You can use a bucket policy to implement server-side encryption on all the objects stored in a bucket. For example, a tenant's object upload request does not contain the header x-obs-server-side-encryption:"kms" for server-side encryption (SSE-KMS), the following bucket policy will reject the upload request.

    {
     "Statement":[{
    @@ -52,137 +52,143 @@
     }
     }

    Sample Request 1

    Use the default key to encrypt the uploaded object.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    PUT /encryp1 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: Wed, 06 Jun 2018 09:08:21 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:f3/7eS6MFbW3JO4+7I5AtyAQENU=
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    PUT /encryp1 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: Wed, 06 Jun 2018 09:08:21 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:f3/7eS6MFbW3JO4+7I5AtyAQENU=
     x-obs-server-side-encryption:kms
    -Content-Length: 5242
    -Expect: 100-continue
    +Content-Length: 5242
    +Expect: 100-continue
    +
    +[5242 Byte object contents]
    +
    + +
    +
    +

    Sample Response 1

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D45AA81D038B6AE4C482
    +ETag: "d8bffdfbab5345d91ac05141789d2477"
    +x-obs-server-side-encryption: kms
    +x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTv7cHmAnGfBAGXUHeibUsiETTNqlCqC
    +Date: Wed, 06 Jun 2018 09:08:21 GMT
    +Content-Length: 0
    +
    -[5242 Byte object contents] -
    -
    -

    Sample Response 1

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D45AA81D038B6AE4C482
    -ETag: "d8bffdfbab5345d91ac05141789d2477"
    -x-obs-server-side-encryption: kms
    -x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTv7cHmAnGfBAGXUHeibUsiETTNqlCqC
    -Date: Wed, 06 Jun 2018 09:08:21 GMT
    -Content-Length: 0
    -
    -

    Sample Request 2

    Use a specified key to encrypt the uploaded object.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    PUT /encryp1 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: Wed, 06 Jun 2018 09:08:50 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:f3/PWjkXYTYGs5lPOctTNEI2QENU=
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    PUT /encryp1 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: Wed, 06 Jun 2018 09:08:50 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:f3/PWjkXYTYGs5lPOctTNEI2QENU=
     x-obs-server-side-encryption:kms
    -x-obs-server-side-encryption-kms-key-id: 522d6070-5ad3-4765-43a7-a7d1-ab21f498482d
    -Content-Length: 5242
    -Expect: 100-continue
    +x-obs-server-side-encryption-kms-key-id: 522d6070-5ad3-4765-43a7-a7d1-ab21f498482d
    +Content-Length: 5242
    +Expect: 100-continue
     
    -[5242 Byte object contents]
    -
    -
    -

    Sample Response 2

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D45AA81D038B6AE4C482
    -ETag: "d8bffdfbab5345d91ac05141789d2477"
    -x-obs-server-side-encryption: kms
    -x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-43a7-a7d1-ab21f498482d
    -x-obs-id-2: 32AAAUJAIAABAdiAEAABA09AEAABCTv7cHmAn12BAG83ibUsiET5eqlCqg
    -Date: Wed, 06 Jun 2018 09:08:50 GMT
    -Content-Length: 0
    -
    -
    +[5242 Byte object contents] +
    + +
    +

    Sample Response 2

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D45AA81D038B6AE4C482
    +ETag: "d8bffdfbab5345d91ac05141789d2477"
    +x-obs-server-side-encryption: kms
    +x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-43a7-a7d1-ab21f498482d
    +x-obs-id-2: 32AAAUJAIAABAdiAEAABA09AEAABCTv7cHmAn12BAG83ibUsiET5eqlCqg
    +Date: Wed, 06 Jun 2018 09:08:50 GMT
    +Content-Length: 0
    +
    + +

    Sample Request 3

    Copy a common object and save it as an encrypted object by encrypting it using a specified key.

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    PUT /destobject HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    PUT /destobject HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
     x-obs-server-side-encryption:kms
    -x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    -Accept: */*
    -Date: Wed, 06 Jun 2018 09:10:29 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:SH3uTrElaGWarVI1uTq325kTVCI=
    -x-obs-copy-source: /bucket/srcobject1
    -
    -
    +x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb +Accept: */* +Date: Wed, 06 Jun 2018 09:10:29 GMT +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:SH3uTrElaGWarVI1uTq325kTVCI= +x-obs-copy-source: /bucket/srcobject1 +
    + +
    +
    +

    Sample Response 3

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BB78000001648480AF3900CED7F15155
    +ETag: "d8bffdfbab5345d91ac05141789d2477"
    +x-obs-server-side-encryption: kms
    +x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    +x-obs-id-2: oRAXhgwdaLc9wKVHqTLSmQB7I35D+32AAAUJAIAABAAAQAAEAABAAAQAAEAABCS
    +Date: Wed, 06 Jun 2018 09:10:29 GMT
    +Content-Length: 0
    +
    +
    -

    Sample Response 3

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BB78000001648480AF3900CED7F15155
    -ETag: "d8bffdfbab5345d91ac05141789d2477"
    -x-obs-server-side-encryption: kms
    -x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    -x-obs-id-2: oRAXhgwdaLc9wKVHqTLSmQB7I35D+32AAAUJAIAABAAAQAAEAABAAAQAAEAABCS
    -Date: Wed, 06 Jun 2018 09:10:29 GMT
    -Content-Length: 0
    -
    -

    Sample Request 4

    Carry the signature in the URL and upload the encrypted object.

    PUT /destobject?AccessKeyId=UI3SN1SRUQE14OYBKTZB&Expires=1534152518&x-obs-server-side-encryption=kms&Signature=chvmG7%2FDA%2FDCQmTRJu3xngldJpg%3D HTTP/1.1
    @@ -191,25 +197,26 @@ Host: examplebucket.obs.region.example
     Accept: */*
     Date: Wed, 06 Jun 2018 09:10:29 GMT
    -

    Sample Response 4

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BB78000001648480AF3900CED7F15155
    -ETag: "d8bffdfbab5345d91ac05141789d2477"
    -x-obs-server-side-encryption: kms
    -x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    -x-obs-id-2: oRAXhgwdaLc9wKVHqTLSmQB7I35D+32AAAUJAIAABAAAQAAEAABAAAQAAEAABCS
    -Date: Wed, 06 Jun 2018 09:10:29 GMT
    -Content-Length: 0
    -
    -
    +

    Sample Response 4

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BB78000001648480AF3900CED7F15155
    +ETag: "d8bffdfbab5345d91ac05141789d2477"
    +x-obs-server-side-encryption: kms
    +x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    +x-obs-id-2: oRAXhgwdaLc9wKVHqTLSmQB7I35D+32AAAUJAIAABAAAQAAEAABAAAQAAEAABCS
    +Date: Wed, 06 Jun 2018 09:10:29 GMT
    +Content-Length: 0
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0107.html b/docs/obs/api-ref/obs_04_0107.html index 207ad13ac..06a20b108 100644 --- a/docs/obs/api-ref/obs_04_0107.html +++ b/docs/obs/api-ref/obs_04_0107.html @@ -14,19 +14,19 @@

    x-obs-server-side-encryption-customer-algorithm

    Indicates an encryption algorithm. The header is used in SSE-C mode.

    -

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    x-obs-server-side-encryption-customer-key

    Indicates the key used to encrypt objects in SSE-C mode. The header value is a Base64-encoded 256-bit key.

    -

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    x-obs-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of the key used to encrypt an object. The header is used in SSE-C mode. The value of the element is an MD5 Base64-encoded hash. The MD5 value is used to check whether any error occurs during the transmission of the key.

    -

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==

    @@ -46,121 +46,125 @@

    x-obs-copy-source-server-side-encryption-customer-algorithm

    Indicates the algorithm used to decrypt a source object. The header is used in SSE-C mode.

    -

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    +

    Example: x-obs-server-side-encryption-customer-algorithm: AES256

    x-obs-copy-source-server-side-encryption-customer-key

    Indicates the key used to decrypt a source object. The header is used in SSE-C mode.

    -

    Example: x-obs-copy-source-server-side-encryption-customer-algorithm: K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    +

    Example: x-obs-copy-source-server-side-encryption-customer-algorithm: K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=

    x-obs-copy-source-server-side-encryption-customer-key-MD5

    Indicates the MD5 value of the key used to decrypt a source object. The header is used in SSE-C mode. The MD5 value is used to check whether any error occurs during the transmission of the key.

    -

    Example: x-obs-copy-source-server-side-encryption-customer-key:4XvB3tbNTN+tIEVa0/fGaQ==

    +

    Example: x-obs-copy-source-server-side-encryption-customer-key:4XvB3tbNTN+tIEVa0/fGaQ==

    Sample Request 1

    Upload an object with the SSE-C encryption mode.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    PUT /encryp2 HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: Wed, 06 Jun 2018 09:12:00 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mZSfafoM+llApk0HGOThlqeccu0=
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    PUT /encryp2 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: Wed, 06 Jun 2018 09:12:00 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mZSfafoM+llApk0HGOThlqeccu0=
     x-obs-server-side-encryption-customer-algorithm:AES256
     x-obs-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=
     x-obs-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==
    -Content-Length: 5242
    +Content-Length: 5242
    +
    +[5242 Byte object contents]
    +
    + +
    +
    +

    Sample Response 1

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 8DF400000163D45E0017055619BD02B8
    +ETag: "0f91242c7f3d86f98ae572a686d0696e"
    +x-obs-server-side-encryption-customer-algorithm: AES256
    +x-obs-server-side-encryption-customer-key-MD5: 4XvB3tbNTN+tIEVa0/fGaQ==
    +x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSSAJ8bTNJV0X+Ote1PtuWecqyMh6zBJ
    +Date: Wed, 06 Jun 2018 09:12:00 GMT
    +Content-Length: 0
    +
    -[5242 Byte object contents] -
    -
    -

    Sample Response 1

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 8DF400000163D45E0017055619BD02B8
    -ETag: "0f91242c7f3d86f98ae572a686d0696e"
    -x-obs-server-side-encryption-customer-algorithm: AES256
    -x-obs-server-side-encryption-customer-key-MD5: 4XvB3tbNTN+tIEVa0/fGaQ==
    -x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSSAJ8bTNJV0X+Ote1PtuWecqyMh6zBJ
    -Date: Wed, 06 Jun 2018 09:12:00 GMT
    -Content-Length: 0
    -
    -

    Sample Request 2

    Copy the SSE-C encrypted object and save it as the KMS encrypted object.

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    PUT /kmsobject HTTP/1.1
    -User-Agent: curl/7.29.0
    -Host: examplebucket.obs.region.example.com
    -Accept: */*
    -Date: Wed, 06 Jun 2018 09:20:10 GMT
    -Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mZSfafoM+llApk0HGOThlqeccu0=
    +
     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    PUT /kmsobject HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: Wed, 06 Jun 2018 09:20:10 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:mZSfafoM+llApk0HGOThlqeccu0=
     x-obs-copy-source-server-side-encryption-customer-algorithm:AES256
     x-obs-copy-source-server-side-encryption-customer-key:K7QkYpBkM5+hca27fsNkUnNVaobncnLht/rCB2o/9Cw=
     x-obs-copy-source-server-side-encryption-customer-key-MD5:4XvB3tbNTN+tIEVa0/fGaQ==
    -x-obs-server-side-encryption: kms
    -x-obs-copy-source: /examplebucket/encryp2
    -Content-Length: 5242
    +x-obs-server-side-encryption: kms
    +x-obs-copy-source: /examplebucket/encryp2
    +Content-Length: 5242
    +
    +[5242 Byte object contents]
    +
    + +
    +
    +

    Sample Response 2

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BB7800000164848E0FC70528B9D92C41
    +ETag: "1072e1b96b47d7ec859710068aa70d57"
    +x-obs-server-side-encryption: kms
    +x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTkkRzQXs9ECzZcavVRncBqqYNkoAEsr
    +Date: Wed, 06 Jun 2018 09:20:10 GMT
    +Content-Length: 0
    +
    -[5242 Byte object contents] -
    -
    -

    Sample Response 2

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: BB7800000164848E0FC70528B9D92C41
    -ETag: "1072e1b96b47d7ec859710068aa70d57"
    -x-obs-server-side-encryption: kms
    -x-obs-server-side-encryption-kms-key-id: region:783fc6652cf246c096ea836694f71855:key/522d6070-5ad3-4765-9737-9312ddc72cdb
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTkkRzQXs9ECzZcavVRncBqqYNkoAEsr
    -Date: Wed, 06 Jun 2018 09:20:10 GMT
    -Content-Length: 0
    -
    -

    Sample Request 3

    The URL contains the signature and the SSE-C encrypted object is uploaded.

    PUT /encrypobject?AccessKeyId=H4IPJX0TQTHTHEBQQCEC&Expires=1532688887&Signature=EQmDuOhaLUrzrzRNZxwS72CXeXM%3D HTTP/1.1
    @@ -175,25 +179,26 @@ Expect: 100-continue
     
     [5242 Byte object contents]
    -

    Sample Response 3

    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    HTTP/1.1 100 Continue
    -HTTP/1.1 200 OK
    -Server: OBS
    -x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    -ETag: "1072e1b96b47d7ec859710068aa70d57"
    -x-obs-server-side-encryption-customer-algorithm: AES256
    -x-obs-server-side-encryption-customer-key-MD5: 4XvB3tbNTN+tIEVa0/fGaQ==
    -x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    -Content-Length: 0
    -
    -
    +

    Sample Response 3

    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    HTTP/1.1 100 Continue
    +HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: 804F00000164DB5E5B7FB908D3BA8E00
    +ETag: "1072e1b96b47d7ec859710068aa70d57"
    +x-obs-server-side-encryption-customer-algorithm: AES256
    +x-obs-server-side-encryption-customer-key-MD5: 4XvB3tbNTN+tIEVa0/fGaQ==
    +x-obs-id-2: 32AAAUJAIAABAAAQAAEAABAAAQAAEAABCTlpxILjhVK/heKOWIP8Wn2IWmQoerfw
    +Content-Length: 0
    +
    + +
    diff --git a/docs/obs/api-ref/obs_04_0115.html b/docs/obs/api-ref/obs_04_0115.html index 3d2432c27..21a0d8fd5 100644 --- a/docs/obs/api-ref/obs_04_0115.html +++ b/docs/obs/api-ref/obs_04_0115.html @@ -6,25 +6,26 @@
    • Content-Type: application/xml
    • HTTP error status code 3xx, 4xx, or 5xx

    The response body also contains information about the error. The following is an error response example that shows common elements in the Representational State Transfer (REST) error response body.

    -
    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    <?xml version="1.0" encoding="UTF-8"?> 
    -<Error> 
    -<Code>NoSuchKey</Code> 
    -<Message>The resource you requested does not exist</Message> 
    -<Resource>/example-bucket/object</Resource> 
    -<RequestId>001B21A61C6C0000013402C4616D5285</RequestId> 
    -<HostId>RkRCRDJENDc5MzdGQkQ4OUY3MTI4NTQ3NDk2Mjg0M0FB 
    -QUFBQUFBYmJiYmJiYmJD</HostId> 
    +
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    <?xml version="1.0" encoding="UTF-8"?> 
    +<Error> 
    +<Code>NoSuchKey</Code> 
    +<Message>The resource you requested does not exist</Message> 
    +<Resource>/example-bucket/object</Resource> 
    +<RequestId>001B21A61C6C0000013402C4616D5285</RequestId> 
    +<HostId>RkRCRDJENDc5MzdGQkQ4OUY3MTI4NTQ3NDk2Mjg0M0FB 
    +QUFBQUFBYmJiYmJiYmJD</HostId> 
     </Error>
    -
    -
    +
    + +

    Table 1 describes the meaning of each element.

    @@ -778,6 +779,15 @@ QUFBQUFBYmJiYmJiYmJD</HostId>

    Modify according to the condition prompt in the returned message body.

    +

    414 URI Too Long

    + +

    Request-URI Too Large

    + +

    The URI used in the request was too long.

    + +

    Shorten the URI length.

    + +

    416 Client Requested Range Not Satisfiable

    InvalidRange

    diff --git a/docs/obs/api-ref/obs_04_0117.html b/docs/obs/api-ref/obs_04_0117.html index d4ab7e177..bf2b29ccf 100644 --- a/docs/obs/api-ref/obs_04_0117.html +++ b/docs/obs/api-ref/obs_04_0117.html @@ -1,7 +1,7 @@

    Obtaining the Domain ID and User ID

    -

    When an API is called, the domain ID (DomainID) and user ID (UserID) need to be specified in some requests. Therefore, you need to obtain them from the console. The procedure is as follows:

    +

    During API calls, the domain ID (DomainID) and user ID (UserID) need to be specified in some requests. Therefore, you need to obtain them from the console. The procedure is as follows:

    1. Log in to the console.
    2. Click the username and select My Credentials from the drop-down list.

      On the My Credentials page, view the domain ID and user ID.

    diff --git a/docs/obs/api-ref/obs_04_0160.html b/docs/obs/api-ref/obs_04_0160.html new file mode 100644 index 000000000..8e4efd711 --- /dev/null +++ b/docs/obs/api-ref/obs_04_0160.html @@ -0,0 +1,335 @@ + + +

    Listing Objects in a Bucket (V2)

    +

    Functions

    This operation lists objects in a bucket. To use this operation, you must have the permission to read the bucket.

    +

    If the bucket name is specified in a request URI and list-type is explicitly set to 2, that is, GET /?list-type is set to 2, descriptions of some or all objects in the bucket is returned in the format of the V2 API. Information about a maximum of 1000 objects can be returned at a time. If one or more of the prefix, encoding-type, max-keys, delimiter, fetch-owner, start-after, and continuation-token parameters are also specified, the specified objects are returned based on the syntax described in Table 1.

    +
    +

    Request Syntax

    1
    +2
    +3
    +4
    GET /?list-type=2 HTTP/1.1 
    +Host: bucketname.obs.region.example.com
    +Date: date
    +Authorization: authorization
    +
    + +
    +
    +

    Request Parameters

    This request uses parameters to list some objects in a bucket. Specific parameters are described in the following table.

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 1 Request parameters

    Parameter

    +

    Description

    +

    Mandatory

    +

    list-type

    +

    It can be set to 2 only, indicating that the ListObjectV2 API is used.

    +

    Type: integer

    +

    Yes

    +

    prefix

    +

    Lists objects that begin with the specified prefix.

    +

    Type: string

    +

    No

    +

    start-after

    +

    Specifies a marker when listing objects in a bucket. With a marker configured, objects after this marker will be returned in alphabetical order.

    +

    Type: string

    +

    No

    +

    max-keys

    +

    Sets the maximum number of objects returned (in alphabetical order) in the response. The value ranges from 1 to 1000. If there are over 1,000 objects, only 1,000 objects are returned by default.

    +

    Type: integer

    +

    No

    +

    delimiter

    +

    Separator used to group object names. If a prefix is specified, objects with the same string from the prefix to the first delimiter are grouped into one CommonPrefixes. If no prefix is specified, objects with the same string from the first character to the first delimiter are grouped into one CommonPrefixes.

    +

    For example, there are three objects (abcd, abcde, and bbcde) in a bucket. If delimiter is set to d and prefix is set to a, objects abcd and abcde are grouped into a CommonPrefixes with abcd as the prefix. If only delimiter is set to d, objects abcd and abcde are grouped into a CommonPrefixes with abcd as the prefix, and bbcde is grouped separately into another CommonPrefixes with bbcd as the prefix.

    +

    Type: string

    +

    No

    +

    continuation-token

    +

    Specifies the token after which objects are returned in alphabetical order.

    +

    Type: string

    +

    Valid value: value of NextContinuationToken in the response body of the last request

    +

    No

    +

    fetch-owner

    +

    Specifies whether to return the object owner information.

    +

    Type: boolean

    +

    Optional value: true or false

    +

    No

    +
    +
    +
    +

    Request Headers

    This request uses common request headers. For details, see Table 3.

    +
    +

    Request Elements

    This request contains no elements.

    +
    +

    Response Syntax

    1
    +2
    +3
    +4
    +5
    +6
    HTTP/1.1 status_code
    +Date: date
    +x-obs-bucket-location: region
    +Content-Type: application/xml 
    +Content-Length: length
    +<Response Body>
    +
    + +
    +
    +

    Response Headers

    The response to the request uses common headers. For details, see Table 1.

    +
    +

    Response Elements

    This response lists objects in the XML format. Specific elements are described in Table 2.

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 2 Response elements

    Element

    +

    Description

    +

    ListBucketResult

    +

    A list of objects in a bucket

    +

    Type: XML

    +

    Contents

    +

    Object metadata

    +

    Type: XML

    +

    Ancestor: ListBucketResult

    +

    CommonPrefixes

    +

    Group information. If you specify a delimiter in the request, the response contains group information in CommonPrefixes.

    +

    Type: XML

    +

    Ancestor: ListBucketResult

    +

    ContinuationToken

    +

    Parameter ContinuationToken specified in a request

    +

    Type: string

    +

    Ancestor: ListBucketResult

    +

    KeyCount

    +

    Number of objects returned

    +

    Type: integer

    +

    Ancestor: ListBucketResult

    +

    NextContinuationToken

    +

    ContinuationToken is returned when not all the objects are listed. The next list requests can be continued with this ContinuationToken.

    +

    Type: string

    +

    Ancestor: ListVersionsResult

    +

    StartAfter

    +

    Parameter StartAfter specified in a request

    +

    Delimiter

    +

    Parameter delimiter specified in a request

    +

    Type: string

    +

    Ancestor: ListBucketResult

    +

    ETag

    +

    Base64-encoded 128-bit MD5 digest of an object. ETag is the unique identifier of the object content. It can be used to determine whether the object content is changed. For example, if the ETag value is A when an object is uploaded, but this value has changed to B when the object is downloaded, it indicates that the object content has been changed. The ETag value is a hash of the object. The ETag reflects changes only to the object content, rather than its metadata. An uploaded object or copied object has a unique ETag after being encrypted using MD5. (If the object is encrypted on the server side, the ETag value is not the MD5 digest of the object, but the unique identifier calculated through server-side encryption.)

    +

    Type: string

    +

    Ancestor: ListBucketResult.Contents

    +

    Type

    +

    Object type. This parameter is returned when the object type is not Normal.

    +

    Type: string

    +

    Ancestor: ListBucketResult.Contents

    +

    ID

    +

    Tenant ID of the object owner

    +

    Type: string

    +

    Ancestor: ListBucketResult.Contents.Owner

    +

    IsTruncated

    +

    Determines whether the returned list of objects is truncated. The value true indicates that the list was truncated and false indicates that the list was not truncated.

    +

    Type: boolean

    +

    Ancestor: ListBucketResult

    +

    Key

    +

    Object name

    +

    Type: string

    +

    Ancestor: ListBucketResult.Contents

    +

    LastModified

    +

    Time (UTC) when an object was last modified

    +

    Type: date

    +

    Ancestor: ListBucketResult.Contents

    +

    MaxKeys

    +

    Maximum number of objects returned

    +

    Type: string

    +

    Ancestor: ListBucketResult

    +

    Name

    +

    Name of the requested bucket

    +

    Type: string

    +

    Ancestor: ListBucketResult

    +

    Owner

    +

    User information, including the domain ID and username

    +

    Type: XML

    +

    Ancestor: ListBucketResult.Contents

    +

    Prefix

    +

    Prefix of an object name. Only objects whose names have this prefix are listed.

    +

    Type: string

    +

    Ancestor: ListBucketResult

    +

    Size

    +

    Object size in bytes

    +

    Type: string

    +

    Ancestor: ListBucketResult.Contents

    +

    StorageClass

    +

    Storage class of an object

    +

    Type: string

    +

    Value options: STANDARD | WARM | COLD

    +

    Ancestor: ListBucketResult.Contents

    +
    +
    +
    +

    Error Responses

    No special error responses are returned. For details about error responses, see Table 2.

    +
    +

    Sample Request

    List all objects.

    +
    1
    +2
    +3
    +4
    +5
    +6
    GET /?list-type=2 HTTP/1.1
    +User-Agent: curl/7.29.0
    +Host: examplebucket.obs.region.example.com
    +Accept: */*
    +Date: WED, 01 Jul 2015 02:28:25 GMT
    +Authorization: OBS H4IPJX0TQTHTHEBQQCEC:KiyoYze4pmRNPYfmlXBfRTVxt8c=
    +
    + +
    +
    +

    Sample Response

     1
    + 2
    + 3
    + 4
    + 5
    + 6
    + 7
    + 8
    + 9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    HTTP/1.1 200 OK
    +Server: OBS
    +x-obs-request-id: BF260000016435D34E379ABD93320CB9
    +x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSXiN7GPL/yXM6OSBaYCUV1zcY5OelWp
    +Content-Type: application/xml
    +Date: WED, 01 Jul 2015 02:23:30 GMT
    +Content-Length: 586
    +
    +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    +<ListBucketResult xmlns="http://obs.example.com/doc/2015-06-30/">
    +<Name>name</Name>
    +  <Prefix/>
    +  <KeyCount>1</KeyCount>
    +  <MaxKeys>1000</MaxKeys>
    +  <IsTruncated>false</IsTruncated>
    +  <Contents>
    +    <Key>obj</Key>
    +    <LastModified>2021-11-08T11:03:04.236Z</LastModified>
    +    <ETag>"42648685023dcae595357d91a0936104"</ETag>
    +    <Size>4939</Size>
    +    <StorageClass>STANDARD</StorageClass>
    +  </Contents>
    +</ListBucketResult>
    +
    + +
    +
    +
    +
    + +
    + diff --git a/docs/obs/api-ref/public_sys-resources/icon-arrowdn.gif b/docs/obs/api-ref/public_sys-resources/icon-arrowdn.gif index 84eec9be2f2ce458e888f8a9b803f9387247726a..379428032932289326e52c2772bd90ba3d88b906 100644 GIT binary patch literal 1887 zcmZ?wbhEHbCgqow z*eU^C3h_d20o>TUVm+{T^pf*)^(zt!^bPe4Kwg3=^!3HBG&dKny0|1L72#g21{a4^ z7NqJ2r55Lx7A2Jm>Ih`8X1|p zSh~8p7&*iAy5uL9=BDPA!1Sgd^t#~G3rY&P1wfl!Qj0RnQd8WD@^clyUbf1_?G{Iz z=0WwQ;C71>PQCg-$LND17Ac}(Lcr7mV#1RxkONQnsd>QEUIa|mjQ{`r{qy_R&mZ5v zef{$J)5j0*-@SeF`qj%9&!0Vg^7zri2lwyYy>t84%^TORUA=Po(!~qs&z(JU`qar2 z$B!L7a`@1}1N-;w-Lrew&K=vgZQZhY)5ZeMTG_VdAT{+S(zE> zX{jm6Nr?&Zaj`McQIQehVWA3>*p!%p5Wn0u7E$th{n6D>ft^YU5&dnB%c=(a~-RV>2EO25SIA CZ-yWM literal 68 zcmZ?wbhEHbzkByxQ$u Mo$o?7J5~m305MV#!~g&Q diff --git a/docs/obs/api-ref/public_sys-resources/icon-arrowrt.gif b/docs/obs/api-ref/public_sys-resources/icon-arrowrt.gif index 39583d168d6db303b366b5b8c1780698a6bb6017..6aaaa11c23e919c4798d7dcd2b1ae98dd35dd316 100644 GIT binary patch literal 1890 zcmZ?wbhEHb7yetOgf{ zR2HP_2c;J0mlh?b0+lO+tSYc_E=o--$uA1Y&(DE{Vn9ZINq%ugeu08>u$h8JcxGNo zetEGbSiP^Wm1kaYNn&1ds;7&s63_&_%*+%k11Cod14Ab>6ALqQLqk^=3j-5FHzP|& zBUd9gQwvj9m|mCsATTyHM;rzL?XHK6w zdE)r7qel)OI(T6JzP)>P@7lRz`?jrHHgDRvVg0(bYgVsXxnlXUrArnsTDV~Tyt#8` z&zd=7`n0K2CQq6;p}()Ur@O1OqrI)QrMaoGp}wxRrn;)KqP(oMq`0WCAU`iRCp#-M zBRwrOB{?ZEAwDiPCORrIB0MZKBseHAz~9f;$J@)(!`;o*#o5Wx!QRf+#@fo#!raW% z#MsEtKwnQ+M_Wr%LtRZ(MOjHvL0(Q)Mp{ZzLR?H#L|8~rfS-?-hntI&gPo0)g_((w zfkE*n3y@@B&;b#k`jUY|nSq%>!ec`MLnAA%oR7zc2TpB#@>)|YCO&lN;uMU!b7Eqm H1A{dHTIz>f literal 70 zcmZ?wbhEHb