Skip to main content

Bucket

You can use the Bucket API of Object Storage to manage bucket creation and related information and policies.

Prerequisite

API endpoint URL

The Object Storage API endpoint URL for the kr-central-2 region is as follows.

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

Create bucket

Create a bucket.

Permission info

According to KakaoCloud IAM roles, the Project admin or Project member role is required to create a bucket.

Request Syntax
Create bucket request syntax
curl --request PUT --location 'https://objectstorage.{Region_Name}.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 call method
MethodRequest URL
PUT  https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  Enter the API authentication token

| Content-Type | String | Required   | Fixed to application/json |

Request Elements
RequestTypeRequiredDescription
nameStringRequired  Bucket name
typeStringRequired  Bucket type
- Standard (default): standard bucket
use_encryptionBooleanOptionalWhether to encrypt the bucket
If encryption_configuration is specified, this value is ignored
- false (default): Do not encrypt
- true: Encrypt
(same as encryption_configuration.type = managed)
encryption_configuration ▼StructureOptionalBucket encryption settings
    typeStringRequired  Encryption method
- managed (default): automatic encryption provided by the server
- true (planned): encryption integrated with a key management service using KMS
Response Syntax
Create bucket 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
- The Account value in the Swift API. You can check it when issuing a token (the project ID used/checked during the token issuance process)
projectStringProject ID
nameStringCreated bucket name
typeStringCreated bucket type
- STANDARD (default): standard bucket
bytesStringTotal usage
- Unit: Byte
objectCountIntNumber of objects in the bucket
createdAtStringCreation date
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
use_encryptionBooleanWhether to encrypt the bucket
- false (default): Do not encrypt
- true: Encrypt
encryption_typeStringBucket encryption type
lastModifiedStringLast modified date
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
storageClassStringStorage class type
- STANDARD (default): bucket of the standard class
storagePolicyStringZone of the storage class
- default-placement (default)
acl ▼-Access permission for the bucket
- If null is entered, the 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 RequestInvalid input settings
401UnauthorizedNo permission
409ConflictsCreation failed
- The same Bucket_Name already exists

Manage bucket

View bucket details

If you have the storage.buckets.get permission, you can view detailed information about a specific bucket. For detailed permissions of Object Storage, see Roles and permissions.

Request Syntax
View bucket details 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 call method
MethodRequest URL
GET   https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/{Bucket_Name}
PathTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  Enter the API authentication token
Response Syntax
View bucket details 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
- Can be checked when issuing a token (the project ID used/checked during the token issuance process)
- Used in the S3 API
nameStringCreated bucket name
typeStringCreated bucket type
- standard (default): standard bucket
bytesStringTotal usage
- Unit: Byte
objectCountIntNumber of objects in the bucket
createdAtStringCreation date
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
use_encryptionBooleanWhether to encrypt the bucket
- false (default): Do not encrypt
- true: Encrypt
encryption_typeStringBucket encryption type
lastModifiedStringLast modified date
- Format: RFC3339
- Example: 2020-07-01T00:00:00Z
storageClassStringStorage class type (provided only in kr-central-2)
- standard (default): bucket of the standard class
storagePolicyStringZone of the storage class
acl ▼-Access permission for the bucket
- If null is entered, the existing ACL settings are deleted
    publicStringRead-only
- Only read-only can be entered
    public_read_allow_ip_listListIPs allowed for public access
Status code
HTTP StatusResponseDescription
200     OKSuccess
400Bad RequestInvalid input settings
401UnauthorizedAuthentication failed
403ForbiddenNo permission

View bucket list

You can view the bucket list.

Permission info

According to KakaoCloud IAM roles, the Project admin or Project member role is required to view buckets.

Request Syntax
View bucket list 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 call method
MethodRequest URL
GET  https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket
Request Element
PathTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Request Query
RequestTypeRequiredDescription
offsetQueryOptionalRetrieve n items from the offset in the bucket list
- The offset starts from 0
- Default: 0
limitQueryOptionalLimit the number of items
- Default: 20 (up to 100 can be viewed)
prefixQueryOptionalSearch bucket names by prefix
includeQueryOptionalSearch bucket names by included string
- Cannot be used together with Prefix
typeQueryOptionalType search condition
- STANDARD (kr-central-2)
byQueryOptionalSort field
- Bucket_Name: bucket name
- bucket_type: bucket type
- created_at: last modified date of the bucket
- bytes_used: usage of the bucket
directQueryOptionalSort order
- asc: ascending (default)
- desc: descending
Response Syntax
View bucket list response syntax
{
totalCount: int
offset: int
count: int
items: [SimpleBucket]
}
Response Elements
ResponseTypeDescription
totalCountInt   Total number of buckets
offsetIntRetrieve n items from the offset in the bucket list
- From the i-th to the i+n-th item
countIntNumber of returned buckets
itemsListDetailed information of buckets
Status code
HTTP StatusResponseDescription
200     OKSuccess
401UnauthorizedNo permission to view (token error)
403ForbiddenNo permission to view

