Method: projects.instances.databases.changequorum

databases.changequorum is strictly restricted to databases that use dual-region instance configurations.

Initiates a background operation to change the quorum of a database from dual-region mode to single-region mode or vice versa.

The returned long-running operation has a name of the format projects/<project>/instances/<instance>/databases/<database>/operations/<operationId> and can be used to track execution of the databases.changequorum. The metadata field type is ChangeQuorumMetadata.

Authorization requires spanner.databases.changequorum permission on the resource database.

HTTP request

POST https://spanner.googleapis.com/v1/{name=projects/*/instances/*/databases/*}:changequorum

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Name of the database in which to apply databases.changequorum. Values are of the form projects/<project>/instances/<instance>/databases/<database>.

Authorization requires the following IAM permission on the specified resource name:

  • spanner.databases.changequorum

Request body

The request body contains data with the following structure:

JSON representation
{
  "quorumType": {
    object (QuorumType)
  },
  "etag": string
}
Fields
quorumType

object (QuorumType)

Required. The type of this quorum.

etag

string

Optional. The etag is the hash of the QuorumInfo. The databases.changequorum operation is only performed if the etag matches that of the QuorumInfo in the current database resource. Otherwise the API returns an ABORTED error.

The etag is used for optimistic concurrency control as a way to help prevent simultaneous change quorum requests that could create a race condition.

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/spanner.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.