GetContainer
    • PDF

    GetContainer

    • PDF

    Article summary

    Available in Classic and VPC

    View the list of objects and metadata belonging to a container (bucket).

    Requests

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

    MethodURI
    GET/v1/AUTH_{project_id}/{container}

    Request headers

    The following describes the headers.

    FieldTypeRequiredDescription
    X-Auth-TokenStringRequiredValue of the issued token
    X-NewestBooleanOptionalSet whether to respond with information from the most recent replica
    • true | false
      • true: Query all replicas and respond with information from the most recent replica
    • If the header is omitted, respond with the fastest information available
    AcceptStringOptionalSpecify the format of call results
    • application/json |application/xml |text/xml
    X-Account-Meta-Temp-URL-KeyStringOptionalSecret key value for the temporary URL
    X-Account-Meta-Temp-URL-Key-2StringOptionalSecond secret key value for the temporary URL

    Request path parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    project_idStringRequiredProject ID
    containerStringRequiredName of the container (bucket)

    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
    formatStringOptionalSpecify the format of the call results (JSON, XML, plain)
    delimiterStringOptionalRepresent the list of containers (buckets) as a hierarchy, using the string as a delimiter
    pathStringOptionalReturn the list of objects inside that path
    • prefix and delimiter options recommended over path options

    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}/{container}" 
    -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}/{container}?format=json" 
    -H "X-Auth-Token: $token"
    

    Request format query parameter as XML

    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}/{container}?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-Container-Object-CountInteger-Total number of objects in the container (bucket)
    X-Container-Bytes-UsedInteger-Total capacity size used by the container (bucket) (bytes)
    X-TimestampInteger-Creation time of the container (bucket) (Unix timestamp)
    Last-ModifiedString-Most recent modification time (UTC) of the container
    Accept-RangesString-Range types allowed by the container (bucket)
    Content-LengthString-Length of the response result (bytes)
    X-Storage-PolicyStringOptionalStorage policy value of the container (bucket)
    X-Trans-IdString-Transaction ID of the request
    X-Openstack-Request-IdString-Transaction ID of the request
    • Identical to X-Trans-Id
    X-Container-Meta-nameStringMetadata of the container (bucket)
    • The name part of the header name acts as a key for metadata
    X-Container-Meta-Temp-URL-KeyStringOptionalSecret key value for the temporary URL
    X-Container-Meta-Temp-URL-Key-2StringOptionalSecond secret key value for the temporary URL
    X-Container-Meta-Quota-CountStringOptionalLimit for number of objects in the container (bucket)
    X-Container-Meta-Quota-BytesStringOptionalCapacity limit of the container (bucket)
    X-Container-ReadStringOptionalREAD ACL (access permissions) of the container (bucket)
    X-Container-WriteStringOptionalWRITE ACL (access permissions) of the container (bucket)
    X-Container-Sync-KeyStringOptionalNot used
    X-Container-Sync-ToStringOptionalNot used
    X-Versions-LocationStringOptionalNot used
    X-History-LocationStringOptionalNot used
    DateString-Response time of the request (UTC)

    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
    404-Not FoundIt occurs when the container (bucket) doesn't exist

    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"
    
    [
       {
          "hash":"string",
          "last_modified":"string",
          "bytes":"number",
          "name":"string",
          "content_type":"string"
       }
    ]
    
    <?xml version="1.0" encoding="UTF-8"?>
    <container name="string">
       
    </container>
    

    Response body

    The following describes the response body.

    FieldTypeRequiredDescription
    hashString-MD5 checksum value of the object
    nameString-Name of the container (bucket)
    countInteger-Number of objects in the container (bucket)
    bytesInteger-Size of all objects in the container (bucket) (bytes)
    content_typeString-MIME type of the response result
    last_modifiedString-Last modification date and time

    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-test-object-0.txt
    ncloud-test-object-1.txt
    

    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: 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"
       }
    ]
    

    Response when format query parameter is requested in XML

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

    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">
       
       
    </container>
    

    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.