Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
10 KiB
Adding a Tag
Function
This API is used to add a tag to a DB instance.
URI
- URI format
PATH: /v1/{project_id}/rds/{instanceId}/tags
Method: POST
- Parameter description
Table 1 Parameter description Name
Mandatory
Description
project_id
Yes
Specifies the project ID of a tenant in a region.
instanceId
Yes
Specifies the primary node ID of the DB instance.
- Restrictions
- A maximum of 20 tags can be added for each DB instance. The tag key must be unique.
- If the key in the request body is the same as an existing key in the specified DB instance, the value of the key is overwritten.
- Standby DB instances do not support tag adding.
Request
- Parameter description
Table 2 Parameter description Name
Mandatory
Type
Description
tag
Yes
Dictionary data structure. For details, see Table 3.
Specifies the tag information.
Table 3 tag field data structure description Name
Mandatory
Type
Description
key
Yes
String
Specifies the tag key.
Its value cannot be empty and must be 1 to 36 Unicode characters in length. It cannot contain nonprintable ASCII characters (0–31) and the following special characters: *<>\=
value
Yes
String
Specifies the tag value.
Its value can be empty or 1 to 43 Unicode characters in length. It cannot contain nonprintable ASCII characters (0–31) and the following special characters: *<>\=
- Request example
{ "tag": { "key": "ENV", "value":"DEV" } }
Normal Response
{}
Abnormal Response
For details, see Abnormal Request Results.