GetContainerList
    • PDF

    GetContainerList

    • PDF

    Article summary

    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.

    MethodURI
    GET/v1/AUTH_{project_id}

    Request headers

    The following describes the headers.

    FieldTypeRequiredDescription
    X-Auth-TokenStringRequiredValue of the issued token
    AcceptStringOptionalSpecify the format of call results
    • application/json |application/xml |text/xml

    Request path parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    project_idStringRequiredProject ID
    containerStringRequiredName of the container (bucket) to view

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    limitIntegerOptionalLimit the maximum number of call results
    markerStringOptionalReturn the list after a specific container (bucket)
    end_markerStringOptionalReturn the list before a specific container (bucket)
    prefixStringOptionalReturn the list of containers (buckets) that start with the string
    reverseStringOptionalOutput 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.

    FieldTypeRequiredDescription
    Content-TypeString-MIME type of the response result
    X-Account-Container-CountInteger-Total number of containers (buckets) in the account
    X-Account-Object-CountInteger-Total number of objects in the account
    X-Account-Bytes-UsedInteger-Total capacity size used by the account (bytes)
    X-TimestampInteger-Creation time of the container (bucket) (Unix timestamp)
    X-Account-Storage-Policy-name-Bytes-UsedInteger-Total capacity size (bytes) of the storage policy corresponding to name in the header name
    X-Account-Storage-Policy-name-Container-CountInteger-Total number of containers (buckets) in the storage policy corresponding to name in the header name
    X-Account-Storage-Policy-name-Object-CountInteger-Total number of objects in the storage policy corresponding to name in the header name
    X-Account-Meta-nameString-Account metadata
    • The name part of the header name acts as a key for metadata
    X-Account-Meta-Temp-URL-KeyString-Secret key value for the temporary URL
    X-Account-Meta-Temp-URL-Key-2String-Second secret key value for the temporary URL
    Accept-RangesString-Range types allowed by the container (bucket)
    Content-LengthString-Length of the response result (bytes)
    x-account-project-domain-idString-Domain ID required to use the API
    X-Trans-IdString-Transaction ID of the request
    X-Openstack-Request-IdString-Transaction ID of the request
    • Identical to X-Trans-Id
    DateString-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.

    FieldTypeRequiredDescription
    nameString-Name of the container
    countInteger-Number of objects in the container
    bytesInteger-Size of all objects in the container (bytes)
    last_modifiedString-Final modification date and time

    Response status codes

    The following describes the response status codes.

    HTTP status codeCodeMessageDescription
    200-OKRequest succeeded
    204-No ContentIt occurs when the Content-Type is plain and there is nothing in the request
    403-Not FoundIt 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>
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.