backup_schedules
Creates, updates, deletes, gets or lists a backup_schedules
resource.
Overview
Name | backup_schedules |
Type | Resource |
Id | google.firestore.backup_schedules |
Fields
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 | 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 | Represents a recurring schedule that runs every day. The time zone is UTC. |
retention | string | 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 | 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 | Represents a recurring schedule that runs on a specified day of the week. The time zone is UTC. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | backupSchedulesId, databasesId, projectsId | Gets information about a backup schedule. |
list | SELECT | databasesId, projectsId | List backup schedules. |
create | INSERT | databasesId, projectsId | 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. |
delete | DELETE | backupSchedulesId, databasesId, projectsId | Deletes a backup schedule. |
patch | UPDATE | backupSchedulesId, databasesId, projectsId | Updates 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.firestore.backup_schedules (
databasesId,
projectsId,
retention,
dailyRecurrence,
weeklyRecurrence
)
SELECT
'{{ databasesId }}',
'{{ projectsId }}',
'{{ retention }}',
'{{ dailyRecurrence }}',
'{{ weeklyRecurrence }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: retention
value: string
- name: dailyRecurrence
value: []
- name: weeklyRecurrence
value:
- name: day
value: string
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 }}';