Skip to main content

Bucket

You can use Object Storage's Bucket API to create buckets and manage related information and policies.

API preparations

  • Please refer to the API Preparation for the preparatory work required to call the API.
  • For a description of the API model of Object Storage, please refer to the API model.

API endpoint

The Object Storage API endpoint is as follows:

Object Storage API endpoint format
https://objectstorage.kr-central-2.kakaocloud.com

Create bucket

You can create a bucket.

info

According to KakaoCloud IAM role, the Project Admin or Project Member role is required to create a bucket.

Request Syntax
Request Syntax
curl --request PUT --location 'https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "my-bucket-new",
"type": "STANDARD",
"use_encryption": true,
"encryption_configuration": {
"type": "managed"
}
}'
API method
MethodRequest URL
PUT   https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Enter authentication token
Content-TypeStringRequired  Fixed with application/json
Request Elements
RequestTypeRequired or notDescription
nameStringRequired  Bucket name
typeStringRequired  Bucket type
- Standard (default): standard bucket
use_encryptionBooleanSelectWhether to encrypt the bucket
If you enter the encryption_configuration setting, the input value will be ignored
- false (default): Do not encrypt
- true: Encrypt
(same as encryption_configuration.type = managed)
encryption_configuration ▼StructureSelectSet up bucket encryption
    typeStringRequired  Encryption method
- managed (default): Automatic encryption provided by Saba
- true (to be supported): Encryption linked to key management service using KMS
Response Syntax
Response Syntax
{
"account": "project-id",
"project": "project-id",
"name": "my-bucket-new",
"type": "STANDARD",
"bytes": 0,
"objectCount": 0,
"createdAt": "2022-04-25T10:28:57Z",
"acl": {
"permissions": null,
"public": "read-only",
"public_read_allow_ip_list": [
"ip / cidr"
]
},
"lastModified": "2022-04-25T10:28:57Z",
"use_encryption": true,
"encryption_type": "managed",
"storageClass": "STANDARD",
"storagePolicy": "default-placement"
}
Response Elements
ResponseTypeDescription
account (Deprecated)StringProject ID
- Account value in Swift API.
- Can be confirmed when token is issued
projectStringProject ID
nameStringCreated bucket name
typeStringCreated bucket type
- STANDARD (default): standard bucket
bytesStringTotal usage
- Unit: Byte
objectCountIntNumber of objects in bucket
createdAtStringCreation date
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
use_encryptionBooleanWhether to encrypt bucket
- false (default): Do not encrypt
- true: Encrypt
encryption_typeStringBucket encryption type
lastModifiedStringLast modified
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
storageClassStringStorage class type
- STANDARD (default): bucket of class standard
storagePolicyStringZone of storage class
- default-placement
acl ▼-Access rights to bucket
- When null is entered, existing ACL settings are deleted
    publicStringWhether to allow public access
- read-only, deny
    public_read_allow_ip_listListList of IPs allowed for public access
Status Code
HTTP StatusResponseDescription
200     OKSuccess
400Bad RequestInput setting error
401UnauthorizedNo permission
409ConflictsCreation failed
- Same bucket_name already exists

Manage bucket

View bucket details

If you have storage.buckets.get permission, you can view detailed information about a specific bucket. For detailed permissions of Object Storage, please refer to Manage permission.

Request Syntax
Request Syntax
curl --location --request GET 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}'
API method
MethodRequest URL
GET   https://objectstorage.{region_name}.kakaocloud.com/v1_ext/{bucket_name}
PathTypeRequired or notDescription
region_nameStringRequired  Region name
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Enter authentication token
Response Syntax

For a details of Bucket's API model, please refer to Bucket API model.

