Skip to main content

global_schedules

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

Overview

Nameglobal_schedules
TypeResource
Idazure.dev_test_labs.global_schedules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe identifier of the resource.
namestringThe name of the resource.
createdDatestring (date-time)The creation date of the schedule.
dailyRecurrenceobjectIf the schedule will occur once each day of the week, specify the daily recurrence.
hourlyRecurrenceobjectIf the schedule will occur multiple times a day, specify the hourly recurrence.
locationstringThe location of the resource.
notificationSettingsobjectNotification settings.
provisioningStatestringThe provisioning status of the resource.
statusstringThe status of the schedule (i.e. Enabled, Disabled). Known values are: "Enabled" and "Disabled".
tagsobjectThe tags of the resource.
targetResourceIdstringThe resource ID to which the schedule belongs.
taskTypestringThe task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart).
timeZoneIdstringThe 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).
typestringThe type of the resource.
uniqueIdentifierstringThe unique immutable identifier of a resource (Guid).
weeklyRecurrenceobjectIf the schedule will occur only some days of the week, specify the weekly recurrence.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, name, subscription_id$expandGet schedule.
list_by_resource_groupselectresource_group_name, subscription_id$expand, $filter, $top, $orderbyList schedules in a resource group.
list_by_subscriptionselectsubscription_id$expand, $filter, $top, $orderbyList schedules in a subscription.
create_or_updateinsertresource_group_name, name, subscription_idCreate or replace an existing schedule.
updateupdateresource_group_name, name, subscription_idAllows modifying tags of schedules. All other properties will be ignored.
create_or_updatereplaceresource_group_name, name, subscription_idCreate or replace an existing schedule.
deletedeleteresource_group_name, name, subscription_idDelete schedule.
executeexecresource_group_name, name, subscription_idExecute a schedule. This operation can take a while to complete.
retargetexecresource_group_name, name, subscription_idUpdates a schedule's target resource Id. 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.

NameDatatypeDescription
namestringThe name of the schedule. Required.
resource_group_namestringThe name of the resource group. Required.
subscription_idstring
$expandstringSpecify the $expand query. Example: 'properties($select=status)'. Default value is None.
$filterstringThe filter to apply to the operation. Example: '$filter=contains(name,'myName'). Default value is None.
$orderbystringThe ordering expression for the results, using OData notation. Example: '$orderby=name desc'. Default value is None.
$topintegerThe maximum number of resources to return from the operation. Example: '$top=10'. Default value is None.

SELECT examples

Get schedule.

SELECT
id,
name,
createdDate,
dailyRecurrence,
hourlyRecurrence,
location,
notificationSettings,
provisioningState,
status,
tags,
targetResourceId,
taskType,
timeZoneId,
type,
uniqueIdentifier,
weeklyRecurrence
FROM azure.dev_test_labs.global_schedules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND name = '{{ name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

Create or replace an existing schedule.

INSERT INTO azure.dev_test_labs.global_schedules (
location,
tags,
properties,
resource_group_name,
name,
subscription_id
)
SELECT
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

UPDATE examples

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

UPDATE azure.dev_test_labs.global_schedules
SET
-- No updatable properties
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

REPLACE examples

Create or replace an existing schedule.

REPLACE azure.dev_test_labs.global_schedules
SET
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

DELETE examples

Delete schedule.

DELETE FROM azure.dev_test_labs.global_schedules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND name = '{{ name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Execute a schedule. This operation can take a while to complete.

EXEC azure.dev_test_labs.global_schedules.execute 
@resource_group_name='{{ resource_group_name }}' --required,
@name='{{ name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;