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

The following fields are returned by SELECT queries:

Successful response

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}
createTimestring (google-datetime)Output only. The timestamp at which this backup schedule was created and effective since. No backups will be created for this schedule before this time.
dailyRecurrenceobjectFor a schedule that runs daily. (id: GoogleFirestoreAdminV1DailyRecurrence)
retentionstring (google-duration)At 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.
updateTimestring (google-datetime)Output 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.
weeklyRecurrenceobjectFor a schedule that runs weekly on a specific day. (id: GoogleFirestoreAdminV1WeeklyRecurrence)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, databasesId, backupSchedulesIdGets information about a backup schedule.
listselectprojectsId, databasesIdList backup schedules.
createinsertprojectsId, databasesIdCreates 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.
patchupdateprojectsId, databasesId, backupSchedulesIdupdateMaskUpdates a backup schedule.
deletedeleteprojectsId, 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
projectsIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets information about a backup schedule.

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

INSERT examples

Creates 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.

INSERT INTO google.firestore.backup_schedules (
data__retention,
data__dailyRecurrence,
data__weeklyRecurrence,
projectsId,
databasesId
)
SELECT
'{{ retention }}',
'{{ dailyRecurrence }}',
'{{ weeklyRecurrence }}',
'{{ projectsId }}',
'{{ databasesId }}'
RETURNING
name,
createTime,
dailyRecurrence,
retention,
updateTime,
weeklyRecurrence
;

UPDATE examples

Updates a backup schedule.

UPDATE google.firestore.backup_schedules
SET
data__retention = '{{ retention }}',
data__dailyRecurrence = '{{ dailyRecurrence }}',
data__weeklyRecurrence = '{{ weeklyRecurrence }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND backupSchedulesId = '{{ backupSchedulesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
dailyRecurrence,
retention,
updateTime,
weeklyRecurrence;

DELETE examples

Deletes a backup schedule.

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