TagResources
Call TagResources to add tags to resources.
Debugging
You can call this operation in OpenAPI Explorer without having to manually calculate signatures. After a successful call, OpenAPI Explorer automatically generates SDK code examples.
Authorization
The following table describes the authorization information required for this operation. To grant a RAM user or RAM role permission to call this operation, add the operation to the Action element of a RAM policy statement. For more information, see the following descriptions:
Operation: The API operation to authorize.
Access level: The access level of each operation. Valid values: Write, Read, and List.
Resource type: The resource type that can be authorized for the operation. The following rules apply:
Required resource types are highlighted in the table.
For an operation that does not support resource-level authorization,
All Resourcesis displayed.
Condition key: The condition key that is defined by the cloud service.
Associated operation: Other operations that must be granted to the RAM user or RAM role to ensure that this operation can be successfully called.
Actions | Access level | Resource type | Condition key | Associated operation |
alikafka:TagResources | Write | instance
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
RegionId | string | Yes | The region ID of the resource. | cn-hangzhou |
ResourceType | string | Yes | The resource type. This is an enumerated parameter. Valid values:
Note This parameter is not case-sensitive. | instance |
ResourceId | array | Yes | A list of resource IDs. | |
string | Yes | The ID of the resource to be tagged. The format of the resource ID varies based on the resource type:
For example, if the instance ID is alikafka_post-cn-v0h1fgs2xxxx, the topic name is test-topic, and the consumer group name is test-consumer-group, the corresponding resource IDs are alikafka_post-cn-v0h1fgs2xxxx, Kafka_alikafka_post-cn-v0h1fgs2xxxx_test-topic, and Kafka_alikafka_post-cn-v0h1fgs2xxxx_test-consumer-group, respectively. | alikafka_post-cn-v0h1fgs2**** | |
Tag | array<object> | Yes | A list of tags. | |
object | Yes | |||
Key | string | Yes | The tag key.
| FinanceDept |
Value | string | No | The tag value.
| FinanceJoshua |
InstanceId | string | No | The ID of the instance that hosts the resource to be tagged. | alikafka_post-cn-v0h1fgs2**** |
Response parameters
Parameter | Type | Description | Example |
object | |||
RequestId | string | The request ID. | C46FF5A8-C5F0-4024-8262-B16B6392**** |
Examples
Sample success response
JSON format
{
"RequestId": "C46FF5A8-C5F0-4024-8262-B16B6392****"
}Error codes
For a list of common error codes, see Common error codes.
Change history
Date | Description | Actions |
2023-11-09 | Internal API configurations were updated. This change does not affect API calls. |