Skip to main content

labs

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

Overview

Namelabs
TypeResource
Idazure_extras.education.labs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
budgetPerStudentobjectDefault monetary cap for each student in this lab. Required.
descriptionstringDetail description of this lab. Required.
displayNamestringLab Display Name. Required.
effectiveDatestring (date-time)Lab creation date.
expirationDatestring (date-time)Default expiration date for each student in this lab. Required.
invitationCodestringinvitation code for redeemable lab.
maxStudentCountnumberthe total number of students that can be accepted to the lab.
statusstringThe status of this lab. Known values are: "Active", "Deleted", and "Pending". (Active, Deleted, Pending)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
totalAllocatedBudgetobjectTotal allocated budget.
totalBudgetobjectTotal budget.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbilling_account_name, billing_profile_name, invoice_section_nameincludeBudgetGet the details for a specific lab associated with the provided billing account name, billing profile name, and invoice section name.
list_allselectbilling_account_name, billing_profile_nameincludeBudget, includeDeletedGet a list of labs associated with the provided billing account name and billing profile name.
create_or_updateinsertbilling_account_name, billing_profile_name, invoice_section_nameCreate a new lab or update a previously created lab.
create_or_updatereplacebilling_account_name, billing_profile_name, invoice_section_nameCreate a new lab or update a previously created lab.
deletedeletebilling_account_name, billing_profile_name, invoice_section_nameDelete a specific lab associated with the provided billing account name, billing profile name, and invoice section name. Note all students must be removed from the lab in order to delete the lab.
generate_invite_codeexecbilling_account_name, billing_profile_name, invoice_section_nameonlyUpdateStudentCountParameterGenerate invite code for a lab.
list_rawexecbilling_account_name, billing_profile_name, invoice_section_nameincludeBudgetGet the details for a specific lab associated with the provided billing account name, billing profile name, and invoice section name.

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.

NameDatatypeDescription
billing_account_namestringThe name of the billing account. Required.
billing_profile_namestringThe name of the billing profile. Required.
invoice_section_namestringThe name of the invoice section. Required.
includeBudgetbooleanMay be used to include budget information. Default value is None.
includeDeletedbooleanMay be used to show deleted items. Default value is None.
onlyUpdateStudentCountParameterbooleanset this flag to true if you want to update student count without generating a new invite code. Default value is None.

SELECT examples

Get the details for a specific lab associated with the provided billing account name, billing profile name, and invoice section name.

SELECT
id,
name,
budgetPerStudent,
description,
displayName,
effectiveDate,
expirationDate,
invitationCode,
maxStudentCount,
status,
systemData,
totalAllocatedBudget,
totalBudget,
type
FROM azure_extras.education.labs
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND billing_profile_name = '{{ billing_profile_name }}' -- required
AND invoice_section_name = '{{ invoice_section_name }}' -- required
AND includeBudget = '{{ includeBudget }}'
;

INSERT examples

Create a new lab or update a previously created lab.

INSERT INTO azure_extras.education.labs (
properties,
billing_account_name,
billing_profile_name,
invoice_section_name
)
SELECT
'{{ properties }}',
'{{ billing_account_name }}',
'{{ billing_profile_name }}',
'{{ invoice_section_name }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Create a new lab or update a previously created lab.

REPLACE azure_extras.education.labs
SET
properties = '{{ properties }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
AND invoice_section_name = '{{ invoice_section_name }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a specific lab associated with the provided billing account name, billing profile name, and invoice section name. Note all students must be removed from the lab in order to delete the lab.

DELETE FROM azure_extras.education.labs
WHERE billing_account_name = '{{ billing_account_name }}' --required
AND billing_profile_name = '{{ billing_profile_name }}' --required
AND invoice_section_name = '{{ invoice_section_name }}' --required
;

Lifecycle Methods

Generate invite code for a lab.

EXEC azure_extras.education.labs.generate_invite_code 
@billing_account_name='{{ billing_account_name }}' --required,
@billing_profile_name='{{ billing_profile_name }}' --required,
@invoice_section_name='{{ invoice_section_name }}' --required,
@onlyUpdateStudentCountParameter={{ onlyUpdateStudentCountParameter }}
@@json=
'{
"maxStudentCount": {{ maxStudentCount }}
}'
;