- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- CopyBackupEncryptionConfig
- EncryptionType
- Try it!
Starts copying a 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 copying of the backup. The operation is associated with the destination backup. The metadata field type is CopyBackupMetadata
. The response field type is Backup
, if successful. Cancelling the returned operation will stop the copying and delete the destination backup. Concurrent backups.copy requests can run on the same source backup.
HTTP request
POST https://spanner.googleapis.com/v1/{parent=projects/*/instances/*}/backups:copy
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
parent |
Required. The name of the destination instance that will contain the backup copy. 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 |
---|
{
"backupId": string,
"sourceBackup": string,
"expireTime": string,
"encryptionConfig": {
object ( |
Fields | |
---|---|
backup |
Required. The id of the backup copy. The |
source |
Required. The source backup to be copied. The source backup needs to be in READY state for it to be copied. Once backups.copy is in progress, the source backup cannot be deleted or cleaned up on expiration until backups.copy is finished. Values are of the form: Authorization requires the following IAM permission on the specified resource
|
expire |
Required. The expiration time of the backup in microsecond granularity. The expiration time must be at least 6 hours and at most 366 days from the A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
encryption |
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 source backup by default, namely |
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.
IAM Permissions
Requires the following IAM permission on the parent
resource:
spanner.backups.create
Requires the following IAM permission on the sourceBackup
resource:
spanner.backups.copy
For more information, see the IAM documentation.
CopyBackupEncryptionConfig
Encryption configuration for the copied backup.
JSON representation |
---|
{
"encryptionType": enum ( |
Fields | |
---|---|
encryption |
Required. The encryption type of the backup. |
kms |
Optional. The Cloud KMS key that will be used to protect the backup. This field should be set only when |
kms |
Optional. Specifies the KMS configuration for the one or more keys used to protect the backup. Values are of the form The keys referenced by
|
EncryptionType
Encryption types for the backup.
Enums | |
---|---|
ENCRYPTION_TYPE_UNSPECIFIED |
Unspecified. Do not use. |
USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION |
This is the default option for backups.copy when encryptionConfig is not specified. For example, if the source backup is using Customer_Managed_Encryption , the backup will be using the same Cloud KMS key as the source backup. |
GOOGLE_DEFAULT_ENCRYPTION |
Use Google default encryption. |
CUSTOMER_MANAGED_ENCRYPTION |
Use customer managed encryption. If specified, either kmsKeyName or kmsKeyNames must contain valid Cloud KMS key(s). |