- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- DatabaseMoveConfig
- EncryptionConfig
- Try it!
Moves an instance to the target instance configuration. You can use the returned long-running operation to track the progress of moving the instance.
instances.move
returns FAILED_PRECONDITION
if the instance meets any of the following criteria:
- Is undergoing a move to a different instance configuration
- Has backups
- Has an ongoing update
- Contains any CMEK-enabled databases
- Is a free trial instance
While the operation is pending:
- All other attempts to modify the instance, including changes to its compute capacity, are rejected.
- The following database and backup admin operations are rejected:
* `DatabaseAdmin.CreateDatabase`
* `DatabaseAdmin.UpdateDatabaseDdl` (disabled if defaultLeader is
specified in the request.)
* `DatabaseAdmin.RestoreDatabase`
* `DatabaseAdmin.CreateBackup`
* `DatabaseAdmin.CopyBackup`
- Both the source and target instance configurations are subject to hourly compute and storage charges.
- The instance might experience higher read-write latencies and a higher transaction abort rate. However, moving an instance doesn't cause any downtime.
The returned long-running operation has a name of the format <instance_name>/operations/<operationId>
and can be used to track the move instance operation. The metadata field type is MoveInstanceMetadata
. The response field type is Instance
, if successful. Cancelling the operation sets its metadata's cancelTime
. Cancellation is not immediate because it involves moving any data previously moved to the target instance configuration back to the original instance configuration. You can use this operation to track the progress of the cancellation. Upon successful completion of the cancellation, the operation terminates with CANCELLED
status.
If not cancelled, upon completion of the returned operation:
- The instance successfully moves to the target instance configuration.
- You are billed for compute and storage in target instance configuration.
Authorization requires the spanner.instances.update
permission on the resource instance
.
For more details, see Move an instance.
HTTP request
The URLs use gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The instance to move. Values are of the form Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"targetConfig": string,
"targetDatabaseMoveConfigs": [
{
object ( |
Fields | |
---|---|
targetConfig |
Required. The target instance configuration where to move the instance. Values are of the form |
targetDatabaseMoveConfigs[] |
Optional. The configuration for each database in the target instance configuration. |
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.
DatabaseMoveConfig
The configuration for each database in the target instance configuration.
JSON representation |
---|
{
"databaseId": string,
"encryptionConfig": {
object ( |
Fields | |
---|---|
databaseId |
Required. The unique identifier of the database resource in the Instance. For example, if the database uri is |
encryptionConfig |
Optional. Encryption configuration to be used for the database in the target configuration. The encryption configuration must be specified for every database which currently uses CMEK encryption. If a database currently uses Google-managed encryption and a target encryption configuration is not specified, then the database defaults to Google-managed encryption. If a database currently uses Google-managed encryption and a target CMEK encryption is specified, the request is rejected. If a database currently uses CMEK encryption, then a target encryption configuration must be specified. You can't move a CMEK database to a Google-managed encryption database using the instances.move API. |
EncryptionConfig
Encryption configuration for a Cloud Spanner database.
JSON representation |
---|
{ "kmsKeyName": string, "kmsKeyNames": [ string ] } |
Fields | |
---|---|
kmsKeyName |
Optional. This field is maintained for backwards compatibility. For new callers, we recommend using The Cloud KMS key that is used to encrypt and decrypt the restored database. Values are of the form |
kmsKeyNames[] |
Optional. Specifies the KMS configuration for one or more keys used to encrypt the database. Values are of the form The keys referenced by
|