Create Lifecycle Rule
Delete objects automatically a set number of days after they are written. A rule applies either to every object in the bucket or only to objects under a prefix.
Lifecycle deletion is irreversible. Objects under a retention period or legal hold are not removed until those locks clear.
POST
/datasets/{Dataset_Id}/lifecycle-rule/Path parameters
Dataset_IdPathintegeroptionaldataset id
Query parameters
project_idQueryintegerrequiredProject ID
active_iamQueryintegeroptionalActive IAM ID (To access contact person account) Find your Active IAM ID here
locationQuerystringrequiredLocation
Request body
application/json
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
Number of days after which objects will be deleted
Object prefix/folder path (required when apply_to is objects_with_prefix)
Responses
200Success response with lifecycle rules information.
HTTP status code.
example
200Errors encountered during the operation.
Result message.
example
Success