GetContainerList
    • PDF

    GetContainerList

    • PDF

    Article summary

    Available in Classic and VPC

    Get the list of containers registered to an account.

    Request

    This section describes the request format. The method and URI are as follows:

    MethodURI
    GET-

    Request headers

    The following describes the headers.

    FieldTypeRequiredDescription
    x-ncp-apigw-timestampStringRequiredTimestamp value
    • It indicates the elapsed time in milliseconds since January 1, 1970 00:00:00 UTC
    • Request is considered invalid if the timestamp differs from the current time by more than 5 minutes
    x-ncp-iam-access-keyStringRequiredAPI key issued by NAVER Cloud Platform or access key issued by Sub Account
    x-ncp-apigw-signature-v2StringRequiredSignature used to encrypt the body of the above example with the secret key that maps with the access key ID
    • Use the HMAC-SHA256 encryption algorithm
    x-ncp-region_codeStringRequiredRegion code of the container
    • <Example> Korea: KR | Singapore: SGN

    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
    • true | false (default)
      • false: descending order

    Request example

    The request example is as follows:

    curl -X GET "https://archivestorage.apigw.ntruss.com/swift/v1/?limit=1&marker=test" -H "accept: application/json" -H "x-ncp-region-code: {regionCode}"
    -H "x-ncp-iam-access-key: {AccessKey} "
    -H "x-ncp-apigw-timestamp: {current timestamp}"
    -H "x-ncp-apigw-signature-v2: {generated signature}"
    

    Response

    This section describes the response format.

    Response headers

    The following describes the headers.

    FieldTypeRequiredDescription
    ConnectionString-TCP connection status between client and server
    Content-TypeString-MIME type of the response result
    DateString-Response time of the request (UTC)
    Referrer-PolicyString-HTTP Referrer header handling method
    ServerString-Response server
    Transfer-EncodingString-Delivery method for response data
    X-Account-Bytes-UsedInteger-Amount of capacity the container is using
    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-project-domain-idString-Domain ID required to use the API
    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-ncp-apigw-response-originString-Original source of the response
    x-ncp-trace-idString-ID for transaction tracking
    X-Trans-IdString-Transaction ID of the request
    X-Openstack-Request-IdString-Transaction ID of the request
    • Identical to X-Trans-Id
    X-TimestampInteger-Creation time of the container (Unix time)

    Response syntax

    The response syntax is as follows.

    [
        {
    	“name”: “test”,
    	“count”: 0,
    	“bytes”: 0,
    	“last_modified”: “2022-04-20T01:10:10.123456”
    	}
    ]
    

    Response body

    The response body includes the following data:

    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

    For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.

    Response example

    The response example is as follows:

    HTTP/1.1 200 OK
    connection: keep-alive 
    content-type: application/json 
    date: Tue,16 Apr 2024 02:18:45 GMT 
    referrer-policy: unsafe-url 
    server: nginx 
    transfer-encoding: chunked 
    x-account-bytes-used: 30129 
    x-account-container-count: 3 
    x-account-object-count: 3 
    x-account-project-domain-id: default 
    x-account-storage-policy-standard00-bytes-used: 30129 
    x-account-storage-policy-standard00-container-count: 3 
    x-account-storage-policy-standard00-object-count: 3 
    x-ncp-apigw-response-origin: ENDPOINT 
    x-ncp-trace-id: 38cb565j34pho32or46pij0opg 
    x-openstack-request-id: tx5c30c46d8a0a450ea6291-00661de005 
    x-timestamp: 1711960998.26335 
    x-trans-id: tx5c30c46d8a0a450ea6291-00661de005 
    
    [
      {
        "name": "c11",
        "count": 1,
        "bytes": 13160,
        "last_modified": "2024-04-01T05:43:18.300410"
      },
      {
        "name": "c12",
        "count": 2,
        "bytes": 16969,
        "last_modified": "2024-04-08T02:40:30.317280"
      },
      {
        "name": "c33",
        "count": 0,
        "bytes": 0,
        "last_modified": "2024-04-16T08:42:57.160680"
      }
    ]
    

    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.