Skip to content

Add Lifecycle Rule

PUT
/api/v1/storage/bucket_lifecycle/{bucket_name}/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/storage/bucket_lifecycle/{bucket_name}/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"bucket_name": "bucketname",
"lifecycle_rules": [
{
"expiration_days": 1,
"new_status": "Enabled",
"noncurrent_version_expiration_date_or_days": 1,
"prefix": "",
"rule_id": 0
}
]
}'
bucket_name
required
string

Bucket Name

project_id
required
integer
location
required
string
Allowed values: Delhi Chennai

Deployment region for the resource. Accepted values: Delhi, Chennai.

Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.

Media typeapplication/json
object
bucket_name
required
string

Example

bucketname
lifecycle_rules
required
Array<object>
object
expiration_days
required
integer

Example

1
new_status
required
string
Allowed values: Enabled Disabled

Example

Enabled
noncurrent_version_expiration_date_or_days
required
integer

Example

1
prefix
string

Example

rule_id
required
integer

Example

0

A successful response with lifecycle rule information

Media typeapplication/json
object
code
integer
data
Array<object>
object
id
integer
deleted
boolean
created_at
string format: date-time
updated_at
string format: date-time
rule_id
string
enabled
boolean
prefix
string
expiry_date_or_days
string
noncurrent_version_expiration_date_or_days
string
transition
string
storage_class
string
tags
string
location
string
bucket
integer
user
integer
errors
object
message
string

Example

{
"code": 200,
"data": [
{
"id": 948,
"deleted": false,
"created_at": "2024-11-05T09:05:25.569506Z",
"updated_at": "2024-11-05T09:05:25.569606Z",
"rule_id": "1aaed24b83a14ee4af38dc53d46a069b",
"enabled": true,
"prefix": "",
"expiry_date_or_days": "1",
"noncurrent_version_expiration_date_or_days": "1",
"transition": "",
"storage_class": "",
"tags": "",
"location": "Delhi",
"bucket": 9053,
"user": 5146
}
],
"message": "Success"
}