snapshots
Creates, updates, deletes, gets or lists a snapshots
resource.
Overview
Name | snapshots |
Type | Resource |
Id | google.baremetalsolution.snapshots |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | Output only. An identifier for the snapshot, generated by the backend. |
name | string | The name of the snapshot. |
createTime | string (google-datetime) | Output only. The creation time of the snapshot. |
description | string | The description 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. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | Output only. An identifier for the snapshot, generated by the backend. |
name | string | The name of the snapshot. |
createTime | string (google-datetime) | Output only. The creation time of the snapshot. |
description | string | The description 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
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , volumesId , snapshotsId | Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot volume. | |
list | select | projectsId , locationsId , volumesId | pageSize , pageToken | 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 | projectsId , locationsId , volumesId | Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot volume. | |
delete | delete | projectsId , locationsId , volumesId , snapshotsId | Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot volume. | |
restore_volume_snapshot | exec | projectsId , locationsId , volumesId , snapshotsId | Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot volume. |
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 |
---|---|---|
locationsId | string | |
projectsId | string | |
snapshotsId | string | |
volumesId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot volume.
SELECT
id,
name,
createTime,
description,
storageVolume,
type
FROM google.baremetalsolution.snapshots
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND volumesId = '{{ volumesId }}' -- required
AND snapshotsId = '{{ snapshotsId }}' -- required;
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,
createTime,
description,
storageVolume,
type
FROM google.baremetalsolution.snapshots
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND volumesId = '{{ volumesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot volume.
INSERT INTO google.baremetalsolution.snapshots (
data__name,
data__description,
projectsId,
locationsId,
volumesId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ volumesId }}'
RETURNING
id,
name,
createTime,
description,
storageVolume,
type
;
# 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: volumesId
value: string
description: Required parameter for the snapshots resource.
- name: name
value: string
description: >
The name of the snapshot.
- name: description
value: string
description: >
The description of the snapshot.
DELETE
examples
- delete
Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot volume.
DELETE FROM google.baremetalsolution.snapshots
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND volumesId = '{{ volumesId }}' --required
AND snapshotsId = '{{ snapshotsId }}' --required;
Lifecycle Methods
- restore_volume_snapshot
Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot volume.
EXEC google.baremetalsolution.snapshots.restore_volume_snapshot
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@volumesId='{{ volumesId }}' --required,
@snapshotsId='{{ snapshotsId }}' --required;