Skip to main content

snapshots

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

Overview

Namesnapshots
TypeResource
Idgoogle.baremetalsolution.snapshots

Fields

NameDatatypeDescription
idstringOutput only. An identifier for the snapshot, generated by the backend.
namestringThe name of the snapshot.
descriptionstringThe description of the snapshot.
createTimestringOutput only. The creation time of the snapshot.
storageVolumestringOutput only. The name of the volume which this snapshot belongs to.
typestringOutput only. The type of the snapshot which indicates whether it was scheduled or manual/ad-hoc.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, snapshotsId, volumesIdReturns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot volume.
listSELECTlocationsId, projectsId, volumesIdRetrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot volume.
createINSERTlocationsId, projectsId, volumesIdTakes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot volume.
deleteDELETElocationsId, projectsId, snapshotsId, volumesIdDeletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot volume.
restore_volume_snapshotEXEClocationsId, projectsId, snapshotsId, volumesIdUses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot volume.

SELECT examples

Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot volume.

SELECT
id,
name,
description,
createTime,
storageVolume,
type
FROM google.baremetalsolution.snapshots
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND volumesId = '{{ volumesId }}';

INSERT example

Use the following StackQL query and manifest file to create a new snapshots resource.

/*+ create */
INSERT INTO google.baremetalsolution.snapshots (
locationsId,
projectsId,
volumesId,
name,
description
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ volumesId }}',
'{{ name }}',
'{{ description }}'
;

DELETE example

Deletes the specified snapshots resource.

/*+ delete */
DELETE FROM google.baremetalsolution.snapshots
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND snapshotsId = '{{ snapshotsId }}'
AND volumesId = '{{ volumesId }}';