backup_schedules
Creates, updates, deletes, gets or lists a backup_schedules
resource.
Overview
Name | backup_schedules |
Type | Resource |
Id | google.spanner.backup_schedules |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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. |
encryptionConfig | object | Encryption configuration for the backup to create. |
fullBackupSpec | object | The specification for full backups. A full backup stores the entire contents of the database at a given version time. |
incrementalBackupSpec | object | The specification for incremental backup chains. An incremental backup stores the delta of changes between a previous backup and the database contents at a given version time. An incremental backup chain consists of a full backup and zero or more successive incremental backups. The first backup created for an incremental backup chain is always a full backup. |
retentionDuration | string | 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. |
spec | object | Defines specifications of the backup schedule. |
updateTime | string | 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_instances_databases_backup_schedules_get | SELECT | backupSchedulesId, databasesId, instancesId, projectsId | Gets backup schedule for the input schedule name. |
projects_instances_databases_backup_schedules_list | SELECT | databasesId, instancesId, projectsId | Lists all the backup schedules for the database. |
projects_instances_databases_backup_schedules_create | INSERT | databasesId, instancesId, projectsId | Creates a new backup schedule. |
projects_instances_databases_backup_schedules_delete | DELETE | backupSchedulesId, databasesId, instancesId, projectsId | Deletes a backup schedule. |
projects_instances_databases_backup_schedules_patch | UPDATE | backupSchedulesId, databasesId, instancesId, projectsId | Updates a backup schedule. |
SELECT
examples
Lists all the backup schedules for the database.
SELECT
name,
encryptionConfig,
fullBackupSpec,
incrementalBackupSpec,
retentionDuration,
spec,
updateTime
FROM google.spanner.backup_schedules
WHERE databasesId = '{{ databasesId }}'
AND instancesId = '{{ instancesId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new backup_schedules
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.spanner.backup_schedules (
databasesId,
instancesId,
projectsId,
name,
spec,
retentionDuration,
encryptionConfig,
fullBackupSpec,
incrementalBackupSpec
)
SELECT
'{{ databasesId }}',
'{{ instancesId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ spec }}',
'{{ retentionDuration }}',
'{{ encryptionConfig }}',
'{{ fullBackupSpec }}',
'{{ incrementalBackupSpec }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: spec
value:
- name: cronSpec
value:
- name: text
value: string
- name: timeZone
value: string
- name: creationWindow
value: string
- name: retentionDuration
value: string
- name: encryptionConfig
value:
- name: encryptionType
value: string
- name: kmsKeyName
value: string
- name: kmsKeyNames
value:
- string
- name: fullBackupSpec
value: []
- name: incrementalBackupSpec
value: []
- name: updateTime
value: string
UPDATE
example
Updates a backup_schedules
resource.
/*+ update */
UPDATE google.spanner.backup_schedules
SET
name = '{{ name }}',
spec = '{{ spec }}',
retentionDuration = '{{ retentionDuration }}',
encryptionConfig = '{{ encryptionConfig }}',
fullBackupSpec = '{{ fullBackupSpec }}',
incrementalBackupSpec = '{{ incrementalBackupSpec }}'
WHERE
backupSchedulesId = '{{ backupSchedulesId }}'
AND databasesId = '{{ databasesId }}'
AND instancesId = '{{ instancesId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified backup_schedules
resource.
/*+ delete */
DELETE FROM google.spanner.backup_schedules
WHERE backupSchedulesId = '{{ backupSchedulesId }}'
AND databasesId = '{{ databasesId }}'
AND instancesId = '{{ instancesId }}'
AND projectsId = '{{ projectsId }}';