Updated on 2025-10-20 GMT+08:00

Creating a Read Replica

Function

This API is used to create a read replica. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

POST /v3/{project_id}/instances/{instance_id}/readonly-nodes

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

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

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 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

After the request is processed, the value of X-Subject-Token in the message header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn
  • en-us

Default Value

en-us

Table 3 Request parameters

Parameter

Mandatory

Type

Description

node_distribution

Yes

Array of Table 4 objects

Definition

Distribution of newly created read replicas in each AZ.

Constraints

N/A

Table 4 node_distribution

Parameter

Mandatory

Type

Description

num

Yes

Integer

Definition

Number of read replicas added in the corresponding AZ.

Constraints

N/A

Range

N/A

Default Value

N/A

availability_zone

Yes

String

Definition

AZ.

Constraints

N/A

Range

N/A

Default Value

N/A

flavor_ref

Yes

String

Definition

Specification code. To obtain its value, see the spec_code field in Querying Instance Specifications.

Constraints

N/A

Range

The value cannot be empty.

Default Value

N/A

configuration_id

Yes

String

Definition

Read replica parameter template ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Table 5 Response parameters

Parameter

Type

Description

job_id

String

Definition

ID of the job for creating a read replica.

Range

N/A

Example Request

POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/95e33e5453684df9a300973f28751b5din14/readonly-nodes
{
  "node_distribution": [
    {
      "availability_zone": "cn-southwest-244b",
      "num": 1,
      "flavor_ref": "gaussdb.opengauss.ee.c3.xlarge.x864.ha",
      "configuration_id": "396bc4573143436baa52731acb4b609bpr14"
    }
  ]
}

Example Response

{ 
  "job_id" : "490a4a08-ef4b-44c5-94be-3051ef9e4fce" 
}

Status Codes

Error Codes

For details, see Error Codes.