Retrieves the lifecycle rules configured for a bucket.
Permissions
By default, only the bucket owner can query lifecycle rules. To grant other users access, attach a custom policy that includes the oss:GetBucketLifecycle permission. For details, see Attach a custom policy to a RAM user.
Synopsis
ossutil api get-bucket-lifecycle --bucket value [flags]Parameters
| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket. |
For more information, see Command-line options.
Examples
Query lifecycle rules of examplebucket:
ossutil api get-bucket-lifecycle --bucket examplebucketQuery lifecycle rules and format the output as JSON:
ossutil api get-bucket-lifecycle --bucket examplebucket --output-format jsonQuery lifecycle rules and format the output as YAML:
ossutil api get-bucket-lifecycle --bucket examplebucket --output-format yaml