Creates and attaches tags to resources.
Operation description
A tag consists of a tag key and a tag value. Both the tag key and tag value are required.
If you attach multiple tags to a Cloud Enterprise Network (CEN) instance, the tag keys must be unique for that instance.
You can attach a maximum of 20 tags to a CEN instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cen:TagResources |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceType |
string |
Yes |
The type of the resource. Valid values: Cen: a CEN instance. BandwidthPackage: a bandwidth plan. TransitRouter: a transit router instance. TransitRouterVpcAttachment: a VPC connection. TransitRouterVbrAttachment: a VBR connection. TransitRouterPeerAttachment: an inter-region connection. TransitRouterVpnAttachment: a VPN connection. TransitRouterRouteTable: a route table. Flowlog: a flow log. TransitRouterMulticastDomain: a multicast domain. |
cen |
| ResourceId |
array |
Yes |
The list of resource IDs. |
cen-7qthudw0ll6jmc**** |
|
string |
No |
The resource ID. You can enter multiple resource IDs. The value of N ranges from 1 to 20. |
cen-pfa6ugf3xl0qsd**** |
|
| Tag |
array<object> |
Yes |
The list of tags. |
|
|
object |
Yes |
The tag. |
||
| Key |
string |
Yes |
The tag key. You can enter multiple tag keys. The value of N ranges from 1 to 20. The tag key can be up to 64 characters in length. It cannot start with |
TagKey |
| Value |
string |
Yes |
The tag value. Each tag key must have a tag value. The value of N ranges from 1 to 20. The tag value can be up to 128 characters in length. It cannot start with |
TagValue |
| RegionId |
string |
No |
The region ID of the resource. This parameter is not required for resources of the Cen and BandwidthPackage types. It is required for all other resource types. |
cn-hangzhou |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
The response that is returned. |
||
| RequestId |
string |
The request ID. |
C46FF5A8-C5F0-4024-8262-B16B639225A0 |
Examples
Success response
JSON format
{
"RequestId": "C46FF5A8-C5F0-4024-8262-B16B639225A0"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidTagKey | The tag keys are not valid. | The error message returned because the specified tag key is invalid. |
| 400 | InvalidTagValue | The tag values are not valid. | The error message returned because the specified tag value is invalid. |
| 400 | MissingParam | %s | |
| 400 | InvalidInstanceType.NotFound | The instance type is not found | The error message returned because the specified instance type does not exist. |
| 400 | InvalidInstanceIds.NotFound | The instanceIds are not found | The error message returned because the specified instance does not exist. |
| 400 | Forbidden.TagKeys | The request do not allow to operate the tag keys | The error message returned because you cannot manage the specified tag key. |
| 400 | QuotaExceeded.TagNum | Custom Tags quota exceeded | The error message returned because the number of tags has reached the upper limit. |
| 400 | InvalidTagScope.NotFound | The tag scope is not found | The error message returned because the specified tag scope is invalid. |
| 400 | Forbidden.NotAllowedCategary | The System tag is not valid | The error message returned because you cannot configure system tags. |
| 400 | SizeLimitExceeded.ResourceIdNum | The ResourceIds parameter's number is exceed , Valid : 20 | |
| 400 | MissingParameter.TagValue | The specified parameter TagValue is missing | The error message returned because the TagValue parameter is not set. |
| 400 | DuplicatedParam.TagKey | The parameter TagKey is duplicated. | The error message returned because the TagKey parameter already exists. |
| 400 | IllegalParamLength.Tag | The specified length of Tag is invalid. | The error message returned because the length of the specified tag is invalid. Check the tag and try again. |
| 400 | IllegalParam.Region | The specified region is invalid. | |
| 400 | MissingParameter.TagKey | TagKey must be specified. | The error message returned because you must set the TagKey parameter. |
| 400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
| 400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.