formulas
Creates, updates, deletes, gets or lists a formulas resource.
Overview
| Name | formulas |
| Type | Resource |
| Id | azure.dev_test_labs.formulas |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
author | string | The author of the formula. |
creationDate | string (date-time) | The creation date of the formula. |
description | string | The description of the formula. |
formulaContent | object | The content of the formula. |
location | string | The location of the resource. |
osType | string | The OS type of the formula. |
provisioningState | string | The provisioning status of the resource. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
vm | object | Information about a VM from which a formula is to be created. |
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
author | string | The author of the formula. |
creationDate | string (date-time) | The creation date of the formula. |
description | string | The description of the formula. |
formulaContent | object | The content of the formula. |
location | string | The location of the resource. |
osType | string | The OS type of the formula. |
provisioningState | string | The provisioning status of the resource. |
tags | object | The tags of the resource. |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
vm | object | Information about a VM from which a formula is to be created. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, lab_name, name, subscription_id | $expand | Get formula. |
list | select | resource_group_name, lab_name, subscription_id | $expand, $filter, $top, $orderby | List formulas in a given lab. |
create_or_update | insert | resource_group_name, lab_name, name, subscription_id | Create or replace an existing formula. This operation can take a while to complete. | |
update | update | resource_group_name, lab_name, name, subscription_id | Allows modifying tags of formulas. All other properties will be ignored. | |
create_or_update | replace | resource_group_name, lab_name, name, subscription_id | Create or replace an existing formula. This operation can take a while to complete. | |
delete | delete | resource_group_name, lab_name, name, subscription_id | Delete formula. |
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 |
|---|---|---|
lab_name | string | The name of the lab. Required. |
name | string | The name of the formula. Required. |
resource_group_name | string | The name of the resource group. Required. |
subscription_id | string | |
$expand | string | Specify the $expand query. Example: 'properties($select=description)'. Default value is None. |
$filter | string | The filter to apply to the operation. Example: '$filter=contains(name,'myName'). Default value is None. |
$orderby | string | The ordering expression for the results, using OData notation. Example: '$orderby=name desc'. Default value is None. |
$top | integer | The maximum number of resources to return from the operation. Example: '$top=10'. Default value is None. |
SELECT examples
- get
- list
Get formula.
SELECT
id,
name,
author,
creationDate,
description,
formulaContent,
location,
osType,
provisioningState,
tags,
type,
uniqueIdentifier,
vm
FROM azure.dev_test_labs.formulas
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
List formulas in a given lab.
SELECT
id,
name,
author,
creationDate,
description,
formulaContent,
location,
osType,
provisioningState,
tags,
type,
uniqueIdentifier,
vm
FROM azure.dev_test_labs.formulas
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $orderby = '{{ $orderby }}'
;
INSERT examples
- create_or_update
- Manifest
Create or replace an existing formula. This operation can take a while to complete.
INSERT INTO azure.dev_test_labs.formulas (
location,
tags,
properties,
resource_group_name,
lab_name,
name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ lab_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: formulas
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the formulas resource.
- name: lab_name
value: "{{ lab_name }}"
description: Required parameter for the formulas resource.
- name: name
value: "{{ name }}"
description: Required parameter for the formulas resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the formulas resource.
- name: location
value: "{{ location }}"
description: |
The location of the resource.
- name: tags
value: "{{ tags }}"
description: |
The tags of the resource.
- name: properties
value:
description: "{{ description }}"
osType: "{{ osType }}"
formulaContent:
name: "{{ name }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
bulkCreationParameters:
instanceCount: {{ instanceCount }}
notes: "{{ notes }}"
ownerObjectId: "{{ ownerObjectId }}"
ownerUserPrincipalName: "{{ ownerUserPrincipalName }}"
createdDate: "{{ createdDate }}"
customImageId: "{{ customImageId }}"
size: "{{ size }}"
userName: "{{ userName }}"
password: "{{ password }}"
sshKey: "{{ sshKey }}"
isAuthenticationWithSshKey: {{ isAuthenticationWithSshKey }}
labSubnetName: "{{ labSubnetName }}"
labVirtualNetworkId: "{{ labVirtualNetworkId }}"
disallowPublicIpAddress: {{ disallowPublicIpAddress }}
artifacts:
- artifactId: "{{ artifactId }}"
artifactTitle: "{{ artifactTitle }}"
parameters: "{{ parameters }}"
status: "{{ status }}"
deploymentStatusMessage: "{{ deploymentStatusMessage }}"
vmExtensionStatusMessage: "{{ vmExtensionStatusMessage }}"
installTime: "{{ installTime }}"
galleryImageReference:
offer: "{{ offer }}"
publisher: "{{ publisher }}"
sku: "{{ sku }}"
osType: "{{ osType }}"
version: "{{ version }}"
planId: "{{ planId }}"
networkInterface:
virtualNetworkId: "{{ virtualNetworkId }}"
subnetId: "{{ subnetId }}"
publicIpAddressId: "{{ publicIpAddressId }}"
publicIpAddress: "{{ publicIpAddress }}"
privateIpAddress: "{{ privateIpAddress }}"
dnsName: "{{ dnsName }}"
rdpAuthority: "{{ rdpAuthority }}"
sshAuthority: "{{ sshAuthority }}"
sharedPublicIpAddressConfiguration:
inboundNatRules: "{{ inboundNatRules }}"
expirationDate: "{{ expirationDate }}"
allowClaim: {{ allowClaim }}
storageType: "{{ storageType }}"
environmentId: "{{ environmentId }}"
dataDiskParameters:
- attachNewDataDiskOptions:
diskSizeGiB: {{ diskSizeGiB }}
diskName: "{{ diskName }}"
diskType: "{{ diskType }}"
existingLabDiskId: "{{ existingLabDiskId }}"
hostCaching: "{{ hostCaching }}"
scheduleParameters:
- name: "{{ name }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
status: "{{ status }}"
taskType: "{{ taskType }}"
weeklyRecurrence: "{{ weeklyRecurrence }}"
dailyRecurrence: "{{ dailyRecurrence }}"
hourlyRecurrence: "{{ hourlyRecurrence }}"
timeZoneId: "{{ timeZoneId }}"
notificationSettings: "{{ notificationSettings }}"
targetResourceId: "{{ targetResourceId }}"
vm:
labVmId: "{{ labVmId }}"
UPDATE examples
- update
Allows modifying tags of formulas. All other properties will be ignored.
UPDATE azure.dev_test_labs.formulas
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;
REPLACE examples
- create_or_update
Create or replace an existing formula. This operation can take a while to complete.
REPLACE azure.dev_test_labs.formulas
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;
DELETE examples
- delete
Delete formula.
DELETE FROM azure.dev_test_labs.formulas
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;