Skip to content

Commit 51c11d5

Browse files
SubaMoorthyzhaomuzhiVinayRSonijopet@microsoft.comjoshanator
authored
Add schedule api (#14360)
* 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 <[email protected]> Co-authored-by: Vinay Rajmal Soni <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Josh Peterson <[email protected]>
1 parent 2f3f9da commit 51c11d5

File tree

3 files changed

+369
-0
lines changed

3 files changed

+369
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
4+
"resourceGroupName": "testrg123",
5+
"workspaceName": "workspaces123",
6+
"computeName": "compute123",
7+
"api-version": "2021-03-01-preview",
8+
"parameters": {
9+
"location": "eastus",
10+
"properties": {
11+
"computeType": "ComputeInstance",
12+
"properties": {
13+
"vmSize": "STANDARD_NC6",
14+
"subnet": "test-subnet-resource-id",
15+
"applicationSharingPolicy": "Personal",
16+
"sshSettings": {
17+
"sshPublicAccess": "Disabled"
18+
},
19+
"computeInstanceAuthorizationType": "personal",
20+
"personalComputeInstanceSettings": {
21+
"assignedUser": {
22+
"objectId": "00000000-0000-0000-0000-000000000000",
23+
"tenantId": "00000000-0000-0000-0000-000000000000"
24+
}
25+
},
26+
"schedules": {
27+
"computeStartStop": [
28+
{
29+
"status": "Enabled",
30+
"action": "Stop",
31+
"triggerType": "Cron",
32+
"cron": {
33+
"expression": "0 18 * * *",
34+
"startTime": "2021-04-23T01:30:00",
35+
"timeZone": "Pacific Standard Time"
36+
}
37+
}
38+
]
39+
}
40+
}
41+
}
42+
}
43+
},
44+
"responses": {
45+
"200": {
46+
"body": {
47+
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123",
48+
"type": "Microsoft.MachineLearningServices/workspaces/computes",
49+
"name": "compute123",
50+
"location": "eastus",
51+
"properties": {
52+
"computeType": "ComputeInstance",
53+
"provisioningState": "Creating"
54+
}
55+
}
56+
},
57+
"201": {
58+
"body": {
59+
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.MachineLearningServices/workspaces/workspaces123/computes/compute123",
60+
"type": "Microsoft.MachineLearningServices/workspaces/computes",
61+
"name": "compute123",
62+
"location": "eastus",
63+
"properties": {
64+
"computeType": "ComputeInstance",
65+
"provisioningState": "Creating"
66+
}
67+
},
68+
"headers": {
69+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/...pathToOperationStatus..."
70+
}
71+
}
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
4+
"resourceGroupName": "testrg123",
5+
"workspaceName": "workspaces123",
6+
"computeName": "compute123",
7+
"api-version": "2021-03-01-preview",
8+
"parameters": {
9+
"computeStartStop": [
10+
{
11+
"status": "Enabled",
12+
"action": "Start",
13+
"triggerType": "Recurrence",
14+
"recurrence": {
15+
"frequency": "Day",
16+
"interval": 1,
17+
"startTime": "2021-04-23T01:30:00",
18+
"timeZone": "Pacific Standard Time",
19+
"schedule": {
20+
"hours": [
21+
18
22+
],
23+
"minutes": [
24+
30
25+
],
26+
"weekDays": null
27+
}
28+
}
29+
}
30+
]
31+
}
32+
},
33+
"responses": {
34+
"200": {}
35+
}
36+
}

specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2021-03-01-preview/machineLearningServices.json

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,9 @@
728728
"Create an ComputeInstance Compute": {
729729
"$ref": "./examples/Compute/createOrUpdate/ComputeInstance.json"
730730
},
731+
"Create an ComputeInstance Compute with Schedules": {
732+
"$ref": "./examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json"
733+
},
731734
"Create AKS Compute": {
732735
"$ref": "./examples/Compute/createOrUpdate/BasicAKSCompute.json"
733736
},
@@ -1169,6 +1172,56 @@
11691172
}
11701173
}
11711174
},
1175+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateSchedules": {
1176+
"post": {
1177+
"tags": [
1178+
"MachineLearningComputes"
1179+
],
1180+
"operationId": "Compute_UpdateSchedules",
1181+
"description": "Updates schedules of a compute instance",
1182+
"x-ms-examples": {
1183+
"Update schedules of ComputeInstance": {
1184+
"$ref": "./examples/Compute/updateSchedules.json"
1185+
}
1186+
},
1187+
"parameters": [
1188+
{
1189+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
1190+
},
1191+
{
1192+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
1193+
},
1194+
{
1195+
"$ref": "#/parameters/WorkspaceNameParameter"
1196+
},
1197+
{
1198+
"$ref": "#/parameters/ComputeNameParameter"
1199+
},
1200+
{
1201+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
1202+
},
1203+
{
1204+
"name": "parameters",
1205+
"in": "body",
1206+
"description": "The object for updating schedules of specified ComputeInstance.",
1207+
"schema": {
1208+
"$ref": "#/definitions/ComputeSchedules"
1209+
}
1210+
}
1211+
],
1212+
"responses": {
1213+
"200": {
1214+
"description": "Success."
1215+
},
1216+
"default": {
1217+
"description": "Error response describing why the operation failed.",
1218+
"schema": {
1219+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
1220+
}
1221+
}
1222+
}
1223+
}
1224+
},
11721225
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections": {
11731226
"get": {
11741227
"tags": [
@@ -3155,6 +3208,10 @@
31553208
"description": "The last operation on ComputeInstance.",
31563209
"$ref": "#/definitions/ComputeInstanceLastOperation",
31573210
"readOnly": true
3211+
},
3212+
"schedules": {
3213+
"description": "The list of schedules to be applied on the compute instance.",
3214+
"$ref": "#/definitions/ComputeSchedules"
31583215
}
31593216
}
31603217
}
@@ -4584,6 +4641,209 @@
45844641
}
45854642
}
45864643
}
4644+
},
4645+
"ComputeStartStopSchedule": {
4646+
"type": "object",
4647+
"description": "Compute start stop schedule properties",
4648+
"properties": {
4649+
"id": {
4650+
"description": "Schedule id.",
4651+
"readOnly": true,
4652+
"type": "string"
4653+
},
4654+
"provisioningStatus": {
4655+
"type": "string",
4656+
"enum": [
4657+
"Completed",
4658+
"Provisioning",
4659+
"Failed"
4660+
],
4661+
"x-ms-enum": {
4662+
"name": "provisioningStatus",
4663+
"modelAsString": true
4664+
},
4665+
"readOnly": true,
4666+
"description": "The current deployment state of schedule."
4667+
},
4668+
"status": {
4669+
"$ref": "#/definitions/ScheduleStatus"
4670+
},
4671+
"triggerType": {
4672+
"$ref": "#/definitions/TriggerType"
4673+
},
4674+
"action": {
4675+
"$ref": "#/definitions/ComputePowerAction"
4676+
},
4677+
"recurrence": {
4678+
"$ref": "#/definitions/Recurrence"
4679+
},
4680+
"cron": {
4681+
"$ref": "#/definitions/Cron"
4682+
}
4683+
}
4684+
},
4685+
"ScheduleStatus": {
4686+
"type": "string",
4687+
"description": "The schedule status.",
4688+
"enum": [
4689+
"Enabled",
4690+
"Disabled"
4691+
],
4692+
"x-ms-enum": {
4693+
"name": "ScheduleStatus",
4694+
"modelAsString": true
4695+
}
4696+
},
4697+
"ScheduleType": {
4698+
"type": "string",
4699+
"description": "The schedule type.",
4700+
"enum": [
4701+
"ComputeStartStop"
4702+
],
4703+
"x-ms-enum": {
4704+
"name": "ScheduleType",
4705+
"modelAsString": true
4706+
}
4707+
},
4708+
"ComputePowerAction": {
4709+
"type": "string",
4710+
"description": "The compute power action.",
4711+
"enum": [
4712+
"Start",
4713+
"Stop"
4714+
],
4715+
"x-ms-enum": {
4716+
"name": "ComputePowerAction",
4717+
"modelAsString": true
4718+
}
4719+
},
4720+
"TriggerType": {
4721+
"type": "string",
4722+
"description": "The schedule trigger type.",
4723+
"enum": [
4724+
"Recurrence",
4725+
"Cron"
4726+
],
4727+
"x-ms-enum": {
4728+
"name": "TriggerType",
4729+
"modelAsString": true
4730+
}
4731+
},
4732+
"RecurrenceFrequency": {
4733+
"type": "string",
4734+
"description": "The recurrence frequency.",
4735+
"enum": [
4736+
"NotSpecified",
4737+
"Second",
4738+
"Minute",
4739+
"Hour",
4740+
"Day",
4741+
"Week",
4742+
"Month",
4743+
"Year"
4744+
],
4745+
"x-ms-enum": {
4746+
"name": "RecurrenceFrequency",
4747+
"modelAsString": true
4748+
}
4749+
},
4750+
"RecurrenceSchedule": {
4751+
"type": "object",
4752+
"description": "The recurrence schedule",
4753+
"properties": {
4754+
"minutes": {
4755+
"type": "array",
4756+
"items": {
4757+
"type": "integer",
4758+
"format": "int32"
4759+
},
4760+
"description": "The minutes."
4761+
},
4762+
"hours": {
4763+
"type": "array",
4764+
"items": {
4765+
"type": "integer",
4766+
"format": "int32"
4767+
},
4768+
"description": "The hours."
4769+
},
4770+
"weekDays": {
4771+
"type": "array",
4772+
"items": {
4773+
"type": "string",
4774+
"enum": [
4775+
"Sunday",
4776+
"Monday",
4777+
"Tuesday",
4778+
"Wednesday",
4779+
"Thursday",
4780+
"Friday",
4781+
"Saturday"
4782+
],
4783+
"x-ms-enum": {
4784+
"name": "DaysOfWeek",
4785+
"modelAsString": false
4786+
}
4787+
},
4788+
"description": "The days of the week."
4789+
}
4790+
}
4791+
},
4792+
"Recurrence": {
4793+
"type": "object",
4794+
"description": "The workflow trigger recurrence for ComputeStartStop schedule type.",
4795+
"properties": {
4796+
"frequency": {
4797+
"$ref": "#/definitions/RecurrenceFrequency"
4798+
},
4799+
"interval": {
4800+
"type": "integer",
4801+
"format": "int32",
4802+
"description": "The interval."
4803+
},
4804+
"startTime": {
4805+
"type": "string",
4806+
"description": "The start time."
4807+
},
4808+
"timeZone": {
4809+
"type": "string",
4810+
"description": "The time zone."
4811+
},
4812+
"schedule": {
4813+
"$ref": "#/definitions/RecurrenceSchedule"
4814+
}
4815+
}
4816+
},
4817+
"Cron": {
4818+
"type": "object",
4819+
"description": "The workflow trigger cron for ComputeStartStop schedule type.",
4820+
"properties": {
4821+
"startTime": {
4822+
"type": "string",
4823+
"description": "The start time."
4824+
},
4825+
"timeZone": {
4826+
"type": "string",
4827+
"description": "The time zone."
4828+
},
4829+
"expression": {
4830+
"type": "string",
4831+
"description": "The cron expression."
4832+
}
4833+
}
4834+
},
4835+
"ComputeSchedules": {
4836+
"type": "object",
4837+
"description": "The list of schedules to be applied on the computes",
4838+
"properties": {
4839+
"computeStartStop": {
4840+
"type": "array",
4841+
"items": {
4842+
"$ref": "#/definitions/ComputeStartStopSchedule"
4843+
},
4844+
"description": "The list of compute start stop schedules to be applied."
4845+
}
4846+
}
45874847
}
45884848
}
45894849
}

0 commit comments

Comments
 (0)