snapshots
Creates, updates, deletes, gets or lists a snapshots
resource.
Overview
Name | snapshots |
Type | Resource |
Id | google.file.snapshots |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
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} . |
createTime | string (google-datetime) | Output only. The time when the snapshot was created. |
description | string | A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected. |
filesystemUsedBytes | string (int64) | 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 bound to this resource. Each key must be a namespaced name and each value a short name. Example: "123456789012/environment" : "production", "123456789013/costCenter" : "marketing" See the documentation for more information: - Namespaced name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key - Short name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value |
Successful response
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} . |
createTime | string (google-datetime) | Output only. The time when the snapshot was created. |
description | string | A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected. |
filesystemUsedBytes | string (int64) | 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 bound to this resource. Each key must be a namespaced name and each value a short name. Example: "123456789012/environment" : "production", "123456789013/costCenter" : "marketing" See the documentation for more information: - Namespaced name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key - Short name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , instancesId , snapshotsId | Gets the details of a specific snapshot. | |
list | select | projectsId , locationsId , instancesId | pageSize , pageToken , orderBy , filter , returnPartialSuccess | Lists all snapshots in a project for either a specified location or for all locations. |
create | insert | projectsId , locationsId , instancesId | snapshotId | Creates a snapshot. |
patch | update | projectsId , locationsId , instancesId , snapshotsId | updateMask | Updates the settings of a specific snapshot. |
delete | delete | projectsId , locationsId , instancesId , snapshotsId | Deletes a snapshot. |
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 |
---|---|---|
instancesId | string | |
locationsId | string | |
projectsId | string | |
snapshotsId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
returnPartialSuccess | boolean | |
snapshotId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets the details of a specific snapshot.
SELECT
name,
createTime,
description,
filesystemUsedBytes,
labels,
state,
tags
FROM google.file.snapshots
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required
AND snapshotsId = '{{ snapshotsId }}' -- required;
Lists all snapshots in a project for either a specified location or for all locations.
SELECT
name,
createTime,
description,
filesystemUsedBytes,
labels,
state,
tags
FROM google.file.snapshots
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
INSERT
examples
- create
- Manifest
Creates a snapshot.
INSERT INTO google.file.snapshots (
data__description,
data__labels,
data__tags,
projectsId,
locationsId,
instancesId,
snapshotId
)
SELECT
'{{ description }}',
'{{ labels }}',
'{{ tags }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ instancesId }}',
'{{ snapshotId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: snapshots
props:
- name: projectsId
value: string
description: Required parameter for the snapshots resource.
- name: locationsId
value: string
description: Required parameter for the snapshots resource.
- name: instancesId
value: string
description: Required parameter for the snapshots resource.
- name: description
value: string
description: >
A description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
- name: labels
value: object
description: >
Resource labels to represent user provided metadata.
- name: tags
value: object
description: >
Optional. Input only. Immutable. Tag key-value pairs bound to this resource. Each key must be a namespaced name and each value a short name. Example: "123456789012/environment" : "production", "123456789013/costCenter" : "marketing" See the documentation for more information: - Namespaced name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key - Short name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value
- name: snapshotId
value: string
UPDATE
examples
- patch
Updates the settings of a specific snapshot.
UPDATE google.file.snapshots
SET
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__tags = '{{ tags }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND snapshotsId = '{{ snapshotsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE
examples
- delete
Deletes a snapshot.
DELETE FROM google.file.snapshots
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND snapshotsId = '{{ snapshotsId }}' --required;