Updated on 2025-08-11 GMT+08:00

Adding Tags for a DB Instance

Function

This API is used to add user tags to a specified DB instance. Before calling this API:

URI

POST /v3/{project_id}/instances/{instance_id}/tags

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

Constraints

N/A

Range

The value can contain 36 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

tags

Yes

Array of objects

Definition

User tags to be added.

For details, see Table 3.

Table 3 tags parameter description

Parameter

Mandatory

Type

Description

key

Yes

String

Definition

Tag key.

Constraints

N/A

Range

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: _.:=+-@

Default Value

N/A

value

Yes

String

Definition

Tag value.

Constraints

N/A

Range

A tag value can contain up to 255 characters. Only letters, digits, spaces, and the following special characters are allowed: _.:/=+-@

Default Value

N/A

Response Parameters

Table 4 Parameter description

Parameter

Type

Description

instance_id

String

Definition

Instance ID.

Range

N/A

instance_name

String

Definition

Instance name.

Range

N/A

Example Request

Creating a user tag whose key is 1 and value is 2
POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/tags
{
	"tags": [{
		"key":"1",
                "value":"2"
	}]
}

Example Response

{
    "instance_id": "dsfae23fsfdsae3435in01",
    "instance_name": "Gauss-a87h"
}

Status Codes

Error Codes

For details, see Error Codes.