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 } ]}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/storage/bucket_lifecycle/{bucket_name}/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "bucket_name": "bucketname", "lifecycle_rules": [ { "expiration_days": 1, "new_status": "Enabled", "noncurrent_version_expiration_date_or_days": 1, "prefix": "", "rule_id": 0, }, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/storage/bucket_lifecycle/{bucket_name}/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "bucket_name": "bucketname", "lifecycle_rules": [ { "expiration_days": 1, "new_status": "Enabled", "noncurrent_version_expiration_date_or_days": 1, "prefix": "", "rule_id": 0 } ] }),});console.log(await response.json());Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”bucket_name
required
string
Bucket Name
Query Parameters
Section titled “Query Parameters”project_id
required
integer
Project ID Find your project id here
location
required
string
Deployment region for the resource. Accepted values: Delhi, Chennai.
Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.
Request Body
Section titled “Request Body”Media typeapplication/json
object
bucket_name
required
string
Example
bucketnamelifecycle_rules
required
Array<object>
object
expiration_days
required
integer
Example
1new_status
required
string
Example
Enablednoncurrent_version_expiration_date_or_days
required
integer
Example
1prefix
string
Example
rule_id
required
integer
Example
0Responses
Section titled “Responses”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"}