Skip to main content

snapshots

Creates, updates, deletes, gets or lists a snapshots resource.

Overview

Namesnapshots
TypeResource
Idgoogle.netapp.snapshots

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the snapshot. Format: projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}.
createTimestring (google-datetime)Output only. The time when the snapshot was created.
descriptionstringA description of the snapshot with 2048 characters or less. Requests with longer descriptions will be rejected.
labelsobjectResource labels to represent user provided metadata.
statestringOutput only. The snapshot state.
stateDetailsstringOutput only. State details of the storage pool
usedBytesnumber (double)Output only. Current storage usage for the snapshot in bytes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, volumesId, snapshotsIdDescribe a snapshot for a volume.
listselectprojectsId, locationsId, volumesIdpageSize, pageToken, orderBy, filterReturns descriptions of all snapshots for a volume.
createinsertprojectsId, locationsId, volumesIdsnapshotIdCreate a new snapshot for a volume.
patchupdateprojectsId, locationsId, volumesId, snapshotsIdupdateMaskUpdates the settings of a specific snapshot.
deletedeleteprojectsId, locationsId, volumesId, snapshotsIdDeletes 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.

NameDatatypeDescription
locationsIdstring
projectsIdstring
snapshotsIdstring
volumesIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
snapshotIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Describe a snapshot for a volume.

SELECT
name,
createTime,
description,
labels,
state,
stateDetails,
usedBytes
FROM google.netapp.snapshots
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND volumesId = '{{ volumesId }}' -- required
AND snapshotsId = '{{ snapshotsId }}' -- required;

INSERT examples

Create a new snapshot for a volume.

INSERT INTO google.netapp.snapshots (
data__name,
data__description,
data__labels,
projectsId,
locationsId,
volumesId,
snapshotId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ volumesId }}',
'{{ snapshotId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the settings of a specific snapshot.

UPDATE google.netapp.snapshots
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND volumesId = '{{ volumesId }}' --required
AND snapshotsId = '{{ snapshotsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a snapshot.

DELETE FROM google.netapp.snapshots
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND volumesId = '{{ volumesId }}' --required
AND snapshotsId = '{{ snapshotsId }}' --required;