- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- InstancesFailoverRequest
- FailoverContext
- Examples
- Try it!
Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.
HTTP request
POST https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/failover
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
ID of the project that contains the read replica. |
instance |
Cloud SQL instance ID. This does not include the project ID. |
Request body
The request body contains an instance of InstancesFailoverRequest
.
Response body
If successful, the response body contains an instance of Operation
.
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/sqlservice.admin
For more information, see the Authentication Overview.
InstancesFailoverRequest
Instance failover request.
JSON representation |
---|
{
"failoverContext": {
object ( |
Fields | |
---|---|
failoverContext |
instances.failover Context. |
FailoverContext
Database instance failover context.
JSON representation |
---|
{ "settingsVersion": string, "kind": string } |
Fields | |
---|---|
settingsVersion |
The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version. |
kind |
This is always |