PutContainer
    • PDF

    PutContainer

    • PDF

    Article Summary

    The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.

    Overview

    Creates a container (bucket).

    Syntax

    PUT /v1/AUTH_{project_id}/{container}
    

    Request

    NameInTypeDescription
    project_idpathstringProject ID
    containerpathstringContainer (bucket) name
    X-Auth-Token (Optional)headerstringToken
    X-Container-Read (Optional)headerstringREAD ACL of the container
    X-Container-Write (Optional)headerstringWRITE ACL of the container
    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-Container-Meta-name (Optional)headerstringSets metadata of the container (bucket). The name part in the header name functions as a key of the metadata. You can add, update and delete metadata; leave this header empty to delete metadata.
    X-Container-Meta-Access-Control-Allow-Origin (Optional)headerstringCORS
    X-Container-Meta-Access-Control-Max-Age (Optional)headerstringCORS
    X-Container-Meta-Access-Control-Expose-Headers (Optional)headerstringCORS
    X-Container-Meta-Quota-Bytes (Optional)headerstringStorage limit of the container (bucket) in bytes. The container (bucket) use is limited if the storage limit is exceeded.
    X-Container-Meta-Quota-Count (Optional)headerstringMaximum number of objects in the container (bucket)
    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
    DateheaderstringResponse time of the request (in UTC)
    Content-LengthheaderstringLength of the response result (in bytes)
    Content-Type (Optional)headerstringMIME type of the response result
    X-Trans-IdheaderstringTransaction ID of the request
    X-Openstack-Request-IdheaderstringTransaction ID of the request (same as X-Trans-Id)

    Examples

    Request example (Create container)

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

    Response example

    HTTP/1.1 201 Created
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: txa8b5404ac864437293727-005b9878d1
    X-Openstack-Request-Id: txa8b5404ac864437293727-005b9878d1
    Date: Wed, 12 Sep 2018 02:24:17 GMT
    

    Request example (Create container including metadata)

    curl -i -X PUT -H "X-Auth-Token: $token" -H "X-Container-Meta-Book: ncloud-book" -H "X-Container-Meta-Subject: ncloud-test-subject" https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}
    

    Response example

    HTTP/1.1 201 Created
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx8282719a30554e2b8e0c7-005b987946
    X-Openstack-Request-Id: tx8282719a30554e2b8e0c7-005b987946
    Date: Wed, 12 Sep 2018 02:26:14 GMT
    

    Request example (Create container including ACL)

    curl -i -X PUT -H "X-Auth-Token: $token" -H "X-Container-Read: .r:* https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}/{container}
    

    Response example

    HTTP/1.1 201 Created
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx691a8ed48a3f4152ae904-005b98799c
    X-Openstack-Request-Id: tx691a8ed48a3f4152ae904-005b98799c
    Date: Wed, 12 Sep 2018 02:27:41 GMT
    

    It returns Created (201) or Accepted (202) status code if successful.
    It returns Accepted (202) if the container (bucket) already exists and the API request updates the container’s metadata, and 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.