Skip to main content

backup_schedules

Creates, updates, deletes, gets or lists a backup_schedules resource.

Overview

Namebackup_schedules
TypeResource
Idgoogle.spanner.backup_schedules

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Output only for the CreateBackupSchedule operation. Required for the UpdateBackupSchedule operation. A globally unique identifier for the backup schedule which cannot be changed. Values are of the form projects//instances//databases//backupSchedules/a-z*[a-z0-9] The final segment of the name must be between 2 and 60 characters in length.
encryptionConfigobjectOptional. The encryption configuration that is used to encrypt the backup. If this field is not specified, the backup uses the same encryption configuration as the database. (id: CreateBackupEncryptionConfig)
fullBackupSpecobjectThe schedule creates only full backups. (id: FullBackupSpec)
incrementalBackupSpecobjectThe schedule creates incremental backup chains. (id: IncrementalBackupSpec)
retentionDurationstring (google-duration)Optional. The retention duration of a backup that must be at least 6 hours and at most 366 days. The backup is eligible to be automatically deleted once the retention period has elapsed.
specobjectOptional. The schedule specification based on which the backup creations are triggered. (id: BackupScheduleSpec)
updateTimestring (google-datetime)Output only. The timestamp at which the schedule was last updated. If the schedule has never been updated, this field contains the timestamp when the schedule was first created.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_instances_databases_backup_schedules_getselectprojectsId, instancesId, databasesId, backupSchedulesIdGets backup schedule for the input schedule name.
projects_instances_databases_backup_schedules_listselectprojectsId, instancesId, databasesIdpageSize, pageTokenLists all the backup schedules for the database.
projects_instances_databases_backup_schedules_createinsertprojectsId, instancesId, databasesIdbackupScheduleIdCreates a new backup schedule.
projects_instances_databases_backup_schedules_patchupdateprojectsId, instancesId, databasesId, backupSchedulesIdupdateMaskUpdates a backup schedule.
projects_instances_databases_backup_schedules_deletedeleteprojectsId, instancesId, databasesId, backupSchedulesIdDeletes a backup schedule.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
backupSchedulesIdstring
databasesIdstring
instancesIdstring
projectsIdstring
backupScheduleIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets backup schedule for the input schedule name.

SELECT
name,
encryptionConfig,
fullBackupSpec,
incrementalBackupSpec,
retentionDuration,
spec,
updateTime
FROM google.spanner.backup_schedules
WHERE projectsId = '{{ projectsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required
AND databasesId = '{{ databasesId }}' -- required
AND backupSchedulesId = '{{ backupSchedulesId }}' -- required;

INSERT examples

Creates a new backup schedule.

INSERT INTO google.spanner.backup_schedules (
data__name,
data__spec,
data__retentionDuration,
data__encryptionConfig,
data__fullBackupSpec,
data__incrementalBackupSpec,
projectsId,
instancesId,
databasesId,
backupScheduleId
)
SELECT
'{{ name }}',
'{{ spec }}',
'{{ retentionDuration }}',
'{{ encryptionConfig }}',
'{{ fullBackupSpec }}',
'{{ incrementalBackupSpec }}',
'{{ projectsId }}',
'{{ instancesId }}',
'{{ databasesId }}',
'{{ backupScheduleId }}'
RETURNING
name,
encryptionConfig,
fullBackupSpec,
incrementalBackupSpec,
retentionDuration,
spec,
updateTime
;

UPDATE examples

Updates a backup schedule.

UPDATE google.spanner.backup_schedules
SET
data__name = '{{ name }}',
data__spec = '{{ spec }}',
data__retentionDuration = '{{ retentionDuration }}',
data__encryptionConfig = '{{ encryptionConfig }}',
data__fullBackupSpec = '{{ fullBackupSpec }}',
data__incrementalBackupSpec = '{{ incrementalBackupSpec }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND backupSchedulesId = '{{ backupSchedulesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
encryptionConfig,
fullBackupSpec,
incrementalBackupSpec,
retentionDuration,
spec,
updateTime;

DELETE examples

Deletes a backup schedule.

DELETE FROM google.spanner.backup_schedules
WHERE projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND backupSchedulesId = '{{ backupSchedulesId }}' --required;