OSS on CloudBox lets you use tags to classify objects in an OSS on CloudBox bucket. Based on these tags, you can set lifecycle rules and access permissions for the objects.
Tagging rules
Objects are tagged with key-value pairs. You can add tags either when uploading new objects or to existing objects stored within your bucket.
Up to 10 tags with unique keys can be added to an object.
The maximum length for keys is 128 characters, and for values, 256 characters. Both are case-sensitive.
The valid character set for tags includes uppercase and lowercase letters, numbers, spaces, and the following symbols:
+ - = . _ : /.
When configuring tags via HTTP headers, you must URL-encode both the tag keys and values.
Usage notes
Only the bucket owner and users who have the
oss-cloudbox:PutObjectTaggingpermission can add or modify object tags.You can add tags to an object when you perform simple upload, multipart upload, append upload, and copy operations. You can also add tags to uploaded objects.
Editing the tags of an object does not affect its Last‑Modified timestamp.
Scenarios
Configure lifecycle rules based on tags
For efficient management of your storage resources and cost optimization, you can apply specific tags to objects that are generated periodically and do not require long-term retention, then configure lifecycle rules to automatically delete these tagged objects at predefined intervals.
For example, you can configure the following lifecycle rule to delete objects prefixed with dir1 and tagged with key1:value1 30 days after these objects are last updated:
<LifecycleConfiguration> <Rule> <ID>rule1</ID> <Prefix>dir1</Prefix> <Tag><Key>key1</Key><Value>value1</Value></Tag> <Status>Enabled</Status> <Expiration> <Days>30</Days> </Expiration> </Rule> </LifecycleConfiguration>Authorize a RAM user to access objects that have specific tags
You can configure a RAM policy to grant a RAM user permissions to access objects that have the tags status:ok and key1:value1 in an OSS on CloudBox bucket named examplebucket. The ID of the CloudBox is
cb-f8z7yvzgwfkl9q0h****.{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "oss-cloudbox:GetObject" ], "Resource": [ "acs:oss-cloudbox:*:174649585760****:cloudbox/cb-f8z7yvzgwfkl9q0h****/bucket/examplebucket/*" ], "Condition": { "StringEquals": { "oss-cloudbox:ExistingObjectTag/status":"ok", "oss-cloudbox:ExistingObjectTag/key1":"value1" } } } ] }