All Products
Search
Document Center

ApsaraDB RDS:AddTagsToResource

Last Updated:May 29, 2023

You can call the AddTagsToResource operation to bind existing or new tags to an ApsaraDB RDS instance.

Operation Description

The AccessKey ID provided to you by Alibaba Cloud.

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:
    • The required resource types are displayed in bold characters.
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
rds:AddTagsToResourceWRITE
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

The ID of the proxy pattern.

ETnLKlblzczshOTUbOCzxxxxxxx
proxyIdstringNo

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

API
RegionIdstringYes

The ID of the instance.

NoteYou can enter up to 30 instance IDs in a single request. If you enter more than one instance ID, you must separate the instance IDs with commas (,).
cn-hagnzhou
DBInstanceIdstringYes

The tags that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. Format: {"key1":"value1","key2":"value2"...}.

NoteThe TagKey is required, and the TagValue is optional.
rm-uf6wjk5xxxxxxx
TagsstringNo

The TagKey of the first tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

{“key1”:”value1”,“key2”:””}
Tag.1.keystringNo

The TagKey of the second tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

key1
Tag.2.keystringNo

The TagKey of the third tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

key2
Tag.3.keystringNo

The TagKey of the fourth tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

key3
Tag.4.keystringNo

The TagKey of the fifth tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

key4
Tag.5.keystringNo

The TagValue of the first tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

key5
Tag.1.valuestringNo

The TagValue of the second tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

value1
Tag.2.valuestringNo

The TagValue of the third tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

value2
Tag.3.valuestringNo

The TagValue of the fourth tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

value3
Tag.4.valuestringNo

The TagValue of the fifth tag that you want to bind. Each tag consists of a TagKey and a TagValue. You can specify up to five tags in a single request. The TagKey is required, and the TagValue is optional.

value4
Tag.5.valuestringNo

The ID of the request.

value5

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

This operation has the following limits:

  • Each tag consists of a TagKey and a TagValue. The TagKey is required, and the TagValue is optional.
  • The values of TagKey and TagValue cannot start with aliyun.
  • The values of TagKey and TagValue are not case-sensitive.
  • The maximum length of a TagKey is 64 characters, and the maximum length of a TagValue is 128 characters.
  • Each instance can be bound to a maximum of 10 tags. Each tag that is bound to the same instance must have a unique TagKey. If you bind a new tag to the instance and the TagKey of the new tag is the same as that of an existing tag, the new tag overwrites the existing tag.
224DB9F7-3100-4899-AB9C-C938BCCB43E7

Examples

Sample success responses

JSONformat

{
    "requestId": "224DB9F7-3100-4899-AB9C-C938BCCB43E7"
}

XMLformat

<?xml version="1.0" encoding="UTF-8" ?>
<AddTagsToResourceResponse>
	<requestId>224DB9F7-3100-4899-AB9C-C938BCCB43E7</requestId></AddTagsToResourceResponse>
	

Sample failed responses

JSONformat

{
    "RequestId": "7463B73D-35CC-4D19-A010-6B8D65D242EF",
    "HostId": "rds.aliyuncs.com",
    "Code": "UnsupportedOperation",
    "Message": "The specified action is not supported."
}

Error codes

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

Change history

Change timeSummary of changesOperation
2022-06-23API Description Update,The error codes of the API operation change.
Change itemChange content
API DescriptionAPI Description Update
Error CodesThe error codes of the API operation change.
    delete Error Codes: 401