Method: instances.failover

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 theOverview 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/v1/projects/{project}/instances/{instance}/failover

The URL usesgRPC Transcoding syntax.

Path parameters

Parameters
project

string

ID of the project that contains the read replica.

instance

string

Cloud SQL instance ID. This does not include the project ID.

Request body

The request body contains an instance ofInstancesFailoverRequest.

Response body

If successful, the response body contains an instance ofOperation.

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 theAuthentication Overview.

InstancesFailoverRequest

Instance failover request.

JSON representation
{"failoverContext":{object (FailoverContext)}}
Fields
failoverContext

object (FailoverContext)

instances.failover Context.

FailoverContext

Database instance failover context.

JSON representation
{"settingsVersion":string,"kind":string}
Fields
settingsVersion

string (int64 format)

The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version.

kind

string

This is alwayssql#failoverContext.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-30 UTC.