Response Syntax
{    
"project": "project-id",
"name": "test-bucket-01",
"type": "STANDARD",
"bytes": 0,
"objectCount": 0,
"createdAt": "2023-06-21T07:17:10Z",
"use_encryption": true,
"encryption_type": " ",
"lastModified": "2023-06-21T07:17:10Z",
"storageClass": "STANDARD",
"storagePolicy": "default-placement",
"acl": {
"public": "deny",
"public_read_allow_ip_list": null
}
}
Response Elements
ResponseTypeDescription
projectStringProject ID
- Able to get this information when issuing a token
- Used in S3 API
nameStringCreated bucket name
typeStringCreated bucket type
- standard (default): standard bucket
bytesStringTotal usage
- Unit: Byte
objectCountIntNumber of objects in bucket
createdAtStringCreation date
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
use_encryptionBooleanWhether to encrypt bucket
- false (default): Do not encrypt
- true: Encrypt
encryption_typeStringBucket encryption type
lastModifiedStringLast modified
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
storageClassStringStorage class type (kr-central-2 only)
- standard (default): Bucket of standard class
storagePolicyStringZone of storage class
acl ▼-Access rights to bucket
- When null is entered, existing ACL settings are deleted
    publicStringRead-only
- Only read-only can be written
    public_read_allow_ip_listListList of IPs allowed for public access
Status Code
HTTP StatusResponseDescription
200     OKSuccess
400Bad RequestInput setting error
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Query bucket list

You can view the bucket list.

info

According to KakaoCloud IAM role, the Project Admin or Project Member role is required to view the bucket.

Request Syntax
Request Syntax
curl --location --request GET 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket?limit=100' \
--header 'X-Auth-Token: {x-auth-token}'
API method
MethodRequest URL
GET  https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket
Request Element
PathTypeRequired or notDescription
region_nameStringRequired  Region name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Request Query
RequestTypeRequired or notDescription
offsetQuerySelectRetrieves n items from the bucket list starting from offset
- Offsets start from 0
- Default: 0
limitQuerySelectLimit number of lists
- Default value: 20 (up to 100 items can be viewed)
prefixQuerySelectSearch bucket name by prefix
includeQuerySelectSearch bucket name by containing string
- cannot be used with Prefix
typeQuerySelectType search conditions
- STANDARD
byQuerySelectSorting area
- bucket_name: Bucket name
- bucket_type: Type of bucket
- created_at: Bucket last modified date
- bytes_used: Usage of bucket
directQuerySelectSort order
- asc: Ascending (default)
- desc: Descending
Response Syntax
Response Syntax
{
totalCount: int
offset: int
count: int
items: [SimpleBucket]
}
Response Elements
ResponseTypeDescription
totalCountInt   Total number of buckets
offsetIntRetrieves n items from the bucket list starting from offset
- from i to i+n
countIntNumber of buckets returned
itemsListBucket details
- Model - Simple Bucket
Status Code
HTTP StatusResponseDescription
200     OKSuccess
401UnauthorizedNo permission to view (token error)
403ForbiddenNo viewing permission

Manage bucket access

You can manage access to buckets you own. You can apply public access or IP list-based access control to user-owned buckets with the following request.

Request Syntax
Request Syntax
curl --request POST --location 'https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "my-bucket-new",
"acl": {
"public": "read-only",
"public_read_allow_ip_list": [
"1.1.1.1",
"2.2.2.0/24"
]
}
}'
API method
MethodRequest URL
POST   https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}
PathTypeRequired or notDescription
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-Token  StringRequired  Authentication token
Content-TypeStringRequired  Fixed with application/json
Request Elements
RequestTypeRequired or notDescription
bucket_nameStringRequired  Bucket name
acl ▼StructureRequired  Access rights to bucket
- When null is entered, existing ACL settings are deleted
    publicStringSelectWhether to allow public access
- read-only: Allowed
- deny: Not allowed (same as acl = null)
    public_read_allow_ip_listListSelectList of IPs that allow access
