GetContainerList

Prev Next

Available in Classic and VPC

View the list of containers (buckets).

Note

Sub accounts can use it through the external API Gateway dedicated to sub accounts.
For more information, see the GetContainerList API of Sub Account.

Requests

The following describes the request format for the endpoint. The request format is as follows.

Method URI
GET /v1/AUTH_{project_id}

Request headers

The following describes the headers.

Field Type Required Description
X-Auth-Token String Required Value of the issued token
Accept String Optional Specify the format of call results
  • application/json |application/xml |text/xml

Request path parameters

The following describes the parameters.

Field Type Required Description
project_id String Required Project ID
container String Required Name of the container (bucket) to view

Request query parameters

The following describes the parameters.

Field Type Required Description
limit Integer Optional Limit the maximum number of call results
marker String Optional Return the list after a specific container (bucket)
end_marker String Optional Return the list before a specific container (bucket)
prefix String Optional Return the list of containers (buckets) that start with the string
reverse String Optional Output the list sorted by the name of the container
  • Default false (descending)

Request example

The following is a sample request.

Request without format query parameter

The following is a sample request without the format query parameter.

curl -X GET "https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}" 
-H "X-Auth-Token: $token"

Request format query parameter as JSON

The following is a sample request for the format query parameter as JSON.

curl -X GET "https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}?format=json" 
-H "X-Auth-Token: $token"

Request format query parameter as XML

The following is a sample request for the format query parameter in XML.

curl -X GET "https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}?format=xml" 
-H "X-Auth-Token: $token"

Responses

The following describes the response format.

Response headers

The following describes the headers.

Field Type Required Description
Content-Type String - MIME type of the response result
X-Account-Container-Count Integer - Total number of containers (buckets) in the account
X-Account-Object-Count Integer - Total number of objects in the account
X-Account-Bytes-Used Integer - Total capacity size used by the account (bytes)
X-Timestamp Integer - Creation time of the container (bucket) (Unix timestamp)
X-Account-Storage-Policy-name-Bytes-Used Integer - Total capacity size (bytes) of the storage policy corresponding to name in the header name
X-Account-Storage-Policy-name-Container-Count Integer - Total number of containers (buckets) in the storage policy corresponding to name in the header name
X-Account-Storage-Policy-name-Object-Count Integer - Total number of objects in the storage policy corresponding to name in the header name
X-Account-Meta-name String - Account metadata
  • The name part of the header name acts as a key for metadata
X-Account-Meta-Temp-URL-Key String - Secret key value for the temporary URL
X-Account-Meta-Temp-URL-Key-2 String - Second secret key value for the temporary URL
Accept-Ranges String - Range types allowed by the container (bucket)
Content-Length String - Length of the response result (bytes)
x-account-project-domain-id String - Domain ID required to use the API
X-Trans-Id String - Transaction ID of the request
X-Openstack-Request-Id String - Transaction ID of the request
  • Identical to X-Trans-Id
Date String - Response time of the request (UTC)

Response syntax

The response syntax is as follows.

If requested without the format query parameter, only the names of the objects in the container (bucket) are responded to in plain text format.

"string"
[
   {
      "count": "number",
      "last_modified":"string",
      "bytes":"number",
      "name":"string"
   }
]
<?xml version="1.0" encoding="UTF-8"?>
<account name="AUTH_5942771066a0482bb6aaf7f5bc792b00">
   <container>
      <name>"string"</name>
      <count>"number"</count>
      <bytes>"number"</bytes>
      <last_modified>"string"</last_modified>
   </container>
</account>

Response body

The following describes the response body.

Field Type Required Description
name String - Name of the container
count Integer - Number of objects in the container
bytes Integer - Size of all objects in the container (bytes)
last_modified String - Final modification date and time

Response status codes

The following describes the response status codes.

HTTP status code Code Message Description
200 - OK Request succeeded
204 - No Content It occurs when the Content-Type is plain and there is nothing in the request
403 - Not Found It occurs when the container (bucket) doesn't exist

Response example

The following is a sample response.

Response when requested without format query parameter

The following is a sample response when requested without the format query parameter

HTTP/1.1 200 OK
Content-Length: 38
Accept-Ranges: bytes
X-Timestamp: 1535685069.28154
X-Account-Bytes-Used: 0
X-Account-Container-Count: 2
Content-Type: text/plain; charset=utf-8
X-Account-Object-Count: 0
x-account-project-domain-id: default
X-Trans-Id: tx928992622dd248ee9b3e8-005b972569
X-Openstack-Request-Id: tx928992622dd248ee9b3e8-005b972569
Date: Tue, 11 Sep 2018 02:16:09 GMT
ncloud-container-0
ncloud-container-1

Response when format query parameter is requested as JSON

The following is a sample response when the format query parameter is requested as JSON.

HTTP/1.1 200 OK
Content-Length: 96
X-Account-Object-Count: 1
X-Timestamp: 1389453423.35964
X-Account-Meta-Subject: Literature
X-Account-Bytes-Used: 14
X-Account-Container-Count: 2
Content-Type: application/json; charset=utf-8
Accept-Ranges: bytes
X-Trans-Id: tx274a77a8975c4a66aeb24-0052d95365
X-Openstack-Request-Id: tx274a77a8975c4a66aeb24-0052d95365
Date: Fri, 17 Jan 2014 15:59:33 GMT
[
    {
        "count": 0,
        "bytes": 0,
        "name": "janeausten",
        "last_modified": "2013-11-19T20:08:13.283452"
    },
    {
        "count": 1,
        "bytes": 14,
        "name": "marktwain",
        "last_modified": "2016-04-29T16:23:50.460230"
    }
]

Response when format query parameter is requested in XML

The following is a sample response when the format query parameter is requested in XML.

HTTP/1.1 200 OK
Content-Length: 262
X-Account-Object-Count: 1
X-Timestamp: 1389453423.35964
X-Account-Meta-Subject: Literature
X-Account-Bytes-Used: 14
X-Account-Container-Count: 2
Content-Type: application/xml; charset=utf-8
Accept-Ranges: bytes
X-Trans-Id: tx69f60bc9f7634a01988e6-0052d9544b
X-Openstack-Request-Id: tx69f60bc9f7634a01988e6-0052d9544b
Date: Fri, 17 Jan 2014 16:03:23 GMT
<?xml version="1.0" encoding="UTF-8"?>
<account name="my_account">
    <container>
        <name>janeausten</name>
        <count>0</count>
        <bytes>0</bytes>
        <last_modified>2013-11-19T20:08:13.283452</last_modified>
    </container>
    <container>
        <name>marktwain</name>
        <count>1</count>
        <bytes>14</bytes>
        <last_modified>2016-04-29T16:23:50.460230</last_modified>
    </container>
</account>