snapshots
Creates, updates, deletes, gets or lists a snapshots
resource.
Overview
Name | snapshots |
Type | Resource |
Id | azure.compute.snapshots |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_resource_group
- list
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
extendedLocation | object | The extended location where the snapshot will be created. Extended location cannot be changed. |
location | string | Resource location |
managedBy | string | Unused. Always Null. |
properties | object | Snapshot resource properties. |
sku | object | The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot |
tags | object | Resource tags |
type | string | Resource type |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
extendedLocation | object | The extended location where the snapshot will be created. Extended location cannot be changed. |
location | string | Resource location |
managedBy | string | Unused. Always Null. |
properties | object | Snapshot resource properties. |
sku | object | The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot |
tags | object | Resource tags |
type | string | Resource type |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
extendedLocation | object | The extended location where the snapshot will be created. Extended location cannot be changed. |
location | string | Resource location |
managedBy | string | Unused. Always Null. |
properties | object | Snapshot resource properties. |
sku | object | The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot |
tags | object | Resource tags |
type | string | Resource type |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , snapshotName | Gets information about a snapshot. | |
list_by_resource_group | select | subscriptionId , resourceGroupName | Lists snapshots under a resource group. | |
list | select | subscriptionId | Lists snapshots under a subscription. | |
create_or_update | insert | subscriptionId , resourceGroupName , snapshotName | Creates or updates a snapshot. | |
update | update | subscriptionId , resourceGroupName , snapshotName | Updates (patches) a snapshot. | |
delete | delete | subscriptionId , resourceGroupName , snapshotName | Deletes a snapshot. | |
grant_access | exec | subscriptionId , resourceGroupName , snapshotName , access , durationInSeconds | Grants access to a snapshot. | |
revoke_access | exec | subscriptionId , resourceGroupName , snapshotName | Revokes access to a snapshot. |
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 |
---|---|---|
resourceGroupName | string | The name of the resource group. |
snapshotName | string | The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 characters. |
subscriptionId | string | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
SELECT
examples
- get
- list_by_resource_group
- list
Gets information about a snapshot.
SELECT
id,
name,
extendedLocation,
location,
managedBy,
properties,
sku,
tags,
type
FROM azure.compute.snapshots
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND snapshotName = '{{ snapshotName }}' -- required
;
Lists snapshots under a resource group.
SELECT
id,
name,
extendedLocation,
location,
managedBy,
properties,
sku,
tags,
type
FROM azure.compute.snapshots
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
;
Lists snapshots under a subscription.
SELECT
id,
name,
extendedLocation,
location,
managedBy,
properties,
sku,
tags,
type
FROM azure.compute.snapshots
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
Creates or updates a snapshot.
INSERT INTO azure.compute.snapshots (
data__sku,
data__extendedLocation,
data__properties,
data__location,
data__tags,
subscriptionId,
resourceGroupName,
snapshotName
)
SELECT
'{{ sku }}',
'{{ extendedLocation }}',
'{{ properties }}',
'{{ location }}',
'{{ tags }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ snapshotName }}'
RETURNING
id,
name,
extendedLocation,
location,
managedBy,
properties,
sku,
tags,
type
;
# Description fields are for documentation purposes
- name: snapshots
props:
- name: subscriptionId
value: string
description: Required parameter for the snapshots resource.
- name: resourceGroupName
value: string
description: Required parameter for the snapshots resource.
- name: snapshotName
value: string
description: Required parameter for the snapshots resource.
- name: sku
value: object
description: |
The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot
- name: extendedLocation
value: object
description: |
The extended location where the snapshot will be created. Extended location cannot be changed.
- name: properties
value: object
description: |
Snapshot resource properties.
- name: location
value: string
description: |
Resource location
- name: tags
value: object
description: |
Resource tags
UPDATE
examples
- update
Updates (patches) a snapshot.
UPDATE azure.compute.snapshots
SET
data__properties = '{{ properties }}',
data__tags = '{{ tags }}',
data__sku = '{{ sku }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND snapshotName = '{{ snapshotName }}' --required
RETURNING
id,
name,
extendedLocation,
location,
managedBy,
properties,
sku,
tags,
type;
DELETE
examples
- delete
Deletes a snapshot.
DELETE FROM azure.compute.snapshots
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND snapshotName = '{{ snapshotName }}' --required
;
Lifecycle Methods
- grant_access
- revoke_access
Grants access to a snapshot.
EXEC azure.compute.snapshots.grant_access
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@snapshotName='{{ snapshotName }}' --required
@@json=
'{
"access": "{{ access }}",
"durationInSeconds": {{ durationInSeconds }},
"getSecureVMGuestStateSAS": {{ getSecureVMGuestStateSAS }},
"fileFormat": "{{ fileFormat }}"
}'
;
Revokes access to a snapshot.
EXEC azure.compute.snapshots.revoke_access
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@snapshotName='{{ snapshotName }}' --required
;