Method: projects.instances.backups.create

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format projects/<project>/instances/<instance>/backups/<backup>/operations/<operationId> and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently.

HTTP request

POST https://spanner.googleapis.com/v1/{parent=projects/*/instances/*}/backups

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The name of the instance in which the backup will be created. This must be the same instance that contains the database the backup will be created from. The backup will be stored in the location(s) specified in the instance configuration of this instance. Values are of the form projects/<project>/instances/<instance>.

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

  • spanner.backups.create

Query parameters

Parameters
backupId

string

Required. The id of the backup to be created. The backupId appended to parent forms the full backup name of the form projects/<project>/instances/<instance>/backups/<backupId>.

encryptionConfig

object (CreateBackupEncryptionConfig)

Optional. The encryption configuration used to encrypt the backup. If this field is not specified, the backup will use the same encryption configuration as the database by default, namely encryptionType = USE_DATABASE_ENCRYPTION.

Request body

The request body contains an instance of Backup.

Response body

If successful, the response body contains a newly created 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.

IAM Permissions

Requires the following IAM permission on the database resource:

  • spanner.databases.createBackup

Requires the following IAM permission on the parent resource:

  • spanner.backups.create

For more information, see the IAM documentation.

CreateBackupEncryptionConfig

Encryption configuration for the backup to create.

JSON representation
{
  "encryptionType": enum (EncryptionType),
  "kmsKeyName": string
}
Fields
encryptionType

enum (EncryptionType)

Required. The encryption type of the backup.

kmsKeyName

string

Optional. The Cloud KMS key that will be used to protect the backup. This field should be set only when encryptionType is CUSTOMER_MANAGED_ENCRYPTION. Values are of the form projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kmsKeyName>.

EncryptionType

Encryption types for the backup.

Enums
ENCRYPTION_TYPE_UNSPECIFIED Unspecified. Do not use.
USE_DATABASE_ENCRYPTION Use the same encryption configuration as the database. This is the default option when encryptionConfig is empty. For example, if the database is using Customer_Managed_Encryption, the backup will be using the same Cloud KMS key as the database.
GOOGLE_DEFAULT_ENCRYPTION Use Google default encryption.
CUSTOMER_MANAGED_ENCRYPTION Use customer managed encryption. If specified, kmsKeyName must contain a valid Cloud KMS key.