Adds user tags to resources.
Operation description
- All tags (key-value pairs) are applied to all resources of a specified ResourceId, with each resource specified as ResourceId.N.
- Tag.N is a resource tag consisting of a key-value pair: Tag.N.Key and Tag.N.Value.
- If you call this operation to tag multiple resources simultaneously, either all or none of the resources will be tagged.
- If you specify Tag.1.Value in addition to required parameters, you must also specify Tag.1.Key. Otherwise, an InvalidParameter.TagKey error is reported. A tag that has a value must have the corresponding key, but the key can be an empty string.
- If a tag with the same key has been bound to a resource, the new tag will overwrite the existing one.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
apigateway:TagResources | create | *ApiGroup acs:apigateway:{#regionId}:{#accountId}:apigroup/{#ResourceId} *App acs:apigateway:{#regionId}:{#accountId}:app/{#ResourceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ResourceType | string | Yes | The type of the resource. Tags are bound to API groups, plug-ins, and applications. You can use tags to manage cloud resources by group. Valid values:
| apiGroup |
Tag | array<object> | Yes | The tag of objects that match the lifecycle rule. You can specify multiple tags. | 2021022811 |
object | Yes | The tag of objects that match the lifecycle rule. You can specify multiple tags. | ||
Key | string | Yes | The key of tag N. | env |
Value | string | Yes | The value of tag N. | ' ' |
ResourceId | array | Yes | The ID of the resource. | |
string | Yes | The ID of the resource. | 285bb759342649a1b70c2093a772e087 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "EF924FE4-2EDD-4CD3-89EC-34E4708574E7"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-11-14 | API Description Update | View Change Details |