Help Center/ Document Database Service/ API Reference/ APIs V3.0 (Recommended)/ Database O&M/ Forcibly Promoting a Secondary Node to Primary
Updated on 2024-05-20 GMT+08:00

Forcibly Promoting a Secondary Node to Primary

API Description

This API is used to promote a secondary node of a replica set, shard node, or config node to primary.

Restrictions

If the primary to secondary synchronization delay is long, this operation may fail.

URI

  • URI format

    POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/nodes/{node_id}/primary

  • URI example
    https://dds.cn-north-1.myhuaweicloud.com/v3/2900b7b8d03e4619b8db8d43bc6234ee/instances/b54ea2b393034728b8582e1c4b5b4c88in02/nodes/639371286e95457394914f734e1ed6feno02/primary
    Table 1 Request parameters

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

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

    project_id

    Yes

    String

    Project ID of a tenant in a region.

    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.

    node_id

    Yes

    String

    ID of the secondary node.

Requests

  • Parameter description

    None

  • Example request

    None

Responses

  • Parameter description

    None

  • Example response

    None

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.