All Products
Search
Document Center

Resource Access Management:TagResources

Last Updated:May 08, 2024

Adds tags to resources.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringYes

The type of the resource. Valid value:

  • user: a RAM user
user
ResourceIdarrayNo

The ID of resource N.

Valid values of N: 1 to 50. If ResourceType is set to user, the resource ID is the ID of the RAM user.

Note You must specify only one of the following parameters: ResourceId and ResourcePrincipalName.
stringNo

The ID of resource N.

Valid values of N: 1 to 50.

If the ResourceType parameter is set to user, the resource ID is the ID of the RAM user.

Note You must specify only one of the following parameters: ResourceId and ResourcePrincipalName.
20732900249392****
ResourcePrincipalNamearrayNo

The name of resource N.

Valid values of N: 1 to 50. If ResourceType is set to user, the resource name is the name of the RAM user.

Note You must specify only one of the following parameters: ResourceId and ResourcePrincipalName.
stringNo

The name of resource N.

Valid values of N: 1 to 50.

If the ResourceType parameter is set to user, the resource name is the name of the RAM user.

Note You must specify only one of the following parameters: ResourceId and ResourcePrincipalName.
test@example.onaliyun.com
Tagobject []Yes

The tag value.

KeystringNo

The key of tag N.

Valid values of N: 1 to 20. You cannot specify empty strings as tag keys. The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

operator
ValuestringNo

The value of tag N.

Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be a up to128 characters in length and cannot contain http:// or https://.

alice

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

3687BD52-49FD-585B-AB14-CD05B7C76963

Examples

Sample success responses

JSONformat

{
  "RequestId": "3687BD52-49FD-585B-AB14-CD05B7C76963"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-19The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.