labs
Creates, updates, deletes, gets or lists a labs
resource.
Overview
Name | labs |
Type | Resource |
Id | azure.dev_test_labs.labs |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_resource_group
- list_by_subscription
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 | The properties of the resource. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
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 | The properties of the resource. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
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 | The properties of the resource. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , name | $expand , api-version | Get lab. |
list_by_resource_group | select | subscriptionId , resourceGroupName | $expand , $filter , $top , $orderby , api-version | List labs in a resource group. |
list_by_subscription | select | subscriptionId | $expand , $filter , $top , $orderby , api-version | List labs in a subscription. |
create_or_update | insert | subscriptionId , resourceGroupName , name | api-version | Create or replace an existing lab. This operation can take a while to complete. |
update | update | subscriptionId , resourceGroupName , name | api-version | Allows modifying tags of labs. All other properties will be ignored. |
delete | delete | subscriptionId , resourceGroupName , name | api-version | Delete lab. This operation can take a while to complete. |
claim_any_vm | exec | subscriptionId , resourceGroupName , name | api-version | Claim a random claimable virtual machine in the lab. This operation can take a while to complete. |
export_resource_usage | exec | subscriptionId , resourceGroupName , name | api-version | Exports the lab resource usage into a storage account This operation can take a while to complete. |
generate_upload_uri | exec | subscriptionId , resourceGroupName , name | api-version | Generate a URI for uploading custom disk images to a Lab. |
import_virtual_machine | exec | subscriptionId , resourceGroupName , name | api-version | Import a virtual machine into a different lab. This operation can take a while to complete. |
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 |
---|---|---|
name | string | The name of the lab. |
resourceGroupName | string | The name of the resource group. |
subscriptionId | string | The subscription ID. |
$expand | string | Specify the $expand query. Example: 'properties($select=defaultStorageAccount)' |
$filter | string | The filter to apply to the operation. Example: '$filter=contains(name,'myName') |
$orderby | string | The ordering expression for the results, using OData notation. Example: '$orderby=name desc' |
$top | integer (int32) | The maximum number of resources to return from the operation. Example: '$top=10' |
api-version | string | Client API version. |
SELECT
examples
- get
- list_by_resource_group
- list_by_subscription
Get lab.
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.labs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND name = '{{ name }}' -- required
AND $expand = '{{ $expand }}'
AND api-version = '{{ api-version }}'
;
List labs in a resource group.
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.labs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $orderby = '{{ $orderby }}'
AND api-version = '{{ api-version }}'
;
List labs in a subscription.
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.dev_test_labs.labs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $orderby = '{{ $orderby }}'
AND api-version = '{{ api-version }}'
;
INSERT
examples
- create_or_update
- Manifest
Create or replace an existing lab. This operation can take a while to complete.
INSERT INTO azure.dev_test_labs.labs (
data__location,
data__tags,
data__properties,
subscriptionId,
resourceGroupName,
name,
api-version
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ name }}',
'{{ api-version }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: labs
props:
- name: subscriptionId
value: string
description: Required parameter for the labs resource.
- name: resourceGroupName
value: string
description: Required parameter for the labs resource.
- name: name
value: string
description: Required parameter for the labs resource.
- name: location
value: string
description: |
The location of the resource.
- name: tags
value: object
description: |
The tags of the resource.
- name: properties
value: object
description: |
The properties of the resource.
- name: api-version
value: string
description: Client API version.
UPDATE
examples
- update
Allows modifying tags of labs. All other properties will be ignored.
UPDATE azure.dev_test_labs.labs
SET
data__tags = '{{ tags }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND name = '{{ name }}' --required
AND api-version = '{{ api-version}}'
RETURNING
id,
name,
location,
properties,
tags,
type;
DELETE
examples
- delete
Delete lab. This operation can take a while to complete.
DELETE FROM azure.dev_test_labs.labs
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND name = '{{ name }}' --required
AND api-version = '{{ api-version }}'
;
Lifecycle Methods
- claim_any_vm
- export_resource_usage
- generate_upload_uri
- import_virtual_machine
Claim a random claimable virtual machine in the lab. This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.claim_any_vm
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@name='{{ name }}' --required,
@api-version='{{ api-version }}'
;
Exports the lab resource usage into a storage account This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.export_resource_usage
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@name='{{ name }}' --required,
@api-version='{{ api-version }}'
@@json=
'{
"blobStorageAbsoluteSasUri": "{{ blobStorageAbsoluteSasUri }}",
"usageStartDate": "{{ usageStartDate }}"
}'
;
Generate a URI for uploading custom disk images to a Lab.
EXEC azure.dev_test_labs.labs.generate_upload_uri
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@name='{{ name }}' --required,
@api-version='{{ api-version }}'
@@json=
'{
"blobName": "{{ blobName }}"
}'
;
Import a virtual machine into a different lab. This operation can take a while to complete.
EXEC azure.dev_test_labs.labs.import_virtual_machine
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@name='{{ name }}' --required,
@api-version='{{ api-version }}'
@@json=
'{
"sourceVirtualMachineResourceId": "{{ sourceVirtualMachineResourceId }}",
"destinationVirtualMachineName": "{{ destinationVirtualMachineName }}"
}'
;