GetContainer
    • PDF

    GetContainer

    • PDF

    Article Summary

    Overview

    Gets objects in a container (bucket) and its metadata.

    Syntax

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

    Request

    NameInTypeDescription
    project_idpathstringProject ID
    containerpathstringContainer name
    limit (Optional)queryintegerLimits the maximum number of results.
    marker (Optional)querystringGets objects after the specified object.
    end_marker (Optional)querystringGets objects before the specified object.
    prefix (Optional)querystringGets objects which start with the specified prefix.
    format (Optional)querystringResponse format (json, xml, plain)
    delimiter (Optional)querystringIt is used to display objects in a hierarchical structure.
    path (Optional)querystringShows objects in the path. The prefix or delimiter option is preferred than the path option.
    X-Auth-Token (Optional)headerstringToken
    X-Newest (Optional)headerbooleanIf 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)headerstringResponse format (application/json, application/xml, text/xml)
    X-Container-Meta-Temp-URL-Key (Optional)headerstringSecret key for the temporary URL
    X-Container-Meta-Temp-URL-Key-2 (Optional)headerstringSecond secret key for the temporary URL

    Response

    NameInTypeDescription
    X-Container-Meta-nameheaderstringMetadata information of the container (bucket). The name part in the header name functions as a key of the metadata.
    Content-LengthheaderstringLength of the response result (in bytes)
    X-Container-Object-CountheaderintegerNumber of objects in the container (bucket)
    X-Container-Bytes-UsedheaderintegerTotal size used by the container (bucket) in bytes
    X-Container-Meta-Temp-URL-Key (Optional)headerstringSecret key for the temporary URL
    X-Container-Meta-Temp-URL-Key-2 (Optional)headerstringSecond secret key for the temporary URL
    X-Container-Meta-Quota-Bytes (Optional)headerstringStorage limit of the container (bucket)
    X-Container-Meta-Quota-Count (Optional)headerstringMaximum number of objects in the container (bucket)
    X-Storage-Policy (Optional)headerstringStorage policy of the container (bucket)
    X-Container-Read (Optional)headerstringREAD ACL of the container (bucket)
    X-Container-Write (Optional)headerstringWRITE ACL of the container (bucket)
    X-Container-Sync-Key (Optional)headerstringNot supported
    X-Container-Sync-To (Optional)headerstringNot supported
    X-Versions-Location (Optional)headerstringNot supported
    X-History-Location (Optional)headerstringNot supported
    X-TimestampheaderintegerThe time when the container (bucket) was created (in UNIX Time)
    X-Trans-IdheaderstringTransaction ID of the request
    X-Openstack-Request-IdheaderstringTransaction ID of the request (same as X-Trans-Id)
    Content-TypeheaderstringResponse format
    DateheaderstringResponse time of the request (in UTC)
    hashbodystringMD5 checksum value of the object
    last_modifiedbodystringThe last time when the object was modified (in UTC)
    content_typebodystringObject type
    bytesbodyintegerObject size (in bytes)
    namebodystringObject 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?

    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.