LabsOperations Class

LabsOperations operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
LabsOperations

Constructor

LabsOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

Name Description
models

Alias to model classes used in this operation group.

Methods

begin_claim_any_vm

Claim a random claimable virtual machine in the lab. This operation can take a while to complete.

begin_create_environment

Create virtual machines in a lab. This operation can take a while to complete.

begin_create_or_update

Create or replace an existing lab. This operation can take a while to complete.

begin_delete

Delete lab. This operation can take a while to complete.

begin_export_resource_usage

Exports the lab resource usage into a storage account This operation can take a while to complete.

begin_import_virtual_machine

Import a virtual machine into a different lab. This operation can take a while to complete.

generate_upload_uri

Generate a URI for uploading custom disk images to a Lab.

get

Get lab.

list_by_resource_group

List labs in a resource group.

list_by_subscription

List labs in a subscription.

list_vhds

List disk images available for custom image creation.

update

Allows modifying tags of labs. All other properties will be ignored.

begin_claim_any_vm

Claim a random claimable virtual machine in the lab. This operation can take a while to complete.

begin_claim_any_vm(resource_group_name: str, name: str, **kwargs: Any) -> LROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling

True for ARMPolling, False for no polling, or a polling object for personal polling strategy

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

Type Description

An instance of LROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_create_environment

Create virtual machines in a lab. This operation can take a while to complete.

begin_create_environment(resource_group_name: str, name: str, lab_virtual_machine_creation_parameter: '_models.LabVirtualMachineCreationParameter', **kwargs: Any) -> LROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

lab_virtual_machine_creation_parameter
Required

Properties for creating a virtual machine.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling

True for ARMPolling, False for no polling, or a polling object for personal polling strategy

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

Type Description

An instance of LROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_create_or_update

Create or replace an existing lab. This operation can take a while to complete.

begin_create_or_update(resource_group_name: str, name: str, lab: '_models.Lab', **kwargs: Any) -> LROPoller['_models.Lab']

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

lab
Required
Lab

A lab.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling

True for ARMPolling, False for no polling, or a polling object for personal polling strategy

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

Type Description

An instance of LROPoller that returns either Lab or the result of cls(response)

Exceptions

Type Description

begin_delete

Delete lab. This operation can take a while to complete.

begin_delete(resource_group_name: str, name: str, **kwargs: Any) -> LROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling

True for ARMPolling, False for no polling, or a polling object for personal polling strategy

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

Type Description

An instance of LROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_export_resource_usage

Exports the lab resource usage into a storage account This operation can take a while to complete.

begin_export_resource_usage(resource_group_name: str, name: str, blob_storage_absolute_sas_uri: str | None = None, usage_start_date: datetime.datetime | None = None, **kwargs: Any) -> LROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

blob_storage_absolute_sas_uri
str

The blob storage absolute sas uri with write permission to the container which the usage data needs to be uploaded to.

Default value: None
usage_start_date

The start time of the usage. If not provided, usage will be reported since the beginning of data collection.

Default value: None

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling

True for ARMPolling, False for no polling, or a polling object for personal polling strategy

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

Type Description

An instance of LROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

begin_import_virtual_machine

Import a virtual machine into a different lab. This operation can take a while to complete.

begin_import_virtual_machine(resource_group_name: str, name: str, source_virtual_machine_resource_id: str | None = None, destination_virtual_machine_name: str | None = None, **kwargs: Any) -> LROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

source_virtual_machine_resource_id
str

The full resource ID of the virtual machine to be imported.

Default value: None
destination_virtual_machine_name
str

The name of the virtual machine in the destination lab.

Default value: None

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling

True for ARMPolling, False for no polling, or a polling object for personal polling strategy

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

Type Description

An instance of LROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

generate_upload_uri

Generate a URI for uploading custom disk images to a Lab.

generate_upload_uri(resource_group_name: str, name: str, blob_name: str | None = None, **kwargs: Any) -> _models.GenerateUploadUriResponse

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

blob_name
str

The blob name of the upload URI.

Default value: None

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

GenerateUploadUriResponse, or the result of cls(response)

Exceptions

Type Description

get

Get lab.

get(resource_group_name: str, name: str, expand: str | None = None, **kwargs: Any) -> _models.Lab

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

expand
str

Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'.

Default value: None

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description
Lab

Lab, or the result of cls(response)

Exceptions

Type Description

list_by_resource_group

List labs in a resource group.

list_by_resource_group(resource_group_name: str, expand: str | None = None, filter: str | None = None, top: int | None = None, orderby: str | None = None, **kwargs: Any) -> Iterable['_models.LabList']

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

expand
str

Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'.

Default value: None
filter
str

The filter to apply to the operation. Example: '$filter=contains(name,'myName').

Default value: None
top
int

The maximum number of resources to return from the operation. Example: '$top=10'.

Default value: None
orderby
str

The ordering expression for the results, using OData notation. Example: '$orderby=name desc'.

Default value: None

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

An iterator like instance of either LabList or the result of cls(response)

Exceptions

Type Description

list_by_subscription

List labs in a subscription.

list_by_subscription(expand: str | None = None, filter: str | None = None, top: int | None = None, orderby: str | None = None, **kwargs: Any) -> Iterable['_models.LabList']

Parameters

Name Description
expand
str

Specify the $expand query. Example: 'properties($select=defaultStorageAccount)'.

Default value: None
filter
str

The filter to apply to the operation. Example: '$filter=contains(name,'myName').

Default value: None
top
int

The maximum number of resources to return from the operation. Example: '$top=10'.

Default value: None
orderby
str

The ordering expression for the results, using OData notation. Example: '$orderby=name desc'.

Default value: None

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

An iterator like instance of either LabList or the result of cls(response)

Exceptions

Type Description

list_vhds

List disk images available for custom image creation.

list_vhds(resource_group_name: str, name: str, **kwargs: Any) -> Iterable['_models.LabVhdList']

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

An iterator like instance of either LabVhdList or the result of cls(response)

Exceptions

Type Description

update

Allows modifying tags of labs. All other properties will be ignored.

update(resource_group_name: str, name: str, lab: '_models.LabFragment', **kwargs: Any) -> _models.Lab

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group.

name
Required
str

The name of the lab.

lab
Required

A lab.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description
Lab

Lab, or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.devtestlabs.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\devtestlabs\\models\\__init__.py'>