Skip to main content

backup_schedules

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

Overview

Namebackup_schedules
TypeResource
Idgoogle.firestore.backup_schedules

Fields

NameDatatypeDescription
namestringOutput only. The unique backup schedule identifier across all locations and databases for the given project. This will be auto-assigned. Format is projects/{project}/databases/{database}/backupSchedules/{backup_schedule}
createTimestringOutput only. The timestamp at which this backup schedule was created and effective since. No backups will be created for this schedule before this time.
dailyRecurrenceobjectRepresents a recurring schedule that runs every day. The time zone is UTC.
retentionstringAt what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. The maximum supported retention period is 14 weeks.
updateTimestringOutput only. The timestamp at which this backup schedule was most recently updated. When a backup schedule is first created, this is the same as create_time.
weeklyRecurrenceobjectRepresents a recurring schedule that runs on a specified day of the week. The time zone is UTC.

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupSchedulesId, databasesId, projectsIdGets information about a backup schedule.
listSELECTdatabasesId, projectsIdList backup schedules.
createINSERTdatabasesId, projectsIdCreates a backup schedule on a database. At most two backup schedules can be configured on a database, one daily backup schedule and one weekly backup schedule.
deleteDELETEbackupSchedulesId, databasesId, projectsIdDeletes a backup schedule.
patchUPDATEbackupSchedulesId, databasesId, projectsIdUpdates a backup schedule.

SELECT examples

List backup schedules.

SELECT
name,
createTime,
dailyRecurrence,
retention,
updateTime,
weeklyRecurrence
FROM google.firestore.backup_schedules
WHERE databasesId = '{{ databasesId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new backup_schedules resource.

/*+ create */
INSERT INTO google.firestore.backup_schedules (
databasesId,
projectsId,
retention,
dailyRecurrence,
weeklyRecurrence
)
SELECT
'{{ databasesId }}',
'{{ projectsId }}',
'{{ retention }}',
'{{ dailyRecurrence }}',
'{{ weeklyRecurrence }}'
;

UPDATE example

Updates a backup_schedules resource.

/*+ update */
UPDATE google.firestore.backup_schedules
SET
retention = '{{ retention }}',
dailyRecurrence = '{{ dailyRecurrence }}',
weeklyRecurrence = '{{ weeklyRecurrence }}'
WHERE
backupSchedulesId = '{{ backupSchedulesId }}'
AND databasesId = '{{ databasesId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified backup_schedules resource.

/*+ delete */
DELETE FROM google.firestore.backup_schedules
WHERE backupSchedulesId = '{{ backupSchedulesId }}'
AND databasesId = '{{ databasesId }}'
AND projectsId = '{{ projectsId }}';