Response Syntax
Response Syntax
{
"project": "0bc7a4c4a8fb4fee98dcf1936d8ed8eb",
"account": "0bc7a4c4a8fb4fee98dcf1936d8ed8eb",
"name": "my-bucket-new",
"type": "STANDARD",
"bytes": 0,
"objectCount": 0,
"createdAt": "2023-07-08T04:08:05Z",
"use_encryption": true,
"encryption_type": "managed",
"lastModified": "2023-07-08T04:08:05Z",
"storageClass": "STANDARD",
"storagePolicy": "default-placement",
"acl": {
"public": "deny",
"public_read_allow_ip_list": null
}
}
Response Elements
ResponseTypeDescription
account (Deprecated)StringProject ID
- Can be confirmed when issuing a token
projectStringProject ID
- Able to get this information when issuing a token
nameStringCreated bucket name
typeStringCreated bucket type
- STANDARD (default): standard bucket
bytesStringTotal usage
- Unit: Byte
objectCountIntNumber of objects in bucket
createdAtStringCreation date
- Format: https://www.rfc-editor.org/rfc/rfc3339
- Example: 2020-07-01T00:00:00Z
use_encryptionBooleanWhether to encrypt bucket
- false (default): Do not encrypt
- true: Encrypt
encryption_typeStringBucket encryption type
lastModifiedStringLast modified
- Format: https://www.rfc-editor.org/rfc/rfc3339
- Example: 2020-07-01T00:00:00Z
storageClassStringStorage class type
- STANDARD (default): bucket of class standard
storagePolicyStringZone of storage class
- default-placement
acl ▼-Access rights to bucket
- When null is entered, existing ACL settings are deleted
    publicStringWhether to allow public access
- read-only, deny
    public_read_allow_ip_listListList of IPs allowed for public access
Status Code
HTTP StatusResponseDescription
200     OKSuccess
401UnauthorizedNo permission (TOKEN error)
403ForbiddenNo edit permission
404Not foundBucket not found

S3 bucket access control

You can control bucket access using the S3 API.

