- Documentation
Torch Object Storage
User Guide
Working with objects
Managing object tags
Working with objects
Managing object tags
Managing object tags
TOS allows you to tag objects for classified management. You can use tags to filter objects when configuring lifecycle rules or replicating objects. This topic provides information about object tags and explains how to use them to manage objects.
Constraints and limitations
Each tag is a key-value pair. The following are the tag restrictions:
- Configuring lifecycle rules with object tags
- Example: The latest version of any object tagged with data:image will be deleted if it has not been modified for 120 days.
- Replicating objects with tags
- Example: The latest and historical versions of objects tagged with data:image in the source bucket will be replicated to the bucket "Target Bucket Name".
"Role": "ServiceRoleforReplicationAccessTOS",
"Bucket": "Target Bucket Name",
"Location": "cn-beijing",
"StorageClass": "STANDARD"
"HistoricalObjectReplication": "Enabled",
"AccessControlTranslation": {
"Owner": "BucketOwnerEntrusted"
Before setting object tags, make sure that you have the necessary permissions for object tagging. Only the bucket creator and users with read-write permissions can read or write tags. You can grant these permissions to users through bucket policies. For more information, see Bucket policies. The relevant operations are described as follows: - GetObjectTagging: Retrieves object tags.
- PutObjectTagging: Sets object tags.
- DeleteObjectTagging: Deletes object tags.
You can add tags to existing objects via the TOS console, or add tags when uploading objects via APIs or SDKs. Follow the steps below to add a tag.
Add tags when uploading objects
Add tags to existing objects
You can specify object tags when uploading objects by using the x‑tos‑tagging request header. The supported APIs are as follows:
- In the left navigation pane, click Buckets.
- In the top menu bar, select the project of the bucket you want to manage.
- On the Buckets page, click the bucket you want to manage.
- On the Objects page, select ··· > Edit tags in the Actions column of the object you want to manage.
- In the box that appears, click Add Field and enter the tag key and value.
- Save your settings by clicking Save.
Editing or deleting object tags
- In the left navigation pane, click Buckets.
- In the top menu bar, select the project of the bucket you want to manage.
- On the Buckets page, click the name of the bucket.
- On the Objects page, select ··· > Edit tags in the Actions column of the object you want to manage.
- Modify the tag information based on your needs.
- Or click Delete to remove a tag from the object.
- Save your settings by clicking Save.
Last updated: 2026.08.05 10:40:58