Creates one or more tags and associates the tags with one or more resources.
Make the API call
Request parameters
Parameter | Type | Required? | Example value | Description |
---|---|---|---|---|
Action | String | Yes | TagResources |
The name of this action. Value: TagResources |
RegionId | String | Yes | cn-hangzhou |
The ID of the region to which the Server Load Balancer (SLB) instance belongs. To query the region ID, call DescribeRegions. |
ResourceId.N | RepeatList | Yes | lb-bp16qjewdsunr41m1**** |
The ID of the resource. Value range of N: 1 to 20. |
ResourceType | String | Yes | instance |
The type of the resource. Valid values:
|
Tag.N.Key | String | No | FinanceDept |
The tag key of the resource. Value range of N: 1 to 20. If you specify this parameter, the value of this parameter cannot be a null string. The value can be up to 64 characters in length and cannot start with |
Tag.N.Value | String | No | FinanceJoshua |
The tag value of the instance. Value range of N: 1 to 20. The value of this parameter can be a null string. It can be up to 128 characters in length and cannot start with |
Response parameters
Parameter | Type | Example value | Description |
---|---|---|---|
RequestId | String | C46FF5A8-C5F0-4024-8262-B16B639225A0 |
The ID of the request. |
Examples
Request example
http(s)://[Endpoint]/? Action=TagResources
&RegionId=cn-hangzhou
&ResourceId.1=lb-bp16qjewdsunr41m1****
&ResourceType=instance
&Tag.1.Key=FinanceDept
&Tag.1.Value=FinanceJoshua
&<CommonParameters>
Response example
XML
format
<TagResourcesResponse>
<RequestId>C46FF5A8-C5F0-4024-8262-B16B639225A0</RequestId>
</TagResourcesResponse>
JSON
format
{
"RequestId":"C46FF5A8-C5F0-4024-8262-B16B639225A0"
}
Errors
For a list of error codes, visit the API Error Center.