Creates tags and adds the tags to resources.
Operation description
You can add at most 20 tags to each instance. Before you add tags to a resource, Alibaba Cloud checks the number of existing tags of the resource. If the maximum number is reached, an error message is returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
slb:TagResources |
update |
acl
certificate
loadbalancer
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the Server Load Balancer (SLB) instance is created. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ResourceType |
string |
Yes |
The type of the resource. Valid values:
|
instance |
| ResourceId |
array |
Yes |
The ID of the resource. You can specify at most 20 resources. Note
Set ResourceId of the listener to LoadBalancerId_Listener protocol_Port. Set LoadBalancerId to the ID of the SLB instance, and Port to the listener port. Example: lb-bp1snb10sbml4****_http_80. |
lb-bp16qjewdsunr41m1**** |
|
string |
No |
The ID of the resource. You can specify at most 20 resources. Note
Set ResourceId of the listener to LoadBalancerId_Listener protocol_Port. Set LoadBalancerId to the ID of the CLB instance, and Port to the listener port. Example: lb-bp1snb10sbml4****_http_80. |
lb-bp16qjewdsunr41m1**** |
|
| Tag |
array<object> |
Yes |
The tags. |
|
|
object |
No |
The tags. |
||
| Key |
string |
No |
The tag key. You can specify up to 20 tag keys. The tag key cannot be an empty string. The tag key must be 1 to 64 characters in length and cannot start with |
FinanceDept |
| Value |
string |
No |
The tag value. You can specify up to 20 tag values. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with |
FinanceJoshua |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
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 | TagTypeNotSame | The category of tags in the same request must be the same. | |
| 400 | ResourceNotExist | %s. | |
| 400 | DeniedForNoneTagCreator | %s. | |
| 400 | DeniedForScopeNotEqual | %s. | |
| 400 | QuotaLimitExceeds | %s. | |
| 400 | InvalidParam.Scope | The specified Scope is invalid. | |
| 400 | InvalidParam.ResourceType | The specified ResourceType is invalid. | |
| 400 | InvalidParam.TagKey | The specified TagKey is invalid. | |
| 400 | InvalidParam.TagValue | The specified TagValue is invalid. | |
| 400 | InvalidParam.TagKeyOrValue | The specified TagKey or TagValue is invalid. | |
| 400 | InvalidParam.TagOwnerUid | The specified TagOwnerUid is invalid. | |
| 400 | InvalidParam.TagOwnerBid | The specified TagOwnerBid is invalid. | |
| 400 | MissingParam.TagKey | The parameter TagKey is required. | |
| 400 | MissingParam.Scope | The parameter Scope is required. | |
| 400 | MissingParam.TagOwnerUid | The parameter TagOwnerUid is required. | |
| 400 | MissingParam.TagOwnerBid | The parameter TagOwnerBid is required. | |
| 400 | InvalidParameter.RegionId | The specified RegionId does not exist. | |
| 400 | DeniedForOperateCustomTag | %s. | |
| 400 | MissingParam.ResourceId | The parameter ResourceId is required. | |
| 400 | Duplicate.TagKey | The param TagKey has duplicate value. | |
| 400 | SizeLimitExceeded.ResourceId | The maximum size of ResourceId is exceeded. | |
| 400 | SizeLimitExceeded.Tag | The maximum size of Tag is exceeded. | |
| 400 | MissingParam.RegionId | The parameter RegionId is required. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.