Customers A user must enable lifecycle policies in the cluster at the cluster setting level. The setting is at the cluster level, so using the management API is appropriateUse the management API when enabled:
Code Block | ||
---|---|---|
| ||
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' -d '{}' \ 'http://lucky1.tx.caringo.com:91/api/storage/clusters/_self/settings/policy.lifecycle?value=enabled' \ -u admin:ourpwdofchoicehere |
Info |
---|
InfoA |
...
missing |
A bucket contains one or multiple lifecycle policies, such as expire :
Expire all versioned content after one year
...
.
Expire all current content after 5 years, etc.
...
Such policies are applied on a bucket object via using one or more multiple Policy-Lifecycle
headers:
Code Block | ||
---|---|---|
| ||
curl –X-X COPY –--post301 –--location-trusted –H \ -H 'Policy-Lifecycle: RuleId: "rule5" ExpirationDays:1825 ObsoleteExpirationDays:365' \ 'http://lucky1.tx.caringo.com/mybucket?domain=mydomain&preserve' |
In the previous example, we’re not naming apply implicitly to all content in the bucket by:
Naming the single policy
...
Not declaring it enabled (
...
default
...
enabled)
Relying on a missing prefix
...
The preserve
query argument on the COPY operations means to leave the other persisted headers as they were.S3 lifecycle policy examples are also availableindicates leaving other persisted headers unchanged.
Info |
---|
Important
|
Seehttps://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html.