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

Querying the Name of the Replica Set in the Connection Address

API Description

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

Restrictions

This API applies only to replica set instances.

URI

  • URI format

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

  • URI example
    https://dds.cn-north-1.myhuaweicloud.com/v3/0d248ca90800d3902f79c014f11df3b8/instances/593416e7c9da4a4c97c6ad5b086b8ddfin02/replica-set/name
    Table 1 Request parameters

    Name

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    Definition

    User token obtained from IAM. For details, see Authentication.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    project_id

    Yes

    String

    Definition

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

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    String

    Definition

    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.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request Parameters

None

Response Parameters

  • Parameter description

    Status code: 200

    Table 2 Response body parameters

    Name

    Type

    Description

    name

    String

    Definition

    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.

    Range

    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, hyphens (-), and underscores (_).

    Status code: 406

    Table 3 Response body parameters

    Name

    Type

    Description

    ErrorResponse

    Array of Table 4 objects

    Definition

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

    Range

    N/A

    Table 4 ErrorResponse

    Name

    Type

    Description

    error_code

    String

    Definition

    Error code returned when a task submission exception occurs.

    Range

    N/A

    error_msg

    String

    Definition

    Error description returned when a task submission exception occurs.

    Range

    N/A

  • Example response
    Status code: 200
    { 
        "name" : "replica" 
    }

Status Code

For details, see Status Code.

Error Code

For details, see Error Code.