disks
Creates, updates, deletes, gets or lists a disks
resource.
Overview
Name | disks |
Type | Resource |
Id | azure.dev_test_labs.disks |
Fields
- vw_disks
- disks
Name | Datatype | Description |
---|---|---|
id | text | The identifier of the resource. |
name | text | The name of the resource. |
created_date | text | field from the properties object |
disk_blob_name | text | field from the properties object |
disk_size_gib | text | field from the properties object |
disk_type | text | field from the properties object |
disk_uri | text | field from the properties object |
host_caching | text | field from the properties object |
labName | text | field from the properties object |
leased_by_lab_vm_id | text | field from the properties object |
location | text | The location of the resource. |
managed_disk_id | text | field from the properties object |
provisioning_state | text | field from the properties object |
resourceGroupName | text | field from the properties object |
storage_account_id | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | The tags of the resource. |
type | text | The type of the resource. |
unique_identifier | text | field from the properties object |
userName | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
location | string | The location of the resource. |
properties | object | Properties of a disk. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | labName, name, resourceGroupName, subscriptionId, userName | Get disk. |
list | SELECT | labName, resourceGroupName, subscriptionId, userName | List disks in a given user profile. |
create_or_update | INSERT | labName, name, resourceGroupName, subscriptionId, userName, data__properties | Create or replace an existing disk. This operation can take a while to complete. |
delete | DELETE | labName, name, resourceGroupName, subscriptionId, userName | Delete disk. This operation can take a while to complete. |
update | UPDATE | labName, name, resourceGroupName, subscriptionId, userName | Allows modifying tags of disks. All other properties will be ignored. |
attach | EXEC | labName, name, resourceGroupName, subscriptionId, userName | Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete. |
detach | EXEC | labName, name, resourceGroupName, subscriptionId, userName | Detach 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.
- vw_disks
- disks
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 }}';
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
- name: properties
value:
- name: diskType
value: string
- name: diskSizeGiB
value: integer
- name: leasedByLabVmId
value: string
- name: diskBlobName
value: string
- name: diskUri
value: string
- name: storageAccountId
value: string
- name: createdDate
value: string
- name: hostCaching
value: string
- name: managedDiskId
value: string
- name: provisioningState
value: string
- name: uniqueIdentifier
value: string
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 }}';