At the cluster setting level, a user must enable lifecycle policies. As it is enabled in the cluster, so use the management API:
...
The preserve query argument on the COPY operations indicates leaving other persisted headers as they are. Note too, that even in this case, it is necessary to re.
Code Block | ||
---|---|---|
| ||
[root@test ~]# aws s3api get-bucket-lifecycle --endpoint "http://dom-lifecycle1.ro:8090" --bucket b1
{
"Rules": [
{
"Expiration": {
"Days": 1
},
"ID": "Rule5",
"Status": "Enabled"
}
]
}
[root@test ~]# vi lifecycle.json
[root@test ~]#
[root@test ~]#
[root@test ~]#
[root@test ~]#
[root@test ~]# cat lifecycle.json
{
"Rules": [
{
"ID": "Rule6",
"Status": "Enabled",
"Expiration": { "Days": 5 }
}
]
}
[root@test ~]# aws s3api put-bucket-lifecycle-configuration --endpoint "http://dom-lifecycle1.ro:8090" --bucket b1 --lifecycle-configuration file://lifecycle.json
[root@test ~]# aws s3api get-bucket-lifecycle --endpoint "http://dom-lifecycle1.ro:8090" --bucket b1
{
"Rules": [
{
"Expiration": {
"Days": 1
},
"ID": "Rule5",
"Status": "Enabled"
},
{
"Expiration": {
"Days": 5
},
"ID": "Rule6",
"Status": "Enabled"
}
]
} |
Info |
---|
Important |
...
to make them appear on the new object. It is recommended to use |
...
Content UI for editing policy rules. |
SeeS3 lifecycle policy examples. Note that Swarm currently only supports expiration policies.
...