Manage bucket access

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

Request Syntax
IP list-based access control request syntax
curl --request POST --location 'https://objectstorage.{Region_Name}.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 call method
MethodRequest URL
POST   https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}
PathTypeRequiredDescription
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-Token  StringRequired  API authentication token
Content-TypeStringRequired  Fixed to application/json
Request Elements
RequestTypeRequiredDescription
Bucket_NameStringRequired  Bucket name
acl ▼StructureRequired  Access permission for the bucket
- If null is entered, the existing ACL settings are deleted
    publicStringOptionalWhether to allow public access
- read-only: allow
- deny: do not allow (same as acl = null)
    public_read_allow_ip_listListOptionalList of IPs allowed to access
Response Syntax
Manage bucket access 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 checked when issuing a token (the project ID used/checked during the token issuance process). Scheduled for deletion
projectStringProject ID
- Can be checked when issuing a token (the project ID used/checked during the token issuance process)
nameStringCreated bucket name
typeStringCreated bucket type
- STANDARD (default): standard bucket
bytesStringTotal usage - Unit: Byte
objectCountIntNumber of objects in the bucket
createdAtStringCreation date
- Format: https://www.rfc-editor.org/rfc/rfc3339
- Example: 2020-07-01T00:00:00Z
use_encryptionBooleanWhether to encrypt the bucket
- false (default): Do not encrypt
- true: Encrypt
encryption_typeStringBucket encryption type
lastModifiedStringLast modified date
- Format: https://www.rfc-editor.org/rfc/rfc3339
- Example: 2020-07-01T00:00:00Z
storageClassStringStorage class type
- STANDARD (default): bucket of the standard class
storagePolicyStringZone of the storage class
- default-placement (default)
acl ▼-Access permission for the bucket
- If null is entered, the 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 permission to modify
404Not foundCannot find the bucket

Delete bucket

You can delete buckets owned by the user. To delete a bucket, the storage.buckets.delete permission is required.

  • If objects exist in the bucket, the bucket cannot be deleted.
Request Syntax
Delete bucket 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 call method
MethodRequest URL
DELETEhttps://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}
Request Element
PathTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Response Syntax
Status code
HTTP StatusResponseDescription
204     No ContentDeleted successfully
401UnauthorizedAuthentication failed
404Not foundCannot find the bucket
409ConflictThe bucket is not empty

Delete multiple buckets and objects

A user with delete permission can delete buckets and objects in the project in bulk.
The system attempts to delete the input list sequentially and returns each deletion result in a single response body.

  • Planned for future support.

Empty bucket

If you have the storage.objects.delete permission, you can delete all objects under the bucket by emptying the bucket. For detailed permissions of Object Storage, see Roles and permissions.

Request Syntax
Empty bucket request syntax
curl --location --request DELETE 'https://objectstorage.{Region_Name}.kakaocloud.com/v1/{account}/{Bucket_Name}/?dir-delete' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{Region_Name}.kakaocloud.com/v1/{account}/{Bucket_Name}/?dir-delete
PathTypeRequiredDescription
accountStringRequired  Project ID
- Can be checked when issuing a token (the project ID used/checked during the token issuance process)
- Used as the Account value in the Swift API
directoryStringOptionalName of the directory whose child objects you want to delete
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Response Syntax
Status code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestInvalid request (invalid naming rule or does not exist)
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Empty bucket folder

If you have the storage.objects.delete permission, you can delete all objects under the specified path by emptying the bucket folder. For detailed permissions of Object Storage, see Roles and permissions.

Request Syntax
Empty bucket folder request syntax
curl --location --request DELETE 'https://objectstorage.{Region_Name}.kakaocloud.com/v1/{account}/{Bucket_Name}/{directory}/?dir-delete' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{Region_Name}.kakaocloud.com/v1/{account}/{Bucket_Name}/{directory}/?dir-delete
PathTypeRequiredDescription
accountStringRequired  Project ID
- Can be checked when issuing a token (the project ID used/checked during the token issuance process)
- Used as the Account value in the Swift API
Bucket_NameStringRequired  Bucket name
directoryStringOptionalName of the directory whose child objects you want to delete
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Response Syntax
Status code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestInvalid request (invalid naming rule or does not exist)
401UnauthorizedAuthentication failed
403ForbiddenNo permission

View bucket metadata

If you have the storage.buckets.get permission, you can view bucket metadata. For detailed permissions of Object Storage, see Roles and permissions.

You can view bucket metadata in two ways using the GET and HEAD methods below.

