Adding Tags to an Object
Tag Rules
OBS offers object tags for you to classify objects in buckets. You can tag an object when you upload it to a bucket or after it is stored in the bucket.
An object tag is a key-value pair. To use tags, follow the rules below:
- An object can have up to 10 tags.
- A tag key:
- Must be unique if there are multiple tags specified for an object.
- Can be up to 36 characters long. It must be case sensitive and unique and cannot start or end with a space. It cannot be left blank and cannot contain the following special characters: , / | < > = * \
- A tag value:
Can be up to 255 characters long. It must be case sensitive and cannot start or end with a space. It can be left blank, but cannot contain the following special characters: , / | < > = * \
Important Notes
- Object tags are now in open beta testing, and you can use them for free. Once the testing period is over, you will be billed for using object tags.
- To read or write object tags, you must have required permissions. Such permissions can be granted using bucket policies. By default, only the object owner can read or write the object's tags.
- During cross-region replication, tags of source objects are not copied.
- Tags cannot be added to files in parallel file systems.
Scenarios
Specifying object tags in a lifecycle rule
<LifecycleConfiguration>
<Rule>
<ID>sample-rule</ID>
<Filter>
<And>
<Prefix>texta/</Prefix>
<Tag>
<Key>key1</Key>
<Value>value1</Value>
</Tag>
<Tag>
<Key>key2</Key>
<Value>value2</Value>
</Tag>
</And>
</Filter>
<Status>Enabled</Status>
<Expiration>
<Days>120</Days>
</Expiration>
</Rule>
</LifecycleConfiguration> Ways to Add Object Tags
You can use OBS Console or APIs to add tags to an object.
Related Operations
In the tag list, click Edit to change the tag value or click Delete to remove the tag.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot