Azure Lab Services REST API Schedule Lab

David Downing 701 Reputation points
2020-02-13T18:38:43.473+00:00

I'm trying to automate creating a lab schedule but I cannot see an API listed in the documentation. Is this possible?

Thank you,
David

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
273 questions
0 comments No comments
{count} votes

Accepted answer
  1. David Downing 701 Reputation points
    2020-02-28T18:46:29.543+00:00

    I was able to schedule a lab using the following:

    PUT URL:

    https://management.azure.com/subscriptions/{SubscriptionID}/resourcegroups/LSRG1/providers/microsoft.labservices/labaccounts/LABACCT01/labs/LAB01/environmentsettings/LAB01ES/schedules/LAB01Schedule01?api-version=2019-01-01-preview

    Body:

    {
    "properties": {
    "start": "2020-05-1T15:00:00.000Z",
    "end": "2020-05-31T17:00:00.000Z",
    "recurrencePattern": {
    "frequency": "Weekly",
    "weekDays": [ "Tuesday" ],
    "interval": 1,
    "until": "2020-06-19T22:59:59.000Z"
    },
    "timeZoneId": "Eastern Standard Time",
    "startAction": {
    "enableState": "Enabled",
    "actionType": "Start"
    },
    "endAction": {
    "enableState": "Enabled",
    "actionType": "Stop"
    },
    "notes": ""
    }
    }

    Thank you for your assistance.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Samara Soucy - MSFT 21 Reputation points
    2020-02-19T20:02:58.027+00:00

    There is an undocumented endpoint in the 2019-01-01-preview API that allows this. As a preview feature, it is subject to change at any time.

    The endpoint is:

    PUT https://management.azure.com/subscriptions/{TenantID}/resourcegroups/{ResourceGroup}/providers/microsoft.labservicesl/labaccounts/{LabAccountName}/labs/{LabName}/environmentsettings/default/schedules/{ScheduleName}?api-version=2019-01-01-preview  
    

    And an example of the body is:

    {  
        "properties": {  
            "start": "2020-02-19T15:00:00.000Z",  
            "end": "2020-02-19T17:00:00.000Z",  
            "recurrencePattern": {  
                "frequency": "Weekly",  
                "weekDays": ["Tuesday"],  
                "interval": 1,  
                "until": "2020-06-19T22:59:59.000Z"  
            },  
            "timeZoneId": "Eastern Standard Time",  
            "startAction": {  
                "enableState": "Enabled",  
                "actionType": "Start"  
            },  
            "endAction": {  
                "enableState": "Enabled",  
                "actionType": "Stop"  
            },  
            "notes": ""  
        }  
    }  
    
    1 person found this answer helpful.