- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- InstancesDemoteMasterRequest
- DemoteMasterContext
- DemoteMasterConfiguration
- DemoteMasterMySqlReplicaConfiguration
- Examples
- Try it!
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
HTTP request
POST https://sqladmin.googleapis.com/v1/projects/{project}/instances/{instance}/demoteMaster
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
ID of the project that contains the instance. |
instance |
Cloud SQL instance name. |
Request body
The request body contains an instance of InstancesDemoteMasterRequest
.
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.
InstancesDemoteMasterRequest
Database demote primary instance request.
JSON representation |
---|
{
"demoteMasterContext": {
object ( |
Fields | |
---|---|
demoteMasterContext |
Contains details about the demoteMaster operation. |
DemoteMasterContext
Database instance demote primary instance context.
JSON representation |
---|
{
"kind": string,
"verifyGtidConsistency": boolean,
"masterInstanceName": string,
"replicaConfiguration": {
object ( |
Fields | |
---|---|
kind |
This is always |
verifyGtidConsistency |
Verify the GTID consistency for demote operation. Default value: |
masterInstanceName |
The name of the instance which will act as on-premises primary instance in the replication setup. |
replicaConfiguration |
Configuration specific to read-replicas replicating from the on-premises primary instance. |
skipReplicationSetup |
Flag to skip replication setup on the instance. |
DemoteMasterConfiguration
Read-replica configuration for connecting to the on-premises primary instance.
JSON representation |
---|
{
"kind": string,
"mysqlReplicaConfiguration": {
object ( |
Fields | |
---|---|
kind |
This is always |
mysqlReplicaConfiguration |
MySQL specific configuration when replicating from a MySQL on-premises primary instance. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named |
DemoteMasterMySqlReplicaConfiguration
Read-replica configuration specific to MySQL databases.
JSON representation |
---|
{ "kind": string, "username": string, "password": string, "clientKey": string, "clientCertificate": string, "caCertificate": string } |
Fields | |
---|---|
kind |
This is always |
username |
The username for the replication connection. |
password |
The password for the replication connection. |
clientKey |
PEM representation of the replica's private key. The corresponsing public key is encoded in the client's certificate. The format of the replica's private key can be either PKCS #1 or PKCS #8. |
clientCertificate |
PEM representation of the replica's x509 certificate. |
caCertificate |
PEM representation of the trusted CA's x509 certificate. |