Obtaining Bucket Metadata
Functions
This operation queries the metadata of a bucket. To use this operation, you must have the permission to read the bucket.
Request Syntax
1 2 3 4 |
HEAD / HTTP/1.1
Host: bucketname.obs.cn-north-4.myhuaweicloud.com
Date: date
Authorization: authorization
|
Request Parameters
This request contains no parameter.
Request Headers
This request uses common headers. For details, see Table 3.
Table 1 lists the header fields required when obtaining CORS configuration information.
|
Header |
Description |
Mandatory |
|---|---|---|
|
Origin |
Origin of the cross-domain request specified by the pre-request. Generally, it is a domain name. Type: string |
Yes |
|
Access-Control-Request-Headers |
HTTP headers of a request. The request can use multiple HTTP headers. Type: string |
No |
Request Elements
This request contains no elements.
Response Syntax
1 2 3 |
HTTP/1.1 status_code
x-obs-bucket-location: cn-north-4
Date: date
|
Response Headers
The response to the request uses common headers. For details, see Table 1.
Table 2 lists additional response header parameters that are used except for the common response header parameters.
|
Header |
Description |
|---|---|
|
x-obs-bucket-location |
The region where the bucket resides. Type: string |
|
x-obs-storage-class |
The default storage class of the bucket. The options are as follows: STANDARD (Standard storage class), WARM (Infrequent Access storage class), and COLD (Archive storage class) Type: string |
|
x-obs-version |
OBS version of the bucket. Type: string |
|
x-obs-fs-file-interface |
Indicates whether the bucket is a parallel file system. The value can be Enabled (parallel file system). If this header field is not carried, the bucket is not a parallel file system. Type: string |
|
x-obs-epid |
Enterprise project ID of the current bucket. Type: string |
|
x-obs-az-redundancy |
Data redundancy policy of a bucket, which determines whether data is stored in a single AZ or multiple AZs. Value 3az indicates that data is stored in multiple AZs in the same region. If this header field is not carried, data is stored in a single AZ. Type: string |
|
Access-Control-Allow-Origin |
Indicates that the origin is included in the response if the origin in the request meets the CORS configuration requirements when CORS is configured for buckets. Type: string |
|
Access-Control-Allow-Headers |
Indicates that the headers are included in the response if headers in the request meet the CORS configuration requirements when CORS is configured for buckets. Type: string |
|
Access-Control-Max-Age |
Value of MaxAgeSeconds in the CORS configuration of the server when CORS is configured for buckets. Type: integer |
|
Access-Control-Allow-Methods |
Indicates that methods in the rule are included in the response if Access-Control-Request-Method in the request meets the CORS configuration requirements when CORS is configured for buckets. Type: string Valid values: GET, PUT, HEAD, POST, and DELETE. |
|
Access-Control-Expose-Headers |
Value of ExposeHeader in the CORS configuration of a server when CORS is configured for buckets. Type: string |
Response Elements
This response involves no elements.
Error Responses
No special error responses are involved. For details about error responses, see Table 2.
Sample Request 1
No header field for obtaining CORS configuration is carried.
1 2 3 4 5 6 |
HEAD / HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.cn-north-4.myhuaweicloud.com
Accept: */*
Date: WED, 01 Jul 2015 02:30:25 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:niCQCuGIZpETKIyx1dttxHZyYlk=
|
Sample Response 1
1 2 3 4 5 6 7 8 9 |
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: BF260000016439C734E0788404623FA8
Content-Type: application/xml
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSxwLpq9Hzf3OnaXr+pI/OPLKdrtiQAF
Date: WED, 01 Jul 2015 02:30:25 GMT
x-obs-bucket-location: cn-north-4
x-obs-version: 3.0
Content-Length: 0
|
Sample Request 2
Obtain bucket metadata and CORS configuration information after CORS is configured for the bucket.
1 2 3 4 5 6 7 8 |
HEAD / HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.cn-north-4.myhuaweicloud.com
Accept: */*
Date: WED, 01 Jul 2015 02:30:25 GMT
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:niCQCuGIZpETKIyx1dttxHZyYlk=
Origin:www.example.com
Access-Control-Request-Headers:AllowedHeader_1
|
Sample Response 2
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: BF260000016439C734E0788404623FA8
Content-Type: application/xml
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSxwLpq9Hzf3OnaXr+pI/OPLKdrtiQAF
Date: WED, 01 Jul 2015 02:30:25 GMT
x-obs-bucket-location: cn-north-4
Access-Control-Allow-Origin: www.example.com
Access-Control-Allow-Methods: POST,GET,HEAD,PUT
Access-Control-Allow-Headers: AllowedHeader_1
Access-Control-Max-Age: 100
Access-Control-Expose-Headers: ExposeHeader_1
x-obs-version: 3.0
Content-Length: 0
|
Last Article: Listing Objects in a Bucket
Next Article: Obtaining Bucket Location
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.