Schedules - Create Or Update
Operation to create or update a lab schedule.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}?api-version=2023-06-07
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
lab
|
path | True |
string |
The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs. |
resource
|
path | True |
string |
The name of the resource group. The name is case insensitive. |
schedule
|
path | True |
string |
The name of the schedule that uniquely identifies it within containing lab. Used in resource URIs. Regex pattern: |
subscription
|
path | True |
string |
The ID of the target subscription. |
api-version
|
query | True |
string |
The API version to use for this operation. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
properties.stopAt | True |
string |
When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. |
properties.timeZoneId | True |
string |
The IANA timezone id for the schedule. |
properties.notes |
string |
Notes for this schedule. |
|
properties.recurrencePattern |
The recurrence pattern of the scheduled actions. |
||
properties.startAt |
string |
When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The schedule was updated; response contains the lab schedule. |
|
201 Created |
The schedule was created; response contains the lab schedule. |
|
Other Status Codes |
The default error response. |
Examples
putSchedule
Sample Request
PUT https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/schedules/schedule1?api-version=2023-06-07
{
"properties": {
"startAt": "2020-05-26T12:00:00Z",
"stopAt": "2020-05-26T18:00:00Z",
"recurrencePattern": {
"frequency": "Daily",
"interval": 2,
"expirationDate": "2020-08-14T23:59:59Z"
},
"timeZoneId": "America/Los_Angeles",
"notes": "Schedule 1 for students"
}
}
Sample Response
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/schedules/schedule1",
"name": "schedule1",
"type": "Microsoft.LabServices/Schedule",
"systemData": {
"createdBy": "identity123",
"createdByType": "User",
"createdAt": "2020-05-01T10:00:00Z",
"lastModifiedBy": "identity123",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-01T09:12:28Z"
},
"properties": {
"provisioningState": "Succeeded",
"startAt": "2020-05-26T12:00:00Z",
"stopAt": "2020-05-26T18:00:00Z",
"recurrencePattern": {
"frequency": "Daily",
"interval": 2,
"expirationDate": "2020-08-14T23:59:59Z"
},
"timeZoneId": "America/Los_Angeles",
"notes": "Schedule 1 for students"
}
}
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.LabServices/labs/testlab/schedules/schedule1",
"name": "schedule1",
"type": "Microsoft.LabServices/Schedule",
"systemData": {
"createdBy": "identity123",
"createdByType": "User",
"createdAt": "2020-05-01T10:00:00Z",
"lastModifiedBy": "identity123",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-01T09:12:28Z"
},
"properties": {
"provisioningState": "Succeeded",
"startAt": "2020-05-26T12:00:00Z",
"stopAt": "2020-05-26T18:00:00Z",
"recurrencePattern": {
"frequency": "Daily",
"interval": 2,
"expirationDate": "2020-08-14T23:59:59Z"
},
"timeZoneId": "America/Los_Angeles",
"notes": "Schedule 1 for students"
}
}
Definitions
Name | Description |
---|---|
created |
The type of identity that created the resource. |
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
Provisioning |
Current provisioning state of the schedule. |
Recurrence |
Schedule recurrence frequencies. |
Recurrence |
Recurrence pattern of a lab schedule. |
Resource |
Error details of the latest operation failure on this resource |
Schedule |
Schedule for automatically turning virtual machines in a lab on and off at specified times. |
system |
Metadata pertaining to creation and last modification of the resource. |
Week |
Days of the week. |
createdByType
The type of identity that created the resource.
Name | Type | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
ProvisioningState
Current provisioning state of the schedule.
Name | Type | Description |
---|---|---|
Creating |
string |
Resource is in the process of being created. |
Deleting |
string |
Resource is in the process of being deleted. |
Failed |
string |
Previous operation on the resource has failed leaving resource in unhealthy state. |
Locked |
string |
The resource is locked and changes are currently blocked. This could be due to maintenance or a scheduled operation. The state will go back to succeeded once the locking operation has finished. |
Succeeded |
string |
Resource is in healthy state after creation or update operation. |
Updating |
string |
New property values are being applied to the resource. |
RecurrenceFrequency
Schedule recurrence frequencies.
Name | Type | Description |
---|---|---|
Daily |
string |
Schedule will run every days. |
Weekly |
string |
Schedule will run every week on days specified in weekDays. |
RecurrencePattern
Recurrence pattern of a lab schedule.
Name | Type | Description |
---|---|---|
expirationDate |
string |
When the recurrence will expire. This date is inclusive. |
frequency |
The frequency of the recurrence. |
|
interval |
integer |
The interval to invoke the schedule on. For example, interval = 2 and RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. |
weekDays |
Week |
The week days the schedule runs. Used for when the Frequency is set to Weekly. |
ResourceOperationError
Error details of the latest operation failure on this resource
Name | Type | Description |
---|---|---|
action |
string |
The operation action that failed |
code |
string |
The code that corresponds to the type of operation failure |
message |
string |
The operation failure message |
timestamp |
string |
The datetime of when the error occured |
Schedule
Schedule for automatically turning virtual machines in a lab on and off at specified times.
Name | Type | Description |
---|---|---|
id |
string |
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
The name of the resource |
properties.notes |
string |
Notes for this schedule. |
properties.provisioningState |
Current provisioning state of the schedule. |
|
properties.recurrencePattern |
The recurrence pattern of the scheduled actions. |
|
properties.resourceOperationError |
Error details of last operation done on schedule. |
|
properties.startAt |
string |
When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. |
properties.stopAt |
string |
When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. |
properties.timeZoneId |
string |
The IANA timezone id for the schedule. |
systemData |
Metadata pertaining to creation and last modification of the schedule. |
|
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |
WeekDay
Days of the week.
Name | Type | Description |
---|---|---|
Friday |
string |
Schedule will run on Friday |
Monday |
string |
Schedule will run on Monday |
Saturday |
string |
Schedule will run on Saturday |
Sunday |
string |
Schedule will run on Sunday |
Thursday |
string |
Schedule will run on Thursday |
Tuesday |
string |
Schedule will run on Tuesday |
Wednesday |
string |
Schedule will run on Wednesday |