Adding Tags for a DB Instance
Function
This API is used to add user tags to a specified DB instance. Before calling this API:
- Learn how to authenticate this API.
URI
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Explanation: Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Restrictions: None Value range: The value can contain 32 characters. Only letters and digits are allowed. Default value: None |
| instance_id | Yes | String | Instance ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| tags | Yes | Array of objects | User tags to be added. For details, see Table 3. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| key | Yes | String | Tag key. A tag key can contain up to 128 characters. It cannot start with _sys_ or a space, and cannot end with a space. Only letters, digits, spaces, and the following special characters are allowed: _.:=+-@ |
| value | Yes | String | Tag value. A tag value can contain up to 255 characters. Only letters, digits, spaces, and the following special characters are allowed: _.:/=+-@ |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| instance_id | String | Instance ID. |
| instance_name | String | Instance name. |
Example Request
POST https://gaussdb-opengauss.eu-west-101.myhuaweicloud.eu/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/tags
{
"tags": [{
"key":"1",
"value":"2"
}]
} Example Response
{
"instance_id": "dsfae23fsfdsae3435in01",
"instance_name": "Gauss-a87h"
} Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.