Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ DB Instance Management/ Replacing a Read Replica with a Standby Node (RDS for SQL Server)
Updated on 2025-12-09 GMT+08:00

Replacing a Read Replica with a Standby Node (RDS for SQL Server)

Function

This API is used to replace a read replica with a standby node.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

rds:instance:update

write

instance

- g:EnterpriseProjectId

- g:ResourceTag/<tag-key>

rds:instance:modify

-

Constraints

  • If a read replica is faulty, the floating IP address of the read replica is temporarily assigned to the standby node to provide services. After the read replica recovers, you can choose to switch the IP address back to the read replica.
  • Only the floating IP address of the read replica is assigned to the standby node. Due to the differences in the specifications, parameter settings, and replication latency between the standby node and the read replica, performance differences and data transition may occur. Operations such as switching between primary and standby nodes, changing specifications, and changing ports are not allowed. During the node replacement or switchback, workloads are briefly interrupted. This function is available only for RDS for SQL Server instances.
  • To use this function, submit a service ticket to request required permissions.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/replace-node

  • Parameter description
    Table 1 Parameters

    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

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Read replica ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Definition

Read replica ID.

Constraints

N/A

Range

You can obtain the read replica ID from Table 4.

Default Value

N/A

node_id

Yes

String

Definition

Node ID of the read replica.

Constraints

N/A

Range

You can obtain the node ID of the read replica from Table 9.

Default Value

N/A

replace_action

Yes

String

Definition

Replacement action.

Constraints

N/A

Range

  • REPLACE: node replacement
  • REPLACE_ROLLBACK: node replacement rollback

Default Value

N/A

Example Request

  • Replace a read replica with a standby node.
    POST https://{Endpoint}/v3/5a7a69c429aa41b8a565c9a4995afea0/instances/02a202cf9fdd4561b80036337c9732f8in04/replace-node
    
    { 
       "instance_id" : "02a202cf9fdd4561b80036337c9732f8in04", 
       "node_id" : "bfafde30219f4ac5a820c7748e4dc106no04", 
       "replace_action" : "REPLACE" 
     }
  • Switch back to the read replica.
    { 
       "instance_id" : "02a202cf9fdd4561b80036337c9732f8in04", 
       "node_id" : "bfafde30219f4ac5a820c7748e4dc106no04", 
       "replace_action" : "REPLACE_ROLLBACK" 
     }

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    job_id

    String

    Definition

    Task flow ID.

    Range

    N/A

  • Example normal response
    {
      "job_id": "5a7a69c429aa41b8a565c9a4995afea0"
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.