Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Customers 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 appropriate:

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

A bucket would have specific lifecycle policies, such as expire all versioned content after one year and all current content after 5 years. Such a policy would appear on a bucket object via one or more Policy-Lifecycle headers:

curl –X COPY –-post301 –-location-trusted –H 'Policy-Lifecycle: RuleId: rule5 ExpirationDays:1825 ObsoleteExpirationDays:365'

'http://lucky1.tx.caringo.com/mybucket?mydomain&preserve'

In the previous example, we’re not naming the single policy, we are not declaring it enabled (as it is by default), and we are relying on a missing prefix to implicitly apply to all content in the bucket. The preserve query argument on the COPY operations means to leave the other persisted headers as they were.

S3 lifecycle policy examples are also available.

  • No labels