You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Volume tag
CreateTags - Create Tags
Copy page
Download PDF
CreateTags - Create Tags
Use the CreateTags API to add tags to one or more resources.​
precautions​
  • A single resource can have up to 50 tags, and a single API call can support adding up to 20 tags.​
  • When adding the same tag key to the same resource repeatedly, the new tag value will automatically overwrite the original tag value.​
  • Resources that are being deleted are not allowed to have tags added.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
request parameters​
Only the parameters specific to this API and some common parameters are listed below. For more information, see Public Parameters.​
Action string required Example: CreateTags​
The operation to be performed is: CreateTags.​
​
Version string required Example value: 2020-04-01​
The version of the API is: 2020-04-01.​
​
ResourceType string required Example value: volume​
Resource Type, values:​
  • volume: cloud disk.​
  • Snapshot: snapshot.​
  • Snapshot Policy: automatic snapshot policy.​
  • snapshotgroup: snapshot consistency group.​
​
ResourceIds.N string[] required Example: ResourceIds.1=vol-76pwr6rilv8lzwxv****&ResourceIds.2=vol-76pwr6rilv8lzwxv****​
Resource ID to be associated with a tag. Description as follows:​
  • ResourceIds.N: N indicates the resource number, valid values: 1–50.​
  • Separate multiple resources with &.​
​
Tags.N.Key string[] required Example value: tag​
The tag key for the label.​
  • Tags.N.Key: N indicates the index of the tag key. Value range: 1-20.​
  • Use & to separate multiple tag keys.​
The naming conventions are as follows:​
  • Cannot start with any case form of volc: or sys:; volc: or sys: prefixes are reserved for system tag keys and creation is prohibited.​
  • Only include language characters, numbers, spaces, and special symbols _.:/=+-@.​
  • Length is limited between 1 and 128 characters.​
​
Tags.N.Value string[] Optional Example: test​
Tag value of the label.​
  • Tags.N.Value: N indicates the index number of the tag value. Value range: 1-20.​
  • Separate multiple tag values with &.​
The naming conventions are as follows:​
  • Only include language characters, numbers, spaces, and special symbols _.:/=+-@.​
  • Allowed to be empty, with a length limit of 0 to 256 characters.​
​
​
​
Return parameters​
Below are the unique return parameters for this endpoint. For more information, see Return Structure.​
OperationDetails object[] Example: -​
Tag operation result.​
ResourceId string Example: vol-76pwr6rilv8lzwxv****​
Resource ID.​
​
Error object Example value: -​
Error message.​
Code string Example: InvalidResourceId.NotFound​
Error details for the requested resource.​
​
Message string Example value: The specified ResourceId does not exist.​
Error message for failed request.​
​
​
​
​
​
Request example​
​
GET /?Action=CreateTags&Version=2020-04-01&ResourceType=volume&ResourceIds.1=vol-76pwr6rilv8lzwxv*****&ResourceIds.2=vol-76pwr6rilv8lzwxv****&Tags.1.Key=tag&Tags.1.Value=test HTTP/1.1​
Host: open.volcengineapi.com​
Region: cn-beijing​
ServiceName: storage_ebs​
​
​
Back to example​
​
​
{​
"ResponseMetadata": {​
"RequestId": "202303031059488DC8442420A69FB0****",​
"Action": "CreateTags",​
"Version": "2020-04-01",​
"Service": "storage_ebs",​
"Region": "cn-beijing"​
},​
"Result": {​
"OperationDetails": []​
}​
}​
}​
​
error code​
The following table lists error codes related to this endpoint's business logic. For public error codes, refer to the Public Error Codes documentation.​
​
Status code​
error code​
error message​
Create Volume​
400​
ErrResourceTypeNotFound​
resource type not found​
Resource type not found.​
400​
ErrResourceIdNotFound​
resource id not found​
Resource ID not found.​
400​
ErrMaximumResourceIds​
too many resource ids​
The resource ID exceeds the limit.​
400​
ErrResourceTypeUnknown​
resource type unknown​
The resource type is unknown.​
400​
ErrInvalidTagKey​
tag key invalid​
Tag key is invalid.​
400​
ErrInvalidTagNum​
too many tags​
The number of tags exceeds the limit.​
400​
ErrTagKeyConflict​
tag key conflict​
Tag key conflict.​
400​
ErrInvalidTagValue​
tag value invalid​
Invalid tag value.​
400​
ErrTagNotFound​
tag not found in request​
No tags found in the request.​
400​
ErrPartTagFailed​
part tag failed​
Labeling failed.​
400​
ErrTagServiceUnavailable​
tag service unavailable​
Tag service is unavailable.​
400​
ErrInvalidAccountId​
account id invalid​
Account ID is invalid.​
​
​
Last updated: 2026.01.09 18:19:56