backup_schedules
Creates, updates, deletes, gets or lists a backup_schedules
resource.
Overview
Name | backup_schedules |
Type | Resource |
Id | google.spanner.backup_schedules |
Fields
The following fields are returned by SELECT
queries:
- projects_instances_databases_backup_schedules_get
- projects_instances_databases_backup_schedules_list
Successful response
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 | Optional. 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) |
fullBackupSpec | object | The schedule creates only full backups. (id: FullBackupSpec) |
incrementalBackupSpec | object | The schedule creates incremental backup chains. (id: IncrementalBackupSpec) |
retentionDuration | string (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. |
spec | object | Optional. The schedule specification based on which the backup creations are triggered. (id: BackupScheduleSpec) |
updateTime | string (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. |
Successful response
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 | Optional. 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) |
fullBackupSpec | object | The schedule creates only full backups. (id: FullBackupSpec) |
incrementalBackupSpec | object | The schedule creates incremental backup chains. (id: IncrementalBackupSpec) |
retentionDuration | string (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. |
spec | object | Optional. The schedule specification based on which the backup creations are triggered. (id: BackupScheduleSpec) |
updateTime | string (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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_instances_databases_backup_schedules_get | select | projectsId , instancesId , databasesId , backupSchedulesId | Gets backup schedule for the input schedule name. | |
projects_instances_databases_backup_schedules_list | select | projectsId , instancesId , databasesId | pageSize , pageToken | Lists all the backup schedules for the database. |
projects_instances_databases_backup_schedules_create | insert | projectsId , instancesId , databasesId | backupScheduleId | Creates a new backup schedule. |
projects_instances_databases_backup_schedules_patch | update | projectsId , instancesId , databasesId , backupSchedulesId | updateMask | Updates a backup schedule. |
projects_instances_databases_backup_schedules_delete | delete | projectsId , instancesId , databasesId , backupSchedulesId | Deletes 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.
Name | Datatype | Description |
---|---|---|
backupSchedulesId | string | |
databasesId | string | |
instancesId | string | |
projectsId | string | |
backupScheduleId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- projects_instances_databases_backup_schedules_get
- projects_instances_databases_backup_schedules_list
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;
Lists all the backup schedules for the database.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_instances_databases_backup_schedules_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: backup_schedules
props:
- name: projectsId
value: string
description: Required parameter for the backup_schedules resource.
- name: instancesId
value: string
description: Required parameter for the backup_schedules resource.
- name: databasesId
value: string
description: Required parameter for the backup_schedules resource.
- name: name
value: string
description: >
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.
- name: spec
value: object
description: >
Optional. The schedule specification based on which the backup creations are triggered.
- name: retentionDuration
value: string
description: >
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.
- name: encryptionConfig
value: object
description: >
Optional. 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.
- name: fullBackupSpec
value: object
description: >
The schedule creates only full backups.
- name: incrementalBackupSpec
value: object
description: >
The schedule creates incremental backup chains.
- name: backupScheduleId
value: string
UPDATE
examples
- projects_instances_databases_backup_schedules_patch
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
- projects_instances_databases_backup_schedules_delete
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;