snapshots
Creates, updates, deletes, gets or lists a snapshots
resource.
Overview
Name | snapshots |
Type | Resource |
Id | google.file.snapshots |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name of the snapshot, in the format projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id} . |
description | string | A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected. |
createTime | string | Output only. The time when the snapshot was created. |
filesystemUsedBytes | string | Output only. The amount of bytes needed to allocate a full copy of the snapshot content |
labels | object | Resource labels to represent user provided metadata. |
state | string | Output only. The snapshot state. |
tags | object | Optional. Input only. Immutable. Tag key-value pairs are bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | instancesId, locationsId, projectsId, snapshotsId | Gets the details of a specific snapshot. |
list | SELECT | instancesId, locationsId, projectsId | Lists all snapshots in a project for either a specified location or for all locations. |
create | INSERT | instancesId, locationsId, projectsId | Creates a snapshot. |
delete | DELETE | instancesId, locationsId, projectsId, snapshotsId | Deletes a snapshot. |
patch | UPDATE | instancesId, locationsId, projectsId, snapshotsId | Updates the settings of a specific snapshot. |
SELECT
examples
Lists all snapshots in a project for either a specified location or for all locations.
SELECT
name,
description,
createTime,
filesystemUsedBytes,
labels,
state,
tags
FROM google.file.snapshots
WHERE instancesId = '{{ instancesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new snapshots
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.file.snapshots (
instancesId,
locationsId,
projectsId,
description,
labels,
tags
)
SELECT
'{{ instancesId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ labels }}',
'{{ tags }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: description
value: string
- name: state
value: string
- name: createTime
value: string
- name: labels
value: object
- name: filesystemUsedBytes
value: string
- name: tags
value: object
UPDATE
example
Updates a snapshots
resource.
/*+ update */
UPDATE google.file.snapshots
SET
description = '{{ description }}',
labels = '{{ labels }}',
tags = '{{ tags }}'
WHERE
instancesId = '{{ instancesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND snapshotsId = '{{ snapshotsId }}';
DELETE
example
Deletes the specified snapshots
resource.
/*+ delete */
DELETE FROM google.file.snapshots
WHERE instancesId = '{{ instancesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND snapshotsId = '{{ snapshotsId }}';