Request Syntax
View bucket metadata (GET) 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 call method
MethodRequest URL
GET   https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}
PathTypeRequiredDescription
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Response Syntax
Response Header
RequestTypeRequiredDescription
X-Container-Meta-*StringRequired  User-defined metadata
Response Elements
ResponseTypeDescription
projectstringProject ID
namestringBucket name
typestringBucket type
- STANDARD
bytesintTotal size of objects in the bucket
- However, it is updated every 30 minutes and may differ from the current usage
objectCountintTotal number of objects in the bucket
- However, it is updated every 30 minutes and may differ from the current count
createdAttimeBucket creation date and time
use_encryptionbooleanWhether the bucket is encrypted
lastModifiedtimeLast modified date and time of the bucket
storageClassstringStorage class type
- STANDARD
acl ▼ListAccess control 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 allowed only from those IPs
Status code
HTTP StatusResponseDescription
200     SuccessSuccess
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundCannot find the bucket

Modify bucket metadata

If you have the storage.buckets.update permission, you can modify metadata of a bucket for which you have metadata access permission. For detailed permissions of Object Storage, see Roles and permissions.

Request Syntax
Modify bucket metadata 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 call method
MethodRequest URL
POST   https://objectstorage.{Region_Name}.kakaocloud.com/v1/{account}/{Bucket_Name}
Request Element
PathTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
accountStringRequired  Project ID
- Can be checked when issuing a token (the project ID used/checked during the token issuance process)
- Used as the Account value in the Swift API
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
X-Object-Meta-{name}StringRequired  Bucket metadata. Enter the user-defined metadata name in {name}
Response Syntax
Status code
HTTP StatusResponseDescription
200     SuccessSuccess
401UnauthorizedNo permission

Bucket CORS policy

Configure bucket CORS policy

A user with the storage.buckets.setIamPolicy permission can configure a CORS policy for an individual bucket. For detailed permissions of Object Storage, see Roles and permissions. When a new CORS configuration is applied to a bucket, the entire list is updated.

  • If "cors" = [] or an empty body is entered, the existing CORS settings are deleted and the default CORS policy is applied. A CORS setting configured in this way works only with the APIs below.

  • The APIs below can return results according to the CORS settings if the container has CORS configured 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)
note

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

Request Syntax
Configure CORS policy 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 call method
MethodRequest URL
POST   https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/cors
PathTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Content-TypeStringRequired  Fixed to application/json
Request Elements
RequestTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
cors ▼listRequired  CORS policy - Maximum number of CORS policies that can be configured: 10
    allowed_originsListRequired  Allowed origins for access
- Must include a protocol such as http or https
- Can include up to one * (wildcard) character
- Maximum length per origin: 200
- A port can be specified
- If port 80 or 443 is specified together with the protocol, and a later Origin Header specifies only the protocol without the port, the CORS allow header is not returned
    allowed_methodsListRequired  Methods allowed for access
- PUT, POST, GET, DELETE, and so on
    allowed_headersListOptional  Headers allowed for access
    expose_headersListOptional  Headers exposed to the browser
    max_age_secondsIntOptionalLifetime for caching the preflight request result
- If omitted, the result is not cached
Response Syntax
Configure CORS policy 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 RequestInvalid request (invalid naming rule)
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundCannot find the bucket

View bucket CORS policy

If you have the storage.buckets.getIamPolicy permission, you can view the CORS settings for an individual bucket. For detailed permissions of Object Storage, see Roles and permissions.

Request Syntax
View CORS policy 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 call method
MethodRequest URL
GET  https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/cors
Request Element
PathTypeRequiredDescription
Region_NameStringRequired  Region name
- kr-central-2
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Content-TypeStringRequired  Fixed to application/json
Response Syntax
View CORS policy 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
RequestTypeRequiredDescription
cors ▼List Required  CORS policy
- Maximum number of CORS policies that can be configured: 10
    allowed_originsListRequired  Allowed origins for access
- Can include up to one * (wildcard) character
- Maximum length per origin: 200
    allowed_methodsListRequired  Methods allowed for access (HTTP)
    allowed_headersListRequired  Headers allowed for access
    expose_headersListRequired  Headers exposed to the browser
    max_age_secondsIntOptionalLifetime for caching the preflight request result
Status code
HTTP StatusResponseDescription
200OKSuccess
400Bad RequestInvalid request (invalid naming rule or does not exist)
401UnauthorizedAuthentication failed
403ForbiddenNo permission

Request CORS preflight

You can request CORS preflight for a bucket.

  • The APIs below can return results according to the CORS settings if the bucket has CORS configured 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 CORS preflight 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
