Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

put

Create or replace the lifecycle configuration for a bucket

Usage

ionosctl object-storage bucket lifecycle put [flags]

Aliases

For bucket command:

[b]

For lifecycle command:

[lc]

For put command:

[p]

Description

Create or replace a bucket's lifecycle configuration. This fully REPLACES any existing rules with the "Rules" array in the file.

Provide the configuration as a JSON file via --json-properties. Each rule needs an "ID", a "Prefix" (which object keys it applies to; "" = all objects), a "Status" ("Enabled" or "Disabled"), and at least one action: Expiration.Days / Expiration.Date Delete current objects after N days, or on a specific date. NoncurrentVersionExpiration.NoncurrentDays Delete old versions N days after they become noncurrent (versioned buckets). AbortIncompleteMultipartUpload.DaysAfterInitiation Abort unfinished multipart uploads after N days.

Note: on a versioned bucket, Expiration alone only adds a delete marker and does not reclaim storage - pair it with NoncurrentVersionExpiration. ionosctl computes and sends the required Content-MD5 for the request automatically.

Run with --json-properties-example to print a ready-to-edit template (expire objects under logs/ after 90 days, plus abort stale multipart uploads after 7 days).

Options

Examples

Last updated

Was this helpful?