Help Center/ GeminiDB/ API Reference/ APIs v3 (Recommended)/ Instances/ Performing a Primary/Standby Switchover
Updated on 2025-11-27 GMT+08:00

Performing a Primary/Standby Switchover

Function

This API is used to switch the primary and standby of a GeminiDB Redis instance.

Constraints

This API supports the following instance type:

  • Primary/Standby GeminiDB Redis instance

Authorization Information

Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • 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

    gaussdbfornosql:instance:switchover

    Write

    instance *

    • g:ResourceTag/<tag-key>
    • g:EnterpriseProjectId

    nosql:dr:switchoverDisasterRecovery

    -

URI

PUT /v3/{project_id}/instance/{instance_id}/switchover

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Explanation:

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

Constraints:

N/A

Values:

N/A

Default value:

N/A

instance_id

Yes

String

Explanation:

Instance ID.

Constraints:

N/A

Values:

N/A

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token.

Constraints:

N/A

Values:

N/A

Default value:

N/A

Response Parameters

Status code: 202

Table 3 Response body parameters

Parameter

Type

Description

job_id

String

Explanation:

Task ID.

Values:

N/A

Example Request

PUT https://{Endpoint}/v3/2900b7b8d03e4619b8db8d43bc6234ee/instance/f42ecf40870644b288884742bff6ef51in12/switchover

Example Response

Status code: 202

Accepted.

{ 
   "job_id" : "528747ac-c30b-4904-a4ed-806c6943ec96" 
 }

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.