Attaches tags to a specified resource.
Note
You can call this operation to classify resources in Message Queue for Apache RocketMQ to facilitate resource search and aggregation.
QPS limit
This operation does not have a queries per second (QPS) limit on a single Alibaba Account. You can call this operation based on your business requirements. For information about the QPS limit of each operation, see API rate limits.
Authorization
By default, Alibaba Cloud accounts can call this operation. A Resource Access Management (RAM) user can call this operation only after the RAM user is granted the required permissions. The following table describes the permissions that must be granted to a RAM user to call this operation. For information about how to grant permissions, Policies.
API |
Action |
Resource |
---|---|---|
TagResources |
mq:QueryInstanceBaseInfo mq:TagResources |
acs:mq:*:*:* |
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | TagResources |
The operation that you want to perform. Set the value to TagResources. |
InstanceId | String | No | MQ_INST_188077086902****_BXSuW61e |
The ID of the Message Queue for Apache RocketMQ instance to which the resource you want to attach tags to belongs. Note This parameter is required when you attach tags to a topic or a group.
|
ResourceType | String | Yes | TOPIC |
The type of the resource to which you want to attach tags. The value is an enumerated value. Valid values:
|
Tag.N.Key | String | Yes | FinanceDept |
The key of the tag that you want to attach to the specified resource. A tag is specified by the Tag.N.Key and Tag.N.Value parameters.
|
Tag.N.Value | String | Yes | FinanceJoshua |
The value of the tag that you want to attach to the specified resource. A tag is specified by the Tag.N.Key and Tag.N.Value parameters.
|
ResourceId.N | String | Yes | TopicA |
The ID of the resource to which you want to attach the specified tags.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 301D2CBE-66F8-403D-AEC0-82582478**** |
The ID of the request. The system generates a unique ID for each request. You can troubleshoot issues based on the request ID. |
Examples
Sample requests
http(s)://ons.cn-zhangjiakou.aliyuncs.com/?Action=TagResources
&ResourceId.1=TopicA
&ResourceType=TOPIC
&Tag.1.Key=FinanceDept
&Tag.1.Value=FinanceJoshua
&InstanceId=MQ_INST_188077086902****_BXSuW61e
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<TagResourcesResponse>
<RequestId>301D2CBE-66F8-403D-AEC0-82582478****</RequestId>
</TagResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "301D2CBE-66F8-403D-AEC0-82582478****"
}
Error codes
For a list of error codes, visit the API Error Center.
Attach tags to a resource in the console
In the Message Queue for Apache RocketMQ console, you can attach tags to a resource. For more information, see Manage tags.