Skip to main content

snapshots

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

Overview

Namesnapshots
TypeResource
Idazure.netapp.snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
createdstring (date-time)The creation date of the snapshot.
locationstringResource location. Required.
provisioningStatestringAzure lifecycle management.
snapshotIdstringUUID v4 used to identify the Snapshot.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, account_name, pool_name, volume_name, snapshot_name, subscription_idGet details of the specified snapshot.
listselectresource_group_name, account_name, pool_name, volume_name, subscription_idList all snapshots associated with the volume.
createinsertresource_group_name, account_name, pool_name, volume_name, snapshot_name, subscription_id, locationCreate the specified snapshot within the given volume.
updateupdateresource_group_name, account_name, pool_name, volume_name, snapshot_name, subscription_idPatch a snapshot.
deletedeleteresource_group_name, account_name, pool_name, volume_name, snapshot_name, subscription_idDelete snapshot.
restore_filesexecresource_group_name, account_name, pool_name, volume_name, snapshot_name, subscription_id, filePathsRestore the specified files from the specified snapshot to the active filesystem.

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
account_namestringThe name of the NetApp account. Required.
pool_namestringThe name of the capacity pool. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
snapshot_namestringThe name of the snapshot. Required.
subscription_idstring
volume_namestringThe name of the volume. Required.

SELECT examples

Get details of the specified snapshot.

SELECT
id,
name,
created,
location,
provisioningState,
snapshotId,
systemData,
type
FROM azure.netapp.snapshots
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND pool_name = '{{ pool_name }}' -- required
AND volume_name = '{{ volume_name }}' -- required
AND snapshot_name = '{{ snapshot_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create the specified snapshot within the given volume.

INSERT INTO azure.netapp.snapshots (
properties,
location,
resource_group_name,
account_name,
pool_name,
volume_name,
snapshot_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ location }}' /* required */,
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ pool_name }}',
'{{ volume_name }}',
'{{ snapshot_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
type
;

UPDATE examples

Patch a snapshot.

UPDATE azure.netapp.snapshots
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND pool_name = '{{ pool_name }}' --required
AND volume_name = '{{ volume_name }}' --required
AND snapshot_name = '{{ snapshot_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
type;

DELETE examples

Delete snapshot.

DELETE FROM azure.netapp.snapshots
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND pool_name = '{{ pool_name }}' --required
AND volume_name = '{{ volume_name }}' --required
AND snapshot_name = '{{ snapshot_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Restore the specified files from the specified snapshot to the active filesystem.

EXEC azure.netapp.snapshots.restore_files 
@resource_group_name='{{ resource_group_name }}' --required,
@account_name='{{ account_name }}' --required,
@pool_name='{{ pool_name }}' --required,
@volume_name='{{ volume_name }}' --required,
@snapshot_name='{{ snapshot_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"filePaths": "{{ filePaths }}",
"destinationPath": "{{ destinationPath }}"
}'
;