Reviewed-by: Drobnak, David <david.drobnak@t-systems.com> Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
17 KiB
Creating a Read Replica
Function
This API is used to create a read replica. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
URI
- URI format
POST https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}/nodes/enlarge
- Example
POST https://gaussdb-mysql.eu-de.otc.t-systems.com/mysql/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/nodes/enlarge
- Parameter description
Table 1 Parameter description Name
Mandatory
Description
project_id
Yes
Project ID of a tenant in a region.
To obtain this value, see Obtaining a Project ID.
instance_id
Yes
DB instance ID, which is compliant with the UUID format.
Request 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. |
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
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
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
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.