Schedules - Update

Operation to update a lab schedule.

PATCH 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
labName
path True

string

The name of the lab that uniquely identifies it within containing lab plan. Used in resource URIs.

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

scheduleName
path True

string

The name of the schedule that uniquely identifies it within containing lab. Used in resource URIs.

Regex pattern: ^[-\w\\._\\(\\)]+$

subscriptionId
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 Type Description
properties.notes

string

Notes for this schedule.

properties.recurrencePattern

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.

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.

Responses

Name Type Description
200 OK

Schedule

The schedule was updated; response contains the lab schedule.

Other Status Codes

ErrorResponse

The default error response.

Examples

patchSchedule

Sample Request

PATCH 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": {
    "recurrencePattern": {
      "frequency": "Daily",
      "interval": 2,
      "expirationDate": "2020-08-14T23:59:59Z"
    }
  }
}

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"
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ProvisioningState

Current provisioning state of the schedule.

RecurrenceFrequency

Schedule recurrence frequencies.

RecurrencePattern

Recurrence pattern of a lab schedule.

ResourceOperationError

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.

ScheduleUpdate

Schedule for automatically turning virtual machines in a lab on and off at specified times. Used for updates.

systemData

Metadata pertaining to creation and last modification of the resource.

WeekDay

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

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

RecurrenceFrequency

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

WeekDay[]

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

ProvisioningState

Current provisioning state of the schedule.

properties.recurrencePattern

RecurrencePattern

The recurrence pattern of the scheduled actions.

properties.resourceOperationError

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

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"

ScheduleUpdate

Schedule for automatically turning virtual machines in a lab on and off at specified times. Used for updates.

Name Type Description
properties.notes

string

Notes for this schedule.

properties.recurrencePattern

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.

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 resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

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

createdByType

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