PutContainer
  • PDF

PutContainer

  • PDF

Overview

Creates a container (bucket).

Caution

The sub accounts can use it through the external API Gateway dedicated to sub accounts.
Please refer to the sub accounts for more information.

Syntax

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

Request

Name In Type Description
project_id path string Project ID
container path string Container (bucket) name
X-Auth-Token (Optional) header string Token
X-Container-Read (Optional) header string READ ACL of the container
X-Container-Write (Optional) header string WRITE ACL of the container
X-Container-Sync-Key (Optional) header string not supported
X-Container-Sync-To (Optional) header string not supported
X-Versions-Location (Optional) header string not supported
X-History-Location (Optional) header string not supported
X-Container-Meta-name (Optional) header string Sets 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) header string CORS
X-Container-Meta-Access-Control-Max-Age (Optional) header string CORS
X-Container-Meta-Access-Control-Expose-Headers (Optional) header string CORS
X-Container-Meta-Quota-Bytes (Optional) header string Storage 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) header string Maximum number of objects in the container (bucket)
X-Container-Meta-Temp-URL-Key (Optional) header string Secret key for the temporary URL
X-Container-Meta-Temp-URL-Key-2 (Optional) header string Second secret key for the temporary URL

Response

Name In Type Description
Date header string Response time of the request (in UTC)
X-Timestamp header integer The time when the container (bucket) was created (in UNIX Time)
Content-Length header string Length of the response result (in bytes)
Content-Type (Optional) header string MIME type of the response result
X-Trans-Id header string Transaction ID of the request
X-Openstack-Request-Id header string Transaction 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