snapshots
Creates, updates, deletes, gets or lists a snapshots
resource.
Overview
Name | snapshots |
Type | Resource |
Id | google.baremetalsolution.snapshots |
Fields
Name | Datatype | Description |
---|---|---|
id | string | Output only. An identifier for the snapshot, generated by the backend. |
name | string | The name of the snapshot. |
description | string | The description of the snapshot. |
createTime | string | Output only. The creation time of the snapshot. |
storageVolume | string | Output only. The name of the volume which this snapshot belongs to. |
type | string | Output only. The type of the snapshot which indicates whether it was scheduled or manual/ad-hoc. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | locationsId, projectsId, snapshotsId, volumesId | Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot volume. |
list | SELECT | locationsId, projectsId, volumesId | 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. |
create | INSERT | locationsId, projectsId, volumesId | Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot volume. |
delete | DELETE | locationsId, projectsId, snapshotsId, volumesId | Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot volume. |
restore_volume_snapshot | EXEC | locationsId, projectsId, snapshotsId, volumesId | Uses 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.baremetalsolution.snapshots (
locationsId,
projectsId,
volumesId,
name,
description
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ volumesId }}',
'{{ name }}',
'{{ description }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: id
value: string
- name: description
value: string
- name: createTime
value: string
- name: storageVolume
value: string
- name: type
value: string
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 }}';