backup_schedules
Creates, updates, deletes, gets or lists a backup_schedules
resource.
Overview
Name | backup_schedules |
Type | Resource |
Id | google.firestore.backup_schedules |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output 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} |
createTime | string (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. |
dailyRecurrence | object | For a schedule that runs daily. (id: GoogleFirestoreAdminV1DailyRecurrence) |
retention | string (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. |
updateTime | string (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. |
weeklyRecurrence | object | For a schedule that runs weekly on a specific day. (id: GoogleFirestoreAdminV1WeeklyRecurrence) |
Successful response
Name | Datatype | Description |
---|---|---|
backupSchedules | array | List of all backup schedules. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , databasesId , backupSchedulesId | Gets information about a backup schedule. | |
list | select | projectsId , databasesId | List backup schedules. | |
create | insert | projectsId , databasesId | 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. | |
patch | update | projectsId , databasesId , backupSchedulesId | updateMask | Updates a backup schedule. |
delete | delete | projectsId , 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 | |
projectsId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
List backup schedules.
SELECT
backupSchedules
FROM google.firestore.backup_schedules
WHERE projectsId = '{{ projectsId }}' -- required
AND databasesId = '{{ databasesId }}' -- required;
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: backup_schedules
props:
- name: projectsId
value: string
description: Required parameter for the backup_schedules resource.
- name: databasesId
value: string
description: Required parameter for the backup_schedules resource.
- name: retention
value: string
description: >
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.
- name: dailyRecurrence
value: object
description: >
For a schedule that runs daily.
- name: weeklyRecurrence
value: object
description: >
For a schedule that runs weekly on a specific day.
UPDATE
examples
- patch
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
- delete
Deletes a backup schedule.
DELETE FROM google.firestore.backup_schedules
WHERE projectsId = '{{ projectsId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND backupSchedulesId = '{{ backupSchedulesId }}' --required;