Help Center/ Document Database Service/ API Reference (Ally Region)/ APIs V3.0 (Recommended)/ DB Instance Management/ Changing the Name of the Replica Set in the Connection Address
Updated on 2026-01-08 GMT+08:00

Changing the Name of the Replica Set in the Connection Address

API Description

This API is used to change the name of the replica set in the connection address.

Restrictions

  • This API applies only to replica set instances.
  • This operation is not allowed if the DB instance is in any of the following statuses: creating, changing instance class, changing port, restarting, or abnormal.

URI

  • URI format

    PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/replica-set/name

  • URI example

    PUT https://{endpoint}/v3/0d248ca90800d3902f79c014f11df3b8/instances/593416e7c9da4a4c97c6ad5b086b8ddfin02/replica-set/name

    Table 1 Path parameters

    Name

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID of a tenant in a region. Obtain the project ID by following the instructions in Obtaining a Project ID.

    instance_id

    Yes

    String

    Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

Table 3 Request body parameters

Name

Mandatory

Type

Description

name

Yes

String

Name of the replica set in the connection address.

It specifies the unique identifier of the instance HA connection address. This parameter can be used to send read requests to all nodes of a replica set instance. All hosts in a replica set instance must have the same set name.

The name of the replica set in the connection address must be 3 to 128 characters long and start with a letter. It is case-sensitive and can contain only letters, digits, and underscores (_).

  • Example request
    { 
       "name" : "replica" 
     }

Response Parameters

Status code: 202

Table 4 Response body parameters

Name

Type

Description

job_id

String

Workflow ID.

Status code: 406

Table 5 Response body parameters

Name

Type

Description

ErrorResponse

Array of Table 6 objects

This operation is not allowed because the instance is not a replica set instance or is abnormal.

Table 6 ErrorResponse

Name

Type

Description

error_code

String

Error code returned when a task submission exception occurs.

error_msg

String

Error description returned when a task submission exception occurs.

  • Example response
    Status code: 202
    { 
        "job_id" : "6ad4eb1f-73bd-4876-aa31-aa9a1e41c4bc" 
    }

Status Code

For details, see Status Code.

Error Code

For details, see Error Code.