Method: instances.switchover Stay organized with collections Save and categorize content based on your preferences.
- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- Examples
- Try it!
Switches over from the primary instance to the DR replica instance.
HTTP request
POST https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/switchover
The URL usesgRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
ID of the project that contains the replica. |
instance |
Cloud SQL read replica instance name. |
Query parameters
Parameters | |
---|---|
db |
Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations timeout, which is a sum of all database operations. Default value is 10 minutes and can be modified to a maximum value of 24 hours. A duration in seconds with up to nine fractional digits, ending with ' |
Request body
The request body must be empty.
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.
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.