Skip to main content

disks

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

Overview

Namedisks
TypeResource
Idazure.dev_test_labs.disks

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
created_datetextfield from the properties object
disk_blob_nametextfield from the properties object
disk_size_gibtextfield from the properties object
disk_typetextfield from the properties object
disk_uritextfield from the properties object
host_cachingtextfield from the properties object
labNametextfield from the properties object
leased_by_lab_vm_idtextfield from the properties object
locationtextThe location of the resource.
managed_disk_idtextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
storage_account_idtextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
typetextThe type of the resource.
unique_identifiertextfield from the properties object
userNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, name, resourceGroupName, subscriptionId, userNameGet disk.
listSELECTlabName, resourceGroupName, subscriptionId, userNameList disks in a given user profile.
create_or_updateINSERTlabName, name, resourceGroupName, subscriptionId, userName, data__propertiesCreate or replace an existing disk. This operation can take a while to complete.
deleteDELETElabName, name, resourceGroupName, subscriptionId, userNameDelete disk. This operation can take a while to complete.
updateUPDATElabName, name, resourceGroupName, subscriptionId, userNameAllows modifying tags of disks. All other properties will be ignored.
attachEXEClabName, name, resourceGroupName, subscriptionId, userNameAttach and create the lease of the disk to the virtual machine. This operation can take a while to complete.
detachEXEClabName, name, resourceGroupName, subscriptionId, userNameDetach and break the lease of the disk attached to the virtual machine. This operation can take a while to complete.

SELECT examples

List disks in a given user profile.

SELECT
id,
name,
created_date,
disk_blob_name,
disk_size_gib,
disk_type,
disk_uri,
host_caching,
labName,
leased_by_lab_vm_id,
location,
managed_disk_id,
provisioning_state,
resourceGroupName,
storage_account_id,
subscriptionId,
tags,
type,
unique_identifier,
userName
FROM azure.dev_test_labs.vw_disks
WHERE labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND userName = '{{ userName }}';

INSERT example

Use the following StackQL query and manifest file to create a new disks resource.

/*+ create */
INSERT INTO azure.dev_test_labs.disks (
labName,
name,
resourceGroupName,
subscriptionId,
userName,
data__properties,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ userName }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a disks resource.

/*+ update */
UPDATE azure.dev_test_labs.disks
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND userName = '{{ userName }}';

DELETE example

Deletes the specified disks resource.

/*+ delete */
DELETE FROM azure.dev_test_labs.disks
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND userName = '{{ userName }}';