Creating a Read Replica

Function

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

URI

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Language

No

String

Language.

Content-Type

Yes

String

MIME type of the request body. You are advised to use the default value application/json. For APIs used to upload objects or images, the value can vary depending on the flow type.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

priorities

Yes

Array of integers

Read replica failover priority ranging from 1 to 16. The total number of the primary node and read replicas is up to 16.

Response Parameters

Status code: 201

Table 4 Response body parameters

Parameter

Type

Description

instance_id

String

DB instance ID.

node_names

Array of strings

Node name list

job_id

String

ID of the task for creating a DB instance.

This parameter is returned only when pay-per-use DB instances are created.

order_id

String

Order ID. This parameter is returned only when yearly/monthly instances are created.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Creating a read replica

POST https://gaussdb-mysql.eu-de.otc.t-systems.com/mysql/v3/0483b6b16e954cb88930a360d2c4e663/instances/ba62a0b83a1b42bfab275829d86ac0fdin07/nodes/enlarge
{
  "priorities" : [ 1, 2 ]
}

Example Response

Status code: 201

Success.

{
  "instance_id" : "f381d0b539e644df8f5b0d3a62129515in07",
  "node_names" : [ "gauss-ccf5_node03" ],
  "job_id" : "dff1d289-4d03-4942-8b9f-463ea07c000d"
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.