disks_snapshot
Creates, updates, deletes, gets or lists a disks_snapshot resource.
Overview
| Name | disks_snapshot |
| Type | Resource |
| Id | google.compute.disks_snapshot |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
create_snapshot | insert | project, zone, disk | guestFlush, requestId | Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. |
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 |
|---|---|---|
disk | string | |
project | string | |
zone | string | |
guestFlush | boolean | |
requestId | string |
INSERT examples
- create_snapshot
- Manifest
Creates a snapshot of a specified persistent disk. For regular snapshot
creation, consider using snapshots.insert
instead, as that method supports more features, such as creating snapshots
in a project different from the source disk project.
INSERT INTO google.compute.disks_snapshot (
data__labelFingerprint,
data__params,
data__guestFlush,
data__sourceDiskForRecoveryCheckpoint,
data__labels,
data__locationHint,
data__sourceDisk,
data__chainName,
data__sourceDiskEncryptionKey,
data__snapshotEncryptionKey,
data__name,
data__snapshotType,
data__sourceInstantSnapshot,
data__description,
data__sourceInstantSnapshotEncryptionKey,
data__storageLocations,
project,
zone,
disk,
guestFlush,
requestId
)
SELECT
'{{ labelFingerprint }}',
'{{ params }}',
{{ guestFlush }},
'{{ sourceDiskForRecoveryCheckpoint }}',
'{{ labels }}',
'{{ locationHint }}',
'{{ sourceDisk }}',
'{{ chainName }}',
'{{ sourceDiskEncryptionKey }}',
'{{ snapshotEncryptionKey }}',
'{{ name }}',
'{{ snapshotType }}',
'{{ sourceInstantSnapshot }}',
'{{ description }}',
'{{ sourceInstantSnapshotEncryptionKey }}',
'{{ storageLocations }}',
'{{ project }}',
'{{ zone }}',
'{{ disk }}',
'{{ guestFlush }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: disks_snapshot
props:
- name: project
value: "{{ project }}"
description: Required parameter for the disks_snapshot resource.
- name: zone
value: "{{ zone }}"
description: Required parameter for the disks_snapshot resource.
- name: disk
value: "{{ disk }}"
description: Required parameter for the disks_snapshot resource.
- name: labelFingerprint
value: "{{ labelFingerprint }}"
description: |
A fingerprint for the labels being applied to this snapshot, which is
essentially a hash of the labels set used for optimistic locking. The
fingerprint is initially generated by Compute Engine and changes after
every request to modify or update labels. You must always provide an
up-to-date fingerprint hash in order to update or change labels,
otherwise the request will fail with error412 conditionNotMet.
To see the latest fingerprint, make a get() request to
retrieve a snapshot.
- name: params
description: |
Input only. [Input Only] Additional params passed with the request, but not persisted
as part of resource payload.
value:
resourceManagerTags: "{{ resourceManagerTags }}"
- name: guestFlush
value: {{ guestFlush }}
description: |
[Input Only] Whether to attempt an application consistent snapshot by
informing the OS to prepare for the snapshot process.
- name: sourceDiskForRecoveryCheckpoint
value: "{{ sourceDiskForRecoveryCheckpoint }}"
description: |
The source disk whose recovery checkpoint will be used to create this
snapshot.
- name: labels
value: "{{ labels }}"
description: |
Labels to apply to this snapshot. These can be later modified by
the setLabels method.
Label values may be empty.
- name: locationHint
value: "{{ locationHint }}"
description: |
An opaque location hint used to place the snapshot close to other
resources.
This field is for use by internal tools that use the public API.
- name: sourceDisk
value: "{{ sourceDisk }}"
description: |
The source disk used to create this snapshot.
- name: chainName
value: "{{ chainName }}"
description: |
Creates the new snapshot in the snapshot chain labeled with the
specified name. The chain name must be 1-63 characters long and comply
with RFC1035. This is an uncommon option only for advanced service
owners who needs to create separate snapshot chains, for example,
for chargeback tracking. When you describe your snapshot resource, this
field is visible only if it has a non-empty value.
- name: sourceDiskEncryptionKey
description: |
The customer-supplied
encryption key of the source disk. Required if the source disk is
protected by a customer-supplied encryption key.
value:
rawKey: "{{ rawKey }}"
kmsKeyServiceAccount: "{{ kmsKeyServiceAccount }}"
rsaEncryptedKey: "{{ rsaEncryptedKey }}"
kmsKeyName: "{{ kmsKeyName }}"
sha256: "{{ sha256 }}"
- name: snapshotEncryptionKey
description: |
Encrypts the snapshot using acustomer-supplied
encryption key.
After you encrypt a snapshot using a customer-supplied key, you must
provide the same key if you use the snapshot later. For example, you must
provide the encryption key when you create a disk from the encrypted
snapshot in a future request.
Customer-supplied encryption keys do not protect access to metadata
of the snapshot.
If you do not provide an encryption key when creating the snapshot, then
the snapshot will be encrypted using an automatically generated key and you
do not need to provide a key to use the snapshot later.
value:
rawKey: "{{ rawKey }}"
kmsKeyServiceAccount: "{{ kmsKeyServiceAccount }}"
rsaEncryptedKey: "{{ rsaEncryptedKey }}"
kmsKeyName: "{{ kmsKeyName }}"
sha256: "{{ sha256 }}"
- name: name
value: "{{ name }}"
description: |
Name of the resource; provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
character must be a lowercase letter, and all following characters must be
a dash, lowercase letter, or digit, except the last character, which cannot
be a dash.
- name: snapshotType
value: "{{ snapshotType }}"
description: |
Indicates the type of the snapshot.
valid_values: ['ARCHIVE', 'STANDARD']
- name: sourceInstantSnapshot
value: "{{ sourceInstantSnapshot }}"
description: |
The source instant snapshot used to create this snapshot. You can provide
this as a partial or full URL to the resource. For example, the following
are valid values:
- https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
- projects/project/zones/zone/instantSnapshots/instantSnapshot
- zones/zone/instantSnapshots/instantSnapshot
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: sourceInstantSnapshotEncryptionKey
description: |
Customer provided encryption key when creating Snapshot from Instant
Snapshot.
value:
rawKey: "{{ rawKey }}"
kmsKeyServiceAccount: "{{ kmsKeyServiceAccount }}"
rsaEncryptedKey: "{{ rsaEncryptedKey }}"
kmsKeyName: "{{ kmsKeyName }}"
sha256: "{{ sha256 }}"
- name: storageLocations
value:
- "{{ storageLocations }}"
description: |
Cloud Storage bucket storage location of the snapshot (regional or
multi-regional).
- name: guestFlush
value: {{ guestFlush }}
- name: requestId
value: "{{ requestId }}"