Request Syntax
curl --request POST --location 'https://objectstorage.kr-central-2.kakaocloud.com/{bucket_name}?acl' \
--header 'Authorization: {authorization}' \
--header 'Content-Type: application/xml' \
--header 'x-amz-acl: {Acl}' \
--header 'Content-MD5: {ContentMD5}' \
--header 'x-amz-grant-full-control: {GrantFullControl}' \
--header 'x-amz-grant-read: {GrantRead}' \
--header 'x-amz-grant-read-acp: {GrantReadACP}' \
--header 'x-amz-grant-write: {GrantWrite}' \
--header 'x-amz-grant-write-acp: {GrantWriteACP}' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<AccessControlList>
<Grant>
<Grantee>
<ID>string</ID>
<URI>string</URI>
</Grantee>
<Permission>string</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>'
API method
MethodRequest URL
POST  https://objectstorage.kr-central-2.kakaocloud.com/{bucket_name}?acl
PathTypeRequired or notDescription
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
AuthorizationStringRequired  S3 authorization header
Content-TypeStringRequired  Type of body content
- Input other than application/xml may result in a parsing error
x-amz-aclStringSelectcanned ACL to apply to bucket
- private : public Not public. Remove all permissions except storage.owner
- public-read: Grant storage.objectReader role to all users
- public-read-write: Grant storage.objectCreator role to all users
- authenticated-read: Grants the storage.objectReader role to users authorized on the project
Content-MD5StringRequired  128-bit MD5 of the body encrypted in base64
x-amz-grant-full-controlStringSelectGrant storage.admin role to specified user
- Provide only user ID and AllUsers uri (http://acs.amazonaws.com/groups/global/AllUsers)
x-amz-grant-readStringSelectGrant storage.objectReader role to specified user
- Provide only user ID and AllUsers uri (http://acs.amazonaws.com/groups/global/AllUsers)
x-amz-grant-read-acpStringSelectGrant storage.policyReader role to specified user
- Provide only user ID and AllUsers uri (http://acs.amazonaws.com/groups/global/AllUsers)
x-amz-grant-writeStringSelectGrant storage.objectCreator role to specified user
- Provide only user ID and AllUsers uri (http://acs.amazonaws.com/groups/global/AllUsers)
x-amz-grant-write-acpStringSelectGrant storage.policyWriter role to specified user
- Provide only user ID and AllUsers uri (http://acs.amazonaws.com/groups/global/AllUsers)
Request Elements
RequestTypeRequired or notDescription
bucket_nameStringRequired  Bucket name
AccessControlPolicy ▼StructureSelect
AccessControlList ▼StructureRequired  List of Access Controls to set for bucket
Grant ▼ListRequired  
Grantee ▼StructureRequired  Who will be granted permission
IDStringSelectUser ID
- Input when granting permission to a user
- One of ID and URI must be input
URIStringSelectInput when granting permission to the AllUsers group
- http://acs.amazonaws.com/groups/global/AllUsers
- One of ID and URI must be input.
PermissionStringRequired  Type of permission to grant
- FULL_CONTROL: storage.admin role
- WRITE: storage .objectCreator role
- WRITE-ACP: storage.policyWriter role
- READ: storage.objectReader role
- READ-ACP: storage.policyReader role
Status Code
HTTP StatusResponseDescription
200     OKSuccess
401UnauthorizedNo permission (token error)
403ForbiddenNo edit permission
404Not foundBucket not found

Delete bucket

You can delete buckets that you own. To delete a bucket, storage.buckets.delete permission is required.

  • If objects exist within the bucket, the bucket cannot be deleted.
Request Syntax
Request Syntax
curl --location --request DELETE 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}'
API method
MethodRequest URL
DELETEhttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}
Request Element
PathTypeRequired or notDescription
region_nameStringRequired  Region name
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Status Code
HTTP StatusResponseDescription
204     No ContentDelete successful
401UnauthorizedAuthentication failed
404Not foundBucket not found
409ConflictBucket is not empty

Empty bucket

If you have storage.objects.delete permission, you can delete all objects under the bucket by emptying the bucket. For detailed permissions of Object Storage, please refer to Manage permission.

Request Syntax
Request Syntax
curl --location --request DELETE 'https://objectstorage.kr-central-2.kakaocloud.com/v1/{account}/{bucket_name}/?dir-delete' \
--header 'X-Auth-Token: {X-Auth-Token}'
API method
MethodRequest URL
DELETEhttps://objectstorage.kr-central-2.kakaocloud.com/v1/{account}/{bucket_name}/?dir-delete
PathTypeRequired or notDescription
accountStringRequired  Project ID
- Able to get this information when issuing a token
- Used as the account value in Swift API
directoryStringSelectThe name of the directory whose child objects to delete
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Status Code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestBad request (bad name convention or non-existent)
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Empty bucket folder

If you have storage.objects.delete permission, you can delete all objects under the specified path by emptying the bucket folder. For detailed permissions of Object Storage, please refer to Manage permission.

Request Syntax
Request Syntax
curl --location --request DELETE 'https://objectstorage.kr-central-2.kakaocloud.com/v1/{account}/{bucket_name}/{directory}/?dir-delete' \
--header 'X-Auth-Token: {X-Auth-Token}'
API method
MethodRequest URL
DELETEhttps://objectstorage.kr-central-2.kakaocloud.com/v1/{account}/{bucket_name}/{directory}/?dir-delete
PathTypeRequired or notDescription
accountStringRequired  Project ID
- Able to get this information when issuing a token
- Used as the account value in Swift API
bucket_nameStringRequired  Bucket name
directoryStringSelectThe name of the directory whose child objects you want to delete
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Status Code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestBad request (bad name convention or non-existent)
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Query bucket meta

If you have storage.buckets.get permission, you can view bucket meta information. For detailed permissions of Object Storage, please refer to Manage permission.

Bucket meta inquiry can be done in two ways: the GET and HEAD methods below.

Request Syntax
Request Syntax
curl --location --request GET 'https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}'
API method
MethodRequest URL
GET   https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}
PathTypeRequired or notDescription
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Response Header
RequestTypeRequired or notDescription
X-Container-Meta-*StringRequired  Custom Meta Information
Response Elements
ResponseTypeDescription
projectstringProject ID
namestringBucket name
typestringBucket type
- STANDARD
bytesintTotal capacity of objects included in the bucket
- However, it is updated every 30 minutes and may differ from the current usage
objectCountintTotal number of objects included in the bucket
- However, it is updated every 30 minutes and may differ from the current number
createdAttimeBucket creation date and time
use_encryptionbooleanWhether the bucket is encrypted
lastModifiedtimebucket last modified date
storageClassstringStorage class type
- STANDARD
acl ▼ListAccess management policy
     publicstringWhether to allow public access
- read-only,deny
    public_read_allow_ip_liststringList of IPs allowed for public access
- If an IP list is set, access without a token is only possible for that IP
Status Code
HTTP StatusResponseDescription
200     SuccessSuccess
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundBucket not found

Change bucket meta

If you have storage.buckets.update permission, you can change the meta information of a bucket for which you have bucket meta access. For detailed permissions of Object Storage, please refer to Manage permission.

Request Syntax
Request Syntax
curl --location --request POST 'https://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'X-Object-Meta-Company: kakao enterprise'
API method
MethodRequest URL
POST   https://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}
Request Element
PathTypeRequired or notDescription
region_nameStringRequired  Region name
accountStringRequired  Project ID
- Able to get this information when issuing a token
- Used as the account value in Swift API
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
X-Object-Meta-{name}StringRequired  For bucket meta information, enter the metadata name to specify in {name}
Response Syntax
Status Code
HTTP StatusResponseDescription
200     SuccessSuccess
401UnauthorizedNo permission

Bucket CORS policy

Configure bucket CORS policy settings

Users with the storage.buckets.setIamPolicy permission can set CORS policies for individual buckets. For detailed permissions of Object Storage, please refer to Manage permission. When new CORS settings are applied to a bucket, the entire list is updated.

  • When entering “cors” =[] or an empty body, the previously set cors details are deleted and the default CORS policy is applied. CORS settings set this way will only work with the APIs below.

  • The APIs below can return results accordingly if CORS is set through PUT /v1_ext/bucket/:name/cors in the container.

    • /v1/:account/:container
    • /v1/:account/:container/*object
    • /:bucket (kr-central-2 s3 api)
    • /:bucket/*object (kr-central-2 s3 api)
info

If the CORS policy is not set, access from external domains other than the console is not allowed.

Request Syntax
Request Syntax
curl --request PUT --location 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json' \
--data '{
"cors": [
{
"allowed_origins": [
"https://www.example1.com"
],
"allowed_methods": [
"PUT",
"GET"
],
"allowed_headers": [
"*"
],
"expose_headers": [],
"max_age_seconds": 10
},
{
"allowed_origins": [
"https://www.example2.com"
],
"allowed_methods": [
"PUT",
"GET",
"DELETE"
],
"allowed_headers": [
"*"
],
"expose_headers": [
"X-Object-Meta-User-Defined"
],
"max_age_seconds": 10
}
]
}'
API method
MethodRequest URL
POST   https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors
PathTypeRequired or notDescription
region_nameStringRequired  Region name
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Content-TypeStringRequired  Fixed with application/json
Request Elements
RequestTypeRequired or notDescription
region_nameStringRequired  Region name
cors ▼listRequired  CORS Policies
- Maximum number of CORS policies that can be set: 10
    allowed_originsListRequired  Allow access origin
- Includes protocols such as http or https
- Includes up to 1 * (wildcard) character
- Maximum input length per origin: 200
- The port can be specified
- If 80 or 443 is specified as the port along with the protocol, if the Origin Header entered later specifies only the protocol and does not specify the port, the cors allow header is returned. Not working
    allowed_methodsListRequired  Methods to allow access
- PUT, POST, GET, DELETE, etc.
    allowed_headersListRequired  Header to allow access
    expose_headersListRequired  Headers exposed to browser
    max_age_secondsIntSelectLifespan for caching preflight request results
- If not entered, no caching
Response Syntax
Response Syntax
{
"cors": [
{
"allowed_origins": [
"https://www.example1.com"
],
"allowed_headers": [
"*"
],
"allowed_methods": [
"PUT",
"GET"
],
"expose_headers": [],
"max_age_seconds": 10
},
{
"allowed_origins": [
"https://www.example2.com"
],
"allowed_headers": [
"*"
],
"allowed_methods": [
"PUT",
"GET",
"DELETE"
],
"expose_headers": [
"X-Object-Meta-User-Defined"
],
"max_age_seconds": 10
}
]
}
Status Code
HTTP StatusResponseDescription
200OKSuccess
400Bad RequestBad Request (Bad Name Rule)
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundBucket not found

Query bucket CORS policy

If you have storage.buckets.getIamPolicy permission, you can query CORS settings for individual buckets. For detailed permissions of Object Storage, please refer to Manage permission.

Request Syntax
Request Syntax
curl --request GET --location 'https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors' \
--header 'X-Auth-Token: {x-auth-token}' \
--header 'Content-Type: application/json'
API method
MethodRequest URL
GET  https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/{bucket_name}/cors
Request Element
PathTypeRequired or notDescription
region_nameStringRequired  Region name
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Content-TypeStringRequired  Fixed with application/json
Response Syntax
Response Syntax
{
"cors": [
{
"allowed_origins": [
"https://www.example1.com"
],
"allowed_headers": [
"*"
],
"allowed_methods": [
"PUT",
"GET"
],
"expose_headers": [],
"max_age_seconds": 10
},
{
"allowed_origins": [
"https://www.example2.com"
],
"allowed_headers": [
"*"
],
"allowed_methods": [
"PUT",
"GET",
"DELETE"
],
"expose_headers": [
"X-Object-Meta-User-Defined"
],
"max_age_seconds": 10
}
]
}
Response Elements
RequestTypeRequired or notDescription
cors ▼List Required  CORS Policies
- Maximum number of CORS policies that can be set: 10
    allowed_originsListRequired  Allow access origin
- Contains up to 1 * (wildcard) character
- Maximum input length per origin: 200
    allowed_methodsListRequired  Method to allow access (HTTP)
    allowed_headersListRequired  Header to allow access
    expose_headersListRequired  Headers exposed to browser
    max_age_secondsIntSelectLifespan for caching preflight request results
Status Code
HTTP StatusResponseDescription
200OKSuccess
400Bad RequestBad request (bad name convention or non-existent)
401UnauthorizedAuthentication failed
403ForbiddenNo permission

CORS preflight request

You can request CORS Preflight for your bucket.

  • The API at the bottom can return results accordingly if the container has CORS set through PUT /v1_ext/bucket/:name/cors.
    • /v1/:account/:container
    • /v1/:account/:container/*object
    • /:bucket (kr-central-2 s3 api)
    • /:bucket/*object (kr-central-2 s3 api)
Request Syntax
Request Syntax
curl --location --request OPTIONS 'http://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/test.txt' \
--header 'Origin: https://www.example1.com' \
--header 'Access-Control-Request-Headers: X-Auth-Token,Content-Type' \
--header 'Access-Control-Request-Method: GET'
Request Element
PathTypeRequired or notDescription
accountStringRequired  Project ID
- Able to get this information when issuing a token
- Used as the account value in Swift API
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
API method
MethodRequest URL
OPTIONS  https://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket
OPTIONShttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/:name
- name: Bucket name
OPTIONShttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/:name/policy
- name: Bucket name
OPTIONShttps://objectstorage.{region_name}.kakaocloud.com/v1_ext/bucket/:name/policy/:id
- name: Bucket name
- id: policy ID
OPTIONShttps://objectstorage.{region_name}.kakaocloud.com/v1/:account/:name
- account: Project ID
- name: Bucket name
OPTIONShttps://objectstorage.{region_name}.kakaocloud.com/v1/:account/:name/*object
- account: Project ID
- name: Bucket name
- * object: object path
OPTIONShttps://objectstorage.kr-central-2.kakaocloud.com/v1/:name
- name: Bucket name
OPTIONShttps://objectstorage.{region_name}.kakaocloud.com/v1/:name/*object
- name: Bucket name
- *object: object path
Request Header
RequestTypeRequired or notDescription
OriginStringRequired  Origin
- Server location including Protocol, Host, and Port
Access-Control-Request-HeadersListRequired  List of preliminary request headers
- X-Auth-Token, Content-Type
Access-Control-Request-MethodListRequired   List of preliminary request methods
- Example: PUT, POST, GET, DELETE
Response Header
ResponseTypeDescription
Content-LengthIntBody length
Access-Control-Allow-CredentialsBooleanOption to allow sharing of cookies between different domains
- true: Allow
- false: Do not allow
Access-Control-Allow-HeadersStringHTTP headers that can allow access to resources
Access-Control-Allow-MethodsStringHTTP method that allows access to the resource
Access-Control-Allow-OriginStringOrigins that allow access
Access-Control-Expose-HeadersStringHeaders exposed to browser
Access-Control-Max-AgeIntTime to cache the result of a preflight request
Response Syntax
Response Syntax
HTTP/1.1 200 OK
Content-Length: 0
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: *
Access-Control-Allow-Methods: PUT, GET
Access-Control-Allow-Origin: https://www.example1.com
Access-Control-Expose-Headers:
Access-Control-Max-Age: 10
Vary: Origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
Status Code
HTTP StatusResponseDescription
200      OKSuccess
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Requests other than CORS Preflight

CORS comparison is performed based on the request, and for requests that do not meet CORS settings, Access-Control-Allow-Header, Access-Control-Allow-Methods, and Access-Control-Max-Age Header are not returned. not. To apply CORS, Origin must be set in the header.

Request Syntax
Request Syntax
curl --location --request GET 'http://objectstorage.{regoin_name}.kakaocloud.com/v1/{account}/{bucket_name}/{object}' \
--header 'x-auth-token: {x-auth-token}' \
--header 'Origin: https://www.example1.com'
API 호출 방식
MethodURL
GET  http://objectstorage.{region_name}.kakaocloud.com/v1/{account}/{bucket_name}/{object}
Request Element
PathTypeRequired or notDescription
region_nameStringRequired  Region name
accountStringRequired  Project ID
- Able to get this information when issuing a token
- Used as the account value in Swift API
bucket_nameStringRequired  Bucket name
objectStringRequired  Object name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Response Header Syntax
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 10
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: https://www.example1.com
Access-Control-Allow-Methods: PUT, GET
Access-Control-Expose-Headers: {}
Etag: {ETag value}
Last-Modified: Thu, 07 Jul 2022 08:13:27 GMT
Vary: Origin
Response Elements
ResponseDescription
Content-TypeUsed to indicate the media type of the resource
Content-LengthSize of the object body in bytes sent to the recipient
Access-Control-Allow-CredentialsOption to allow cookie sharing between different domains
- true: Allow
- false: Do not allow
Access-Control-Allow-OriginOrigin that allows access
Access-Control-Expose-HeadersHeaders exposed to browser
EtagObject's unique hash value
- The ETag HTTP response header is an identifier that identifies a specific version of the resource
- When the web server checks for content changes and finds none, it avoids sending a full request to the web server,
enabling efficient cache usage and bandwidth savings.
- Useful for preventing “mid-air collisions” when changes are made
Last-ModifiedLast modified date
- A response that contains the last modified date and time known to the server in the HTTP header
Status Code
HTTP StatusResponseDescription
200     OKSuccess
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Bucket lifecycle

The storage.buckets.update permission is required to create and manage a bucket's LifeCycle. For detailed permissions of Object Storage, please refer to Manage permission.

Create bucket lifecycle

When creating a bucket life cycle, the previously created life cycle is overwritten. Therefore, If you need to update only part of the existing life cycle, you must receive the entire settings, modify only the necessary parts, and then request an update.

Request Syntax
Request Syntax
PUT /v1_ext/bucket/{bucket_name}/lifecycle
X-Auth-Token: {x-auth-token}

<?xml version="1.0"?>
<LifecycleConfiguration>
<Rule>
<ID>day1Rule</ID>
<Expiration>
<Days>1</Days>
</Expiration>
<Prefix>expire1/</Prefix>
<Status>Enabled</Status>
</Rule>
<Rule>
<ID>dateRule</ID>
<Expiration>
<Date>2023-06-10T00:00:00.000Z</Date>
</Expiration>
<Prefix>20230-06-08/</Prefix>
<Status>Enabled</Status>
</Rule>
</LifecycleConfiguration>
API method
MethodRequest URL
PUT   https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle
PathTypeRequired or notDescription
bucket_nameStringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Request Body
RequestTypeRequired or notDescription
Rule ▼ListRequired  Life cycle policy
    IDStringSelectID that identifies the rule
- Unique string of up to 255 characters
Expiration ▼StructureRequired  Settings for deletion
- Date or Days fields must be entered
    DateTimestampSelectDate to delete object
- Only 2023-06-10T00:00:00.000Z in GMT ISO 8601 format can be entered
    DaysintegerSelectLife cycle of an object
- The object is deleted after the date set based on the creation date
- Only positive numbers other than 0 can be entered
Filter ▼StructureSelectSpecifies the conditions of the object to which the life cycle will be applied
    PrefixStringRequired  Prefix of the object to which the rule will be applied
- The following special characters must be replaced with XML entity codes
'&apos;
&quot;
&&amp;
<&lt;
>&gt;
\r&#13; or &#x0D;
\n&#10; or &#x0A;

For detailed explanation, see XML-Related Object Key Constraints in AWS
    StatusStringRequired  Whether to apply lifecycle
- Enabled: Lifecycle is set
- Disabled: Lifecycle is not set
Response Syntax
Response Syntax
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Wed, 01 Feb 2023 07:23:12 GMT
Content-Length: 376

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>day1Rule</ID>
<Expiration>
<Days>1</Days>
</Expiration>
<Prefix>expire1/</Prefix>
<Status>Enabled</Status>
</Rule>
<Rule>
<ID>dateRule</ID>
<Expiration>
<Date>2023-06-10T00:00:00.000Z</Date>
</Expiration>
<Prefix>20230-06-08/</Prefix>
<Status>Enabled</Status>
</Rule>
</LifecycleConfiguration>

Response Elements
ResponseTypeDescription
Rule ▼ListLife cycle policy
    IDstringID that identifies the rule
- Unique string of up to 255 characters
    PrefixstringPrefix of the object to which the rule will be applied
- The following special characters are replaced with XML entity codes

' → '
” → "
& → &
< → <
> → >
\r → or
\n → or

For a detailed explanation, see AWS's XML-related object key constraints
    StatusstringWhether to apply lifecycle
- Enabled: Lifecycle is set
- Disabled: Lifecycle is not set
    ExpirationintegerSettings for deletion
Status Code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestConfiguration setting error
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundBucket not found

View bucket lifecycle list

If you have storage.buckets.update permission, you can create and manage lifecycle for Object Storage, defining a set of life cycle rules to apply to groups of objects. You can manage storage space efficiently by deleting unused files through the life cycle of the bucket.

info

Expiry rule of a lifecycle runs once a day, at 00:00 (midnight). If the life cycle policy is deleted before 00:00 or 12:00 on the day the object expires, the policy will not be applied immediately.

Request Syntax
Request Syntax
curl --location --request GET 'https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle' \
--header 'X-Auth-Token: {X-Auth-Token}'
API method
MethodRequest URL
GET   https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle
PathTypeRequired or notDescription
bucket_namestringRequired  Bucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Response Syntax
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
Date: Wed, 01 Feb 2023 07:23:12 GMT
Content-Length: 376

<?xml version="1.0" encoding="UTF-8"?>
<LifecycleConfiguration>
<Rule>
<ID>day1Rule</ID>
<Expiration>
<Days>1</Days>
</Expiration>
<Prefix>expire1/</Prefix>
<Status>Enabled</Status>
</Rule>
<Rule>
<ID>dateRule</ID>
<Expiration>
<Date>2023-06-10T00:00:00.000Z</Date>
</Expiration>
<Prefix>20230-06-08/</Prefix>
<Status>Enabled</Status>
</Rule>
</LifecycleConfiguration>
Response Elements
ResponseTypeDescription
Rule ▼ListLifecycle policy
     IDstringID that identifies the rule
- Unique string of up to 255 characters
     PrefixstringPrefix of the object to which the rule will be applied
- The following special characters are replaced with XML entity codes

'&apos;
&quot;
&&amp;
<&lt;
>&gt;
\r&#13 ; or &#x0D;
\n&#10; or &#x0A;

For detailed explanation, see XML-related object key constraints in AWS. Conditions document Reference
     StatusstringWhether to apply life cycle
- Enabled: Life cycle is set
- Disabled: Life cycle is not set
     ExpirationintegerSettings for deletion
Status Code
HTTP StatusResponseDescription
200     SuccessSuccess
400Bad RequestConfiguration setting error
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not FoundNo bucket

Delete bucket LifeCycle

Users with LifeCycle access can delete a LifeCycle from a bucket.

Request Syntax
Request Syntax
curl --location --request DELETE 'https://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle' \
--header 'X-Auth-Token: {X-Auth-Token}'
API method
MethodRequest URL
DELETEhttps://objectstorage.kr-central-2.kakaocloud.com/v1_ext/bucket/{bucket_name}/lifecycle
PathRequired or notTypeDescription
bucket_nameRequired  StringBucket name
Request Header
RequestTypeRequired or notDescription
X-Auth-TokenStringRequired  Authentication token
Response Syntax
Status Code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestConfiguration setting error
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundBucket not found