Skip to content

Create Lifecycle Rule

POST
/datasets/{Dataset_Id}/lifecycle-rule/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/datasets/{Dataset_Id}/lifecycle-rule/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"apply_to": "all_objects",
"expiration_days": "string",
"prefix": "string"
}'

Create a lifecycle rule for automatic object expiration in the dataset’s EOS bucket. Rules can be applied to all objects or to objects with a specific prefix.

Dataset_Id
required
integer
project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
apply_to
required

Scope of the lifecycle rule:

  • all_objects: Apply rule to all objects in the bucket
  • objects_with_prefix: Apply rule only to objects with the specified prefix
string
Allowed values: all_objects objects_with_prefix
expiration_days
required

Number of days after which objects will be deleted

string
prefix

Object prefix/folder path (required when apply_to is objects_with_prefix)

string

Success response with lifecycle rules information.

Media typeapplication/json
object
code

HTTP status code.

integer
data
Array<object>
object
id

Unique identifier of the lifecycle rule.

integer
deleted

Indicates whether the rule is deleted.

boolean
created_at

Rule creation timestamp.

string format: date-time
updated_at

Rule last updated timestamp.

string format: date-time
rule_id

Unique lifecycle rule identifier.

string
enabled

Whether the lifecycle rule is enabled.

boolean
prefix

Object prefix the rule applies to.

string
expiry_date_or_days

Expiry date or number of days.

string
noncurrent_version_expiration_date_or_days

Expiry for non-current object versions.

string
transition

Transition rule definition.

string
storage_class

Storage class for transition.

string
tags

Tags associated with the rule.

string
location

Bucket location.

string
bucket

Associated bucket ID.

integer
user

User ID who created the rule.

integer
errors

Errors encountered during the operation.

object
message

Result message.

string

Example

{
"code": 200,
"data": [
{
"id": 1711,
"deleted": false,
"created_at": "2026-02-05T10:43:25.612412Z",
"updated_at": "2026-02-05T10:43:25.612430Z",
"rule_id": "b0c6b464474f45eebcd626058ac637e7",
"enabled": true,
"prefix": "",
"expiry_date_or_days": "1",
"noncurrent_version_expiration_date_or_days": "",
"transition": "",
"storage_class": "",
"tags": "",
"location": "Delhi",
"bucket": 16731,
"user": 32970
}
],
"errors": {},
"message": "Success"
}