Updated on 2023-10-18 GMT+08:00

Creating a Read Replica

Function

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

URI

  • URI format

    POST https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}/nodes/enlarge

  • Example

    POST https://{endpoint}/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

    Instance ID, which is compliant with the UUID format.

Request

Table 2 Parameter description

Name

Mandatory

Type

Description

priorities

Yes

List<Integer>

Failover priority of a read replica.

Failover priority ranges from 1 for the first priority to 16 for the last priority. This priority determines the order in which read replicas are promoted when recovering from a primary node failure. Read replicas with the same priority have a same probability of being promoted to the new primary node.

is_auto_pay

No

String

Whether the order will be automatically paid after yearly/monthly instances are created.

  • true: indicates the order will be automatically paid from your account. The default value is true.
  • false: indicates the order will be manually paid.
  • Request example
    {
    "priorities":[1],
    
    }

Response

  • Normal response
    Table 3 Parameter description

    Name

    Type

    Description

    instance_id

    String

    DB instance ID.

    node_names

    List<String>

    Node name.

    job_id

    String

    ID of the task for creating a read replica.

    order_id

    String

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

  • Example normal response
    {
        "instance_id":"f381d0b539e644df8f5b0d3a62129515in07",
        "node_names":["gauss-ccf5_node03"],
        "job_id":"0f6b6a9e-bd39-4e95-9374-e4d134e5a3d1"
    }

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.