PutContainer
    • PDF

    PutContainer

    • PDF

    Article summary

    Available in Classic and VPC

    Create a container (bucket).

    Note

    Sub accounts can use it through the external API Gateway dedicated to sub accounts.
    For more information, see the PutContainer API of Sub Account.

    Requests

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

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

    Request headers

    The following describes the headers.

    FieldTypeRequiredDescription
    X-Auth-TokenStringRequiredValue of the issued token
    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
    X-Container-Meta-nameStringOptionalMetadata for the container (bucket)
    • The name part of the header name acts as a key for metadata
    • It can be added, updated, or deleted, with deletion requested as an empty value
    X-Container-Meta-Access-Control-Allow-OriginStringOptionalCORS setting
    • Accessible source domain
    X-Container-Meta-Access-Control-Max-AgeStringOptionalCORS setting (in seconds)
    • Maximum time to cache results
    X-Container-Meta-Access-Control-Expose-HeadersStringOptionalCORS setting
    • Header that is not visible but allows access
    X-Container-Meta-Quota-BytesStringOptionalCapacity limit of the container (bucket)
    X-Container-Meta-Quota-CountStringOptionalLimit for number of objects in the container (bucket)
    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

    Request path parameters

    The following describes the parameters.

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

    Request example

    The following is a sample request.

    Request creation of container (bucket)

    The following is a sample request of creating a container (bucket).

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

    Request creation of container (bucket) with metadata

    The following is a sample request of creating a container (bucket) that includes metadata.

    curl -X POST "https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}" 
    -H "X-Auth-Token: $token"
    -H "X-Container-Meta-{name}: $container-metadata-string"
    

    Request creation of container (bucket) with ACL

    The following is a sample request of creating a container (bucket) including an ACL.

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

    Responses

    The following describes the response format.

    Response headers

    For response headers common to all Archive Storage APIs, see Archive Storage common response headers.

    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 requesting creation of container

    The following is a sample response when requesting a container creation.

    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
    

    Response when requesting creation of container with metadata

    The following is a sample response when requesting a container creation with metadata.

    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
    

    Response when requesting creation of container with ACL

    The following is a sample response when requesting a container creation with ACL.

    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
    

    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.