Updated on 2024-05-21 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 https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

tags

Yes

Array of objects

User tags to be added.

For details, see Table 3.

Table 3 tags parameter description

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

NOTE:

A tag key can contain up to 128 characters. Only letters, digits, spaces, and special characters (_.:=+-@) are allowed. It cannot start with _sys_ or a space, and cannot end with a space.

value

Yes

String

Tag value.

NOTE:

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

Response Parameters

Table 4 Parameter description

Parameter

Type

Description

instance_id

String

Instance ID.

instance_name

String

Instance name.

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 Code

Error Code

For details, see Error Codes.