snapshots
Creates, updates, deletes, gets or lists a snapshots
resource.
Overview
Name | snapshots |
Type | Resource |
Id | azure.compute.snapshots |
Fields
- vw_snapshots
- snapshots
Name | Datatype | Description |
---|---|---|
id | text | Resource Id |
name | text | Resource name |
completion_percent | text | field from the properties object |
copy_completion_error | text | field from the properties object |
creation_data | text | field from the properties object |
data_access_auth_mode | text | field from the properties object |
disk_access_id | text | field from the properties object |
disk_size_bytes | text | field from the properties object |
disk_size_gb | text | field from the properties object |
disk_state | text | field from the properties object |
encryption | text | field from the properties object |
encryption_settings_collection | text | field from the properties object |
extended_location | text | field from the properties object |
hyper_v_generation | text | field from the properties object |
incremental | text | field from the properties object |
incremental_snapshot_family_id | text | field from the properties object |
location | text | Resource location |
managed_by | text | field from the properties object |
network_access_policy | text | field from the properties object |
os_type | text | field from the properties object |
provisioning_state | text | field from the properties object |
public_network_access | text | field from the properties object |
purchase_plan | text | field from the properties object |
resourceGroupName | text | field from the properties object |
security_profile | text | field from the properties object |
sku | text | 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 |
snapshotName | text | field from the properties object |
subscriptionId | text | field from the properties object |
supported_capabilities | text | field from the properties object |
supports_hibernation | text | field from the properties object |
tags | text | Resource tags |
time_created | text | field from the properties object |
type | text | Resource type |
unique_id | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
extendedLocation | object | The complex type of the extended location. |
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
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, snapshotName, subscriptionId | Gets information about a snapshot. |
list | SELECT | subscriptionId | Lists snapshots under a subscription. |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | Lists snapshots under a resource group. |
create_or_update | INSERT | resourceGroupName, snapshotName, subscriptionId | Creates or updates a snapshot. |
delete | DELETE | resourceGroupName, snapshotName, subscriptionId | Deletes a snapshot. |
update | UPDATE | resourceGroupName, snapshotName, subscriptionId | Updates (patches) a snapshot. |
grant_access | EXEC | resourceGroupName, snapshotName, subscriptionId, data__access, data__durationInSeconds | Grants access to a snapshot. |
revoke_access | EXEC | resourceGroupName, snapshotName, subscriptionId | Revokes access to a snapshot. |
SELECT
examples
Lists snapshots under a subscription.
- vw_snapshots
- snapshots
SELECT
id,
name,
completion_percent,
copy_completion_error,
creation_data,
data_access_auth_mode,
disk_access_id,
disk_size_bytes,
disk_size_gb,
disk_state,
encryption,
encryption_settings_collection,
extended_location,
hyper_v_generation,
incremental,
incremental_snapshot_family_id,
location,
managed_by,
network_access_policy,
os_type,
provisioning_state,
public_network_access,
purchase_plan,
resourceGroupName,
security_profile,
sku,
snapshotName,
subscriptionId,
supported_capabilities,
supports_hibernation,
tags,
time_created,
type,
unique_id
FROM azure.compute.vw_snapshots
WHERE subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
extendedLocation,
location,
managedBy,
properties,
sku,
tags,
type
FROM azure.compute.snapshots
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new snapshots
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.compute.snapshots (
resourceGroupName,
snapshotName,
subscriptionId,
sku,
extendedLocation,
properties,
location,
tags
)
SELECT
'{{ resourceGroupName }}',
'{{ snapshotName }}',
'{{ subscriptionId }}',
'{{ sku }}',
'{{ extendedLocation }}',
'{{ properties }}',
'{{ location }}',
'{{ tags }}'
;
- name: your_resource_model_name
props:
- name: managedBy
value: string
- name: sku
value:
- name: name
value: string
- name: tier
value: string
- name: extendedLocation
value:
- name: name
value: string
- name: type
value: []
- name: properties
value:
- name: timeCreated
value: string
- name: osType
value: string
- name: hyperVGeneration
value: string
- name: purchasePlan
value:
- name: name
value: string
- name: publisher
value: string
- name: product
value: string
- name: promotionCode
value: string
- name: supportedCapabilities
value:
- name: diskControllerTypes
value: string
- name: acceleratedNetwork
value: boolean
- name: architecture
value: string
- name: creationData
value:
- name: createOption
value: string
- name: storageAccountId
value: string
- name: imageReference
value:
- name: id
value: string
- name: sharedGalleryImageId
value: string
- name: communityGalleryImageId
value: string
- name: lun
value: integer
- name: sourceUri
value: string
- name: sourceResourceId
value: string
- name: sourceUniqueId
value: string
- name: uploadSizeBytes
value: integer
- name: logicalSectorSize
value: integer
- name: securityDataUri
value: string
- name: performancePlus
value: boolean
- name: elasticSanResourceId
value: string
- name: provisionedBandwidthCopySpeed
value: string
- name: diskSizeGB
value: integer
- name: diskSizeBytes
value: integer
- name: diskState
value: []
- name: uniqueId
value: string
- name: encryptionSettingsCollection
value:
- name: enabled
value: boolean
- name: encryptionSettings
value:
- - name: diskEncryptionKey
value:
- name: sourceVault
value:
- name: id
value: string
- name: secretUrl
value: string
- name: keyEncryptionKey
value:
- name: keyUrl
value: string
- name: encryptionSettingsVersion
value: string
- name: provisioningState
value: string
- name: incremental
value: boolean
- name: incrementalSnapshotFamilyId
value: string
- name: encryption
value:
- name: diskEncryptionSetId
value: string
- name: type
value: []
- name: networkAccessPolicy
value: []
- name: diskAccessId
value: string
- name: securityProfile
value:
- name: securityType
value: []
- name: secureVMDiskEncryptionSetId
value: string
- name: supportsHibernation
value: boolean
- name: publicNetworkAccess
value: []
- name: completionPercent
value: number
- name: copyCompletionError
value:
- name: errorCode
value: string
- name: errorMessage
value: string
- name: dataAccessAuthMode
value: []
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
UPDATE
example
Updates a snapshots
resource.
/*+ update */
UPDATE azure.compute.snapshots
SET
properties = '{{ properties }}',
tags = '{{ tags }}',
sku = '{{ sku }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND snapshotName = '{{ snapshotName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified snapshots
resource.
/*+ delete */
DELETE FROM azure.compute.snapshots
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND snapshotName = '{{ snapshotName }}'
AND subscriptionId = '{{ subscriptionId }}';