virtual_machine_schedules
Creates, updates, deletes, gets or lists a virtual_machine_schedules resource.
Overview
| Name | virtual_machine_schedules |
| Type | Resource |
| Id | azure.dev_test_labs.virtual_machine_schedules |
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. |
createdDate | string (date-time) | The creation date of the schedule. |
dailyRecurrence | object | If the schedule will occur once each day of the week, specify the daily recurrence. |
hourlyRecurrence | object | If the schedule will occur multiple times a day, specify the hourly recurrence. |
location | string | The location of the resource. |
notificationSettings | object | Notification settings. |
provisioningState | string | The provisioning status of the resource. |
status | string | The status of the schedule (i.e. Enabled, Disabled). Known values are: "Enabled" and "Disabled". |
tags | object | The tags of the resource. |
targetResourceId | string | The resource ID to which the schedule belongs. |
taskType | string | The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). |
timeZoneId | string | The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in IReadOnlyCollection TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
weeklyRecurrence | object | If the schedule will occur only some days of the week, specify the weekly recurrence. |
| Name | Datatype | Description |
|---|---|---|
id | string | The identifier of the resource. |
name | string | The name of the resource. |
createdDate | string (date-time) | The creation date of the schedule. |
dailyRecurrence | object | If the schedule will occur once each day of the week, specify the daily recurrence. |
hourlyRecurrence | object | If the schedule will occur multiple times a day, specify the hourly recurrence. |
location | string | The location of the resource. |
notificationSettings | object | Notification settings. |
provisioningState | string | The provisioning status of the resource. |
status | string | The status of the schedule (i.e. Enabled, Disabled). Known values are: "Enabled" and "Disabled". |
tags | object | The tags of the resource. |
targetResourceId | string | The resource ID to which the schedule belongs. |
taskType | string | The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). |
timeZoneId | string | The time zone ID (e.g. China Standard Time, Greenland Standard Time, Pacific Standard time, etc.). The possible values for this property can be found in IReadOnlyCollection TimeZoneConverter.TZConvert.KnownWindowsTimeZoneIds (https://github.com/mattjohnsonpint/TimeZoneConverter/blob/main/README.md). |
type | string | The type of the resource. |
uniqueIdentifier | string | The unique immutable identifier of a resource (Guid). |
weeklyRecurrence | object | If the schedule will occur only some days of the week, specify the weekly recurrence. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, lab_name, virtual_machine_name, name, subscription_id | $expand | Get schedule. |
list | select | resource_group_name, lab_name, virtual_machine_name, subscription_id | $expand, $filter, $top, $orderby | List schedules in a given virtual machine. |
create_or_update | insert | resource_group_name, lab_name, virtual_machine_name, name, subscription_id | Create or replace an existing schedule. | |
update | update | resource_group_name, lab_name, virtual_machine_name, name, subscription_id | Allows modifying tags of schedules. All other properties will be ignored. | |
create_or_update | replace | resource_group_name, lab_name, virtual_machine_name, name, subscription_id | Create or replace an existing schedule. | |
delete | delete | resource_group_name, lab_name, virtual_machine_name, name, subscription_id | Delete schedule. | |
execute | exec | resource_group_name, lab_name, virtual_machine_name, name, subscription_id | Execute a schedule. 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 |
|---|---|---|
lab_name | string | The name of the lab. Required. |
name | string | The name of the schedule. Required. |
resource_group_name | string | The name of the resource group. Required. |
subscription_id | string | |
virtual_machine_name | string | The name of the virtual machine. Required. |
$expand | string | Specify the $expand query. Example: 'properties($select=status)'. 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 schedule.
SELECT
id,
name,
createdDate,
dailyRecurrence,
hourlyRecurrence,
location,
notificationSettings,
provisioningState,
status,
tags,
targetResourceId,
taskType,
timeZoneId,
type,
uniqueIdentifier,
weeklyRecurrence
FROM azure.dev_test_labs.virtual_machine_schedules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND virtual_machine_name = '{{ virtual_machine_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
List schedules in a given virtual machine.
SELECT
id,
name,
createdDate,
dailyRecurrence,
hourlyRecurrence,
location,
notificationSettings,
provisioningState,
status,
tags,
targetResourceId,
taskType,
timeZoneId,
type,
uniqueIdentifier,
weeklyRecurrence
FROM azure.dev_test_labs.virtual_machine_schedules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND lab_name = '{{ lab_name }}' -- required
AND virtual_machine_name = '{{ virtual_machine_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 schedule.
INSERT INTO azure.dev_test_labs.virtual_machine_schedules (
location,
tags,
properties,
resource_group_name,
lab_name,
virtual_machine_name,
name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ lab_name }}',
'{{ virtual_machine_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;
# Description fields are for documentation purposes
- name: virtual_machine_schedules
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the virtual_machine_schedules resource.
- name: lab_name
value: "{{ lab_name }}"
description: Required parameter for the virtual_machine_schedules resource.
- name: virtual_machine_name
value: "{{ virtual_machine_name }}"
description: Required parameter for the virtual_machine_schedules resource.
- name: name
value: "{{ name }}"
description: Required parameter for the virtual_machine_schedules resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the virtual_machine_schedules resource.
- name: location
value: "{{ location }}"
description: |
The location of the resource.
- name: tags
value: "{{ tags }}"
description: |
The tags of the resource.
- name: properties
value:
status: "{{ status }}"
taskType: "{{ taskType }}"
weeklyRecurrence:
weekdays:
- "{{ weekdays }}"
time: "{{ time }}"
dailyRecurrence:
time: "{{ time }}"
hourlyRecurrence:
minute: {{ minute }}
timeZoneId: "{{ timeZoneId }}"
notificationSettings:
status: "{{ status }}"
timeInMinutes: {{ timeInMinutes }}
webhookUrl: "{{ webhookUrl }}"
emailRecipient: "{{ emailRecipient }}"
notificationLocale: "{{ notificationLocale }}"
targetResourceId: "{{ targetResourceId }}"
UPDATE examples
- update
Allows modifying tags of schedules. All other properties will be ignored.
UPDATE azure.dev_test_labs.virtual_machine_schedules
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND virtual_machine_name = '{{ virtual_machine_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 schedule.
REPLACE azure.dev_test_labs.virtual_machine_schedules
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND virtual_machine_name = '{{ virtual_machine_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;
DELETE examples
- delete
Delete schedule.
DELETE FROM azure.dev_test_labs.virtual_machine_schedules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND lab_name = '{{ lab_name }}' --required
AND virtual_machine_name = '{{ virtual_machine_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- execute
Execute a schedule. This operation can take a while to complete.
EXEC azure.dev_test_labs.virtual_machine_schedules.execute
@resource_group_name='{{ resource_group_name }}' --required,
@lab_name='{{ lab_name }}' --required,
@virtual_machine_name='{{ virtual_machine_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;