PathTypeRequiredDescription
accountStringRequired  Project ID
- Can be checked when issuing a token (the project ID used/checked during the token issuance process)
- Used as the Account value in the Swift API
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
OriginStringRequired  Origin
- The server location combining protocol, host, and port
Access-Control-Request-HeadersListRequired  List of headers for the preflight request
- X-Auth-Token, Content-Type
Access-Control-Request-MethodListRequired   List of methods for the preflight request
- Example: PUT, POST, GET, DELETE
Response Header
ResponseTypeDescription
Content-LengthIntBody length
Access-Control-Allow-CredentialsBooleanOption that allows cookie sharing across different domains
- true: allow
- false: do not allow
Access-Control-Allow-HeadersStringHTTP headers allowed to access the resource
Access-Control-Allow-MethodsStringHTTP methods allowed to access the resource
Access-Control-Allow-OriginStringOrigin allowed to access
Access-Control-Expose-HeadersStringHeaders exposed to the browser
Access-Control-Max-AgeIntTime for which the preflight request result can be cached
Status code

For a CORS preflight (OPTIONS) request, the server returns a 204 No Content status code, and whether CORS is allowed is determined based on the response headers (Access-Control-Allow-*).

Bucket Lifecycle

To create and manage the lifecycle of a bucket, the storage.buckets.update permission is required. For detailed permissions of Object Storage, see Roles and permissions.

Create bucket lifecycle

When you create a bucket lifecycle, the previously created lifecycle is overwritten. Therefore, if only part of the existing lifecycle needs to be updated, you must retrieve the full configuration, modify only the required part, and then send the update request.

Request Syntax
Create bucket lifecycle 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 call method
MethodRequest URL
PUT   https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/lifecycle
PathTypeRequiredDescription
Bucket_NameStringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Request Body
RequestTypeRequiredDescription
Rule ▼ListRequired  Lifecycle policy
    IDStringOptionalID that identifies the rule
- Unique string of up to 255 characters
Expiration ▼StructureRequired  Settings for deletion
- You must enter either the Date or Days field
    DateTimestampOptionalDate when the object is deleted
- Only the GMT ISO 8601 format 2023-06-10T00:00:00.000Z can be entered
    DaysintegerOptionalLifecycle of the object
- The object is deleted after the configured number of days based on the creation date
- Only positive integers other than 0 can be entered
Filter ▼StructureOptionalSpecifies the conditions of objects to which the lifecycle applies
    PrefixStringRequired  Prefix of the object to which the rule applies
- 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 details, see AWS XML-related object key constraints
    StatusStringRequired  Whether to apply the lifecycle
- Enabled: configure the lifecycle
- Disabled: do not configure the lifecycle
Response Syntax
Create bucket lifecycle 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 applies
- The following special characters are replaced with XML entity codes

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

For details, see AWS XML-related object key constraints
    StatusstringWhether to apply the lifecycle
- Enabled: configure the lifecycle
- Disabled: do not configure the lifecycle
    ExpirationintegerSettings for deletion
Status code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestInvalid configuration setting
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundCannot find the bucket

View bucket lifecycle list

If you have the storage.buckets.update permission, you can create and manage the lifecycle of Object Storage to define a set of lifecycle rules to apply to object groups. Through the bucket lifecycle, you can efficiently manage storage space by deleting unused files.

note

The expiry rule of the lifecycle runs once a day, at 00:00 (midnight). If you delete the lifecycle policy before 00:00 or 12:00 on the day the object expires, that policy is not applied immediately.

Request Syntax
View bucket lifecycle list request syntax
curl --location --request GET 'https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/lifecycle' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
GET   https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/lifecycle
PathTypeRequiredDescription
Bucket_NamestringRequired  Bucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Response Syntax
View bucket lifecycle list 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 applies
- The following special characters are replaced with XML entity codes

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

For details, see AWS XML-related object key constraints
     StatusstringWhether to apply the lifecycle
- Enabled : configure the lifecycle
- Disabled : do not configure the lifecycle
     ExpirationintegerSettings for deletion
Status code
HTTP StatusResponseDescription
200     SuccessSuccess
400Bad RequestInvalid configuration setting
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not FoundBucket does not exist

Delete bucket lifecycle

A user with lifecycle access permission can delete the lifecycle of a bucket.

Request Syntax
Delete bucket lifecycle request syntax
curl --location --request DELETE 'https://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/lifecycle' \
--header 'X-Auth-Token: {X-Auth-Token}'
API call method
MethodRequest URL
DELETEhttps://objectstorage.{Region_Name}.kakaocloud.com/v1_ext/bucket/{Bucket_Name}/lifecycle
PathRequiredTypeDescription
Bucket_NameRequired  StringBucket name
Request Header
RequestTypeRequiredDescription
X-Auth-TokenStringRequired  API authentication token
Response Syntax
Status code
HTTP StatusResponseDescription
200    OKSuccess
400Bad RequestInvalid configuration setting
401UnauthorizedAuthentication failed
403ForbiddenNo permission
404Not foundCannot find the bucket