- Print
- PDF
PutContainer
- Print
- PDF
Available in Classic and VPC
Create a container (bucket).
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.
Method | URI |
---|---|
PUT | /v1/AUTH_{project_id}/{container} |
Request headers
The following describes the headers.
Field | Type | Required | Description |
---|---|---|---|
X-Auth-Token | String | Required | Value of the issued token |
X-Container-Read | String | Optional | READ ACL (access permissions) of the container (bucket) |
X-Container-Write | String | Optional | WRITE ACL (access permissions) of the container (bucket) |
X-Container-Sync-Key | String | Optional | Not used |
X-Container-Sync-To | String | Optional | Not used |
X-Versions-Location | String | Optional | Not used |
X-History-Location | String | Optional | Not used |
X-Container-Meta-name | String | Optional | Metadata for the container (bucket)
|
X-Container-Meta-Access-Control-Allow-Origin | String | Optional | CORS setting
|
X-Container-Meta-Access-Control-Max-Age | String | Optional | CORS setting (in seconds)
|
X-Container-Meta-Access-Control-Expose-Headers | String | Optional | CORS setting
|
X-Container-Meta-Quota-Bytes | String | Optional | Capacity limit of the container (bucket) |
X-Container-Meta-Quota-Count | String | Optional | Limit for number of objects in the container (bucket) |
X-Container-Meta-Temp-URL-Key | String | Optional | Secret key value for the temporary URL |
X-Container-Meta-Temp-URL-Key-2 | String | Optional | Second secret key value for the temporary URL |
Request path parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
project_id | String | Required | Project ID
|
container | String | Required | Name 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 code | Code | Message | Description |
---|---|---|---|
200 | - | OK | Request succeeded |
204 | - | No Content | It occurs when the Content-Type is plain and there is nothing in the request |
403 | - | Not Found | It 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