You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Managing instances
AddTagsToResource
Copy page
Download PDF
AddTagsToResource

Call the AddTagsToResource API to bind tags to one or more MySQL instances.

Request type

Asynchronous request.

Request parameters

Name
Type
Required
Example
Description
InstanceIds
String[]
Yes
[ "mysql-46609cf2****", "mysql-5564bc65****" ]

The instance IDs to which tags need to be bound.

tip

Multiple instance IDs can be passed at once, separated by commas (,). A maximum of 20 instance IDs can be passed in a single request, and a single instance can be bound with up to 50 tags.

Tags
Object[]
Yes
Please refer to the request example.

An array of tag key-value pairs to be bound.

tip

Multiple tag key-value pairs can be passed at once, separated by commas (,). A maximum of 20 tag key-value pairs can be passed in a single request, and a single instance can be bound with up to 50 tags.

Key
String
Yes
tagkey

The tag key of the instance tag. The rules for setting tag keys are as follows:

  • Supports any language letters or characters (such as Chinese, English letters, etc.), numbers, and spaces.
  • Supports special characters: _.:/=+-@.
  • volc: is a system-reserved tag key. When adding tags, the beginning of the tag key cannot be set to any case variation of volc:.
  • The length of the tag key must be 1~128 characters.
Value
String
No
tagvalue

The tag value of the instance tag. The rules for setting tag values are as follows:

  • Supports any language letters or characters (such as Chinese, English letters, etc.), numbers, and spaces.
  • Supports special characters: _.:/=+-@.
  • The length of the tag value must be 0~256 characters, meaning the tag value can be empty.

Response parameters

null

Sample request

POST /?Action=AddTagsToResource&Version=2022-01-01 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: rds-mysql.cn-beijing.volcengineapi.com
X-Date: 20211202T101010Z
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****
{
    "InstanceIds": [
        "mysql-46609cf2****",
        "mysql-5564bc65****"
    ],
    "Tags": [
        {
            "Key": "TestKey",
            "Value": "TestValue"
        }
    ]
}

Sample response

{
    "ResponseMetadata": {
        "RequestId": "2023080919085242905119679E5C8CC6AA",
        "Action": "AddTagsToResource",
        "Version": "2022-01-01",
        "Service": "rds_mysql",
        "Region": "cn-beijing"
    },
    "Result": null
}

Error codes

For more details, refer to Error codes.

Last updated: 2025.07.07 15:52:01