GetContainer
- Print
- PDF
GetContainer
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Overview
Gets objects in a container (bucket) and its metadata.
Syntax
GET /v1/AUTH_{project_id}/{container}
Request
Name | In | Type | Description |
---|---|---|---|
project_id | path | string | Project ID |
container | path | string | Container name |
limit (Optional) | query | integer | Limits the maximum number of results. |
marker (Optional) | query | string | Gets objects after the specified object. |
end_marker (Optional) | query | string | Gets objects before the specified object. |
prefix (Optional) | query | string | Gets objects which start with the specified prefix. |
format (Optional) | query | string | Response format (json, xml, plain) |
delimiter (Optional) | query | string | It is used to display objects in a hierarchical structure. |
path (Optional) | query | string | Shows objects in the path. The prefix or delimiter option is preferred than the path option. |
X-Auth-Token (Optional) | header | string | Token |
X-Newest (Optional) | header | boolean | If it is true, the API request queries all copies and responds with the information of the latest copy. If this header is not specified, the API request returns the information that it can respond most quickly with. |
Accept (Optional) | header | string | Response format (application/json, application/xml, text/xml) |
X-Container-Meta-Temp-URL-Key (Optional) | header | string | Secret key for the temporary URL |
X-Container-Meta-Temp-URL-Key-2 (Optional) | header | string | Second secret key for the temporary URL |
Response
Name | In | Type | Description |
---|---|---|---|
X-Container-Meta-name | header | string | Metadata information of the container (bucket). The name part in the header name functions as a key of the metadata. |
Content-Length | header | string | Length of the response result (in bytes) |
X-Container-Object-Count | header | integer | Number of objects in the container (bucket) |
X-Container-Bytes-Used | header | integer | Total size used by the container (bucket) in bytes |
X-Container-Meta-Temp-URL-Key (Optional) | header | string | Secret key for the temporary URL |
X-Container-Meta-Temp-URL-Key-2 (Optional) | header | string | Second secret key for the temporary URL |
X-Container-Meta-Quota-Bytes (Optional) | header | string | Storage limit of the container (bucket) |
X-Container-Meta-Quota-Count (Optional) | header | string | Maximum number of objects in the container (bucket) |
X-Storage-Policy (Optional) | header | string | Storage policy of the container (bucket) |
X-Container-Read (Optional) | header | string | READ ACL of the container (bucket) |
X-Container-Write (Optional) | header | string | WRITE ACL of the container (bucket) |
X-Container-Sync-Key (Optional) | header | string | Not supported |
X-Container-Sync-To (Optional) | header | string | Not supported |
X-Versions-Location (Optional) | header | string | Not supported |
X-History-Location (Optional) | header | string | Not supported |
X-Timestamp | header | integer | The time when the container (bucket) was created (in UNIX Time) |
X-Trans-Id | header | string | Transaction ID of the request |
X-Openstack-Request-Id | header | string | Transaction ID of the request (same as X-Trans-Id) |
Content-Type | header | string | Response format |
Date | header | string | Response time of the request (in UTC) |
hash | body | string | MD5 checksum value of the object |
last_modified | body | string | The last time when the object was modified (in UTC) |
content_type | body | string | Object type |
bytes | body | integer | Object size (in bytes) |
name | body | string | Object name |
Examples
Request example (JSON)
curl -i -X GET -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}?format=json
Response example
HTTP/1.1 200 OK
Content-Length: 352
X-Container-Object-Count: 2
X-Timestamp: 1536631895.01856
Accept-Ranges: bytes
X-Storage-Policy: standard01
Last-Modified: Tue, 11 Sep 2018 02:11:36 GMT
X-Container-Bytes-Used: 420024
Content-Type: application/json; charset=utf-8
X-Trans-Id: tx6bb706abe32b4ae5a49e8-005b978263
X-Openstack-Request-Id: tx6bb706abe32b4ae5a49e8-005b978263
Date: Tue, 11 Sep 2018 08:52:51 GMT
[
{
"hash":"9bd5b4f25faf491080654a34d57c3636",
"last_modified":"2018-09-11T02:12:29.991410",
"bytes":210012,
"name":"ncloud-test-object-0.txt",
"content_type":"text/plain"
},
{
"hash":"9bd5b4f25faf491080654a34d57c3636",
"last_modified":"2018-09-11T02:12:29.992600",
"bytes":210012,
"name":"ncloud-test-object-1.txt",
"content_type":"text/plain"
}
]
Request example (XML)
curl -i -X GET -H "X-Auth-Token: $token" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}?format=XML
Response example
HTTP/1.1 200 OK
Content-Length: 520
X-Container-Object-Count: 2
X-Timestamp: 1536631895.01856
Accept-Ranges: bytes
X-Storage-Policy: standard01
Last-Modified: Tue, 11 Sep 2018 02:11:36 GMT
X-Container-Bytes-Used: 420024
Content-Type: application/xml; charset=utf-8
X-Trans-Id: txfff4e8574d7e43f38b8e8-005b9782ef
X-Openstack-Request-Id: txfff4e8574d7e43f38b8e8-005b9782ef
Date: Tue, 11 Sep 2018 08:55:11 GMT
<?xml version="1.0" encoding="UTF-8"?>
<container name="ncloud-container-0">
<object>
<name>ncloud-test-object-0.txt</name>
<hash>9bd5b4f25faf491080654a34d57c3636</hash>
<bytes>210012</bytes>
<content_type>text/plain</content_type>
<last_modified>2018-09-11T02:12:29.991410</last_modified>
</object>
<object>
<name>ncloud-test-object-1.txt</name>
<hash>9bd5b4f25faf491080654a34d57c3636</hash>
<bytes>210012</bytes>
<content_type>text/plain</content_type>
<last_modified>2018-09-11T02:12:29.992600</last_modified>
</object>
</container>
It returns OK (200) or No Content (204) status code if successful.
No Content (204) is returned when the Content-Type is plain and there is no content for the request.
It returns Not Found (404) status code if there is no container (bucket).
Was this article helpful?