Skip to content

Commit

Permalink
Add schedule api (Azure#14360)
Browse files Browse the repository at this point in the history
* Add Identity to createWorkpace example

* change for getTransitivePEUsages

* update

* prettier code

* add another new endpoint

* address comments

* change for getTransitivePEUsages

* update

* prettier code

* add another new endpoint

* address comments

* revert change on transitivePE and notebookKeys

* revert change on transitivePE and notebookKeys

* add new stable version 2021-01-01

* add ListNotebookAccessToken

* add primaryUserAssignedIdentity

* fix missing properties and apis

* fix one more missing property

* 202 status for start and stop CI

* make resync keys long runnin operation in version Jan2021

* resync keys 204

* update resync keys example

* Dont throw 204 for resync

* update resync keys

* Formatting

* revert Jan2021changes and add new version

* start apr2021 version for azure ml rp

* undo remove new line in jan2021

* use systemData definition in common

* removed old files

* fix small swagger bugs

* run prettier

* remove reference to sku

* update readme

* minimum agentCount should be 0

* add createdOn and ModifiedOn to compute properties

* add LoadBalancerType to aks compute

* add isNotebookInstanceCompute to virtualMachine

* add leafDomainLabel to SslConfiguration

* add overwriteExistingDomain to SslConfiguration

* add synapseSpark as supported compute-type

* update patch compute response to 202

* remove location from example responses

* Revert "remove location from example responses"

This reverts commit 048bf25.

* MachineLearningCompute_Update should have a 200 response

* sys data to use local def due to naming conflicts.

* Fix enum casing

* Fix operationId PR comment.

* Change opId in apr version

* remove 20210401 for easy review

* only change api version

* merge changes for 20210401 version

* Add x-ms-discriminator-value for Synapse spark

* camelcase loadbalancer properties

* add createdOn and Modified on to examples

* address AvoidAnonymousTypes error for SynapseSpark

* Minor fixes + new property

* Remove subscription state.

* add schedules api

* Add schedule examples

* case formatting

* Cron example for ci create

* Prettier check and model validation

* renaming property

* Address comments

* Give a stop example

* Fix time format.

Co-authored-by: zhaomuzhi <zhaoweixiong521@gmail.com>
Co-authored-by: Vinay Rajmal Soni <vison@microsoft.com>
Co-authored-by: jopet@microsoft.com <jopet@microsoft.com>
Co-authored-by: Josh Peterson <15050193+joshanator@users.noreply.github.com>
  • Loading branch information
5 people authored and mkarmark committed Jul 20, 2021
1 parent b01fe0a commit f91d785
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"parameters": {
"subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
"resourceGroupName": "testrg123",
"workspaceName": "workspaces123",
"computeName": "compute123",
"api-version": "2021-03-01-preview",
"parameters": {
"location": "eastus",
"properties": {
"computeType": "ComputeInstance",
"properties": {
"vmSize": "STANDARD_NC6",
"subnet": "test-subnet-resource-id",
"applicationSharingPolicy": "Personal",
"sshSettings": {
"sshPublicAccess": "Disabled"
},
"computeInstanceAuthorizationType": "personal",
"personalComputeInstanceSettings": {
"assignedUser": {
"objectId": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000"
}
},
"schedules": {
"computeStartStop": [
{
"status": "Enabled",
"action": "Stop",
"triggerType": "Cron",
"cron": {
"expression": "0 18 * * *",
"startTime": "2021-04-23T01:30:00",
"timeZone": "Pacific Standard Time"
}
}
]
}
}
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123",
"type": "Microsoft.MachineLearningServices/workspaces/computes",
"name": "compute123",
"location": "eastus",
"properties": {
"computeType": "ComputeInstance",
"provisioningState": "Creating"
}
}
},
"201": {
"body": {
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123",
"type": "Microsoft.MachineLearningServices/workspaces/computes",
"name": "compute123",
"location": "eastus",
"properties": {
"computeType": "ComputeInstance",
"provisioningState": "Creating"
}
},
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/...pathToOperationStatus..."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parameters": {
"subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
"resourceGroupName": "testrg123",
"workspaceName": "workspaces123",
"computeName": "compute123",
"api-version": "2021-03-01-preview",
"parameters": {
"computeStartStop": [
{
"status": "Enabled",
"action": "Start",
"triggerType": "Recurrence",
"recurrence": {
"frequency": "Day",
"interval": 1,
"startTime": "2021-04-23T01:30:00",
"timeZone": "Pacific Standard Time",
"schedule": {
"hours": [
18
],
"minutes": [
30
],
"weekDays": null
}
}
}
]
}
},
"responses": {
"200": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,9 @@
"Create an ComputeInstance Compute": {
"$ref": "./examples/Compute/createOrUpdate/ComputeInstance.json"
},
"Create an ComputeInstance Compute with Schedules": {
"$ref": "./examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json"
},
"Create AKS Compute": {
"$ref": "./examples/Compute/createOrUpdate/BasicAKSCompute.json"
},
Expand Down Expand Up @@ -1169,6 +1172,56 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateSchedules": {
"post": {
"tags": [
"MachineLearningComputes"
],
"operationId": "Compute_UpdateSchedules",
"description": "Updates schedules of a compute instance",
"x-ms-examples": {
"Update schedules of ComputeInstance": {
"$ref": "./examples/Compute/updateSchedules.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/WorkspaceNameParameter"
},
{
"$ref": "#/parameters/ComputeNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"description": "The object for updating schedules of specified ComputeInstance.",
"schema": {
"$ref": "#/definitions/ComputeSchedules"
}
}
],
"responses": {
"200": {
"description": "Success."
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections": {
"get": {
"tags": [
Expand Down Expand Up @@ -3155,6 +3208,10 @@
"description": "The last operation on ComputeInstance.",
"$ref": "#/definitions/ComputeInstanceLastOperation",
"readOnly": true
},
"schedules": {
"description": "The list of schedules to be applied on the compute instance.",
"$ref": "#/definitions/ComputeSchedules"
}
}
}
Expand Down Expand Up @@ -4584,6 +4641,209 @@
}
}
}
},
"ComputeStartStopSchedule": {
"type": "object",
"description": "Compute start stop schedule properties",
"properties": {
"id": {
"description": "Schedule id.",
"readOnly": true,
"type": "string"
},
"provisioningStatus": {
"type": "string",
"enum": [
"Completed",
"Provisioning",
"Failed"
],
"x-ms-enum": {
"name": "provisioningStatus",
"modelAsString": true
},
"readOnly": true,
"description": "The current deployment state of schedule."
},
"status": {
"$ref": "#/definitions/ScheduleStatus"
},
"triggerType": {
"$ref": "#/definitions/TriggerType"
},
"action": {
"$ref": "#/definitions/ComputePowerAction"
},
"recurrence": {
"$ref": "#/definitions/Recurrence"
},
"cron": {
"$ref": "#/definitions/Cron"
}
}
},
"ScheduleStatus": {
"type": "string",
"description": "The schedule status.",
"enum": [
"Enabled",
"Disabled"
],
"x-ms-enum": {
"name": "ScheduleStatus",
"modelAsString": true
}
},
"ScheduleType": {
"type": "string",
"description": "The schedule type.",
"enum": [
"ComputeStartStop"
],
"x-ms-enum": {
"name": "ScheduleType",
"modelAsString": true
}
},
"ComputePowerAction": {
"type": "string",
"description": "The compute power action.",
"enum": [
"Start",
"Stop"
],
"x-ms-enum": {
"name": "ComputePowerAction",
"modelAsString": true
}
},
"TriggerType": {
"type": "string",
"description": "The schedule trigger type.",
"enum": [
"Recurrence",
"Cron"
],
"x-ms-enum": {
"name": "TriggerType",
"modelAsString": true
}
},
"RecurrenceFrequency": {
"type": "string",
"description": "The recurrence frequency.",
"enum": [
"NotSpecified",
"Second",
"Minute",
"Hour",
"Day",
"Week",
"Month",
"Year"
],
"x-ms-enum": {
"name": "RecurrenceFrequency",
"modelAsString": true
}
},
"RecurrenceSchedule": {
"type": "object",
"description": "The recurrence schedule",
"properties": {
"minutes": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "The minutes."
},
"hours": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "The hours."
},
"weekDays": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"x-ms-enum": {
"name": "DaysOfWeek",
"modelAsString": false
}
},
"description": "The days of the week."
}
}
},
"Recurrence": {
"type": "object",
"description": "The workflow trigger recurrence for ComputeStartStop schedule type.",
"properties": {
"frequency": {
"$ref": "#/definitions/RecurrenceFrequency"
},
"interval": {
"type": "integer",
"format": "int32",
"description": "The interval."
},
"startTime": {
"type": "string",
"description": "The start time."
},
"timeZone": {
"type": "string",
"description": "The time zone."
},
"schedule": {
"$ref": "#/definitions/RecurrenceSchedule"
}
}
},
"Cron": {
"type": "object",
"description": "The workflow trigger cron for ComputeStartStop schedule type.",
"properties": {
"startTime": {
"type": "string",
"description": "The start time."
},
"timeZone": {
"type": "string",
"description": "The time zone."
},
"expression": {
"type": "string",
"description": "The cron expression."
}
}
},
"ComputeSchedules": {
"type": "object",
"description": "The list of schedules to be applied on the computes",
"properties": {
"computeStartStop": {
"type": "array",
"items": {
"$ref": "#/definitions/ComputeStartStopSchedule"
},
"description": "The list of compute start stop schedules to be applied."
}
}
}
}
}

0 comments on commit f91d785

Please sign in to comment.