Skip to content

Commit 81038ef

Browse files
Merge pull request #6944 from s-polly/main
REST API - added job content
2 parents 7008fd5 + 270453e commit 81038ef

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

articles/machine-learning/how-to-manage-rest.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ms.subservice: enterprise-readiness
1111
ms.date: 08/21/2024
1212
ms.topic: how-to
1313
ms.custom:
14+
1415
---
1516

1617
# Create, run, and delete Azure Machine Learning resources using REST
@@ -25,6 +26,7 @@ In this article, you learn how to:
2526
> * Retrieve an authorization token
2627
> * Create a properly-formatted REST request using service principal authentication
2728
> * Use GET requests to retrieve information about Azure Machine Learning's hierarchical resources
29+
> * Use GET requests to retrieve and manage jobs
2830
> * Use PUT and POST requests to create and modify resources
2931
> * Use PUT requests to create Azure Machine Learning workspaces
3032
> * Use DELETE requests to clean up resources
@@ -128,7 +130,7 @@ The above call will result in a compacted JSON response of the form:
128130

129131
To retrieve the set of workspaces in a resource group, run the following, replacing `<YOUR-SUBSCRIPTION-ID>`, `<YOUR-RESOURCE-GROUP>`, and `<YOUR-ACCESS-TOKEN>`:
130132

131-
```
133+
```bash
132134
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/?api-version=2023-10-01 \
133135
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
134136
```
@@ -202,13 +204,58 @@ providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/mod
202204
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
203205
```
204206

207+
## Retrieve and manage jobs
208+
209+
Jobs are a fundamental concept in Azure Machine Learning, representing training runs, batch inference, and other machine learning workloads. You can use REST API calls to retrieve job information, monitor status, and manage job lifecycle.
210+
211+
### Get a specific job by ID
212+
213+
To retrieve details about a specific job using its ID, you can use the management API:
214+
215+
```bash
216+
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
217+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/jobs/<JOB-ID>?api-version=2024-04-01 \
218+
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
219+
```
220+
221+
This will return a JSON response with complete job details including status, configuration, and results.
222+
223+
### List all jobs in a workspace
224+
225+
To get a list of all jobs in your workspace:
226+
227+
```bash
228+
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
229+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/jobs?api-version=2024-04-01 \
230+
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
231+
```
232+
233+
### Get job runs using regional API
234+
235+
You can also retrieve job information using the regional API server. To list job runs:
236+
237+
```bash
238+
curl https://<REGIONAL-API-SERVER>/history/v1.0/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
239+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/runs?api-version=2023-10-01 \
240+
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
241+
```
242+
243+
To get details about a specific run:
244+
245+
```bash
246+
curl https://<REGIONAL-API-SERVER>/history/v1.0/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
247+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/runs/<RUN-ID>?api-version=2023-10-01 \
248+
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
249+
```
250+
205251
Notice that to list experiments the path begins with `history/v1.0` while to list models, the path begins with `modelmanagement/v1.0`. The REST API is divided into several operational groups, each with a distinct path.
206252

207253
|Area|Path|
208254
|-|-|
209255
|Artifacts|/rest/api/azureml|
210256
|Data stores|/azure/machine-learning/how-to-access-data|
211257
|Hyperparameter tuning|hyperdrive/v1.0/|
258+
|Jobs|/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs|
212259
|Models|modelmanagement/v1.0/|
213260
|Run history|execution/v1.0/ and history/v1.0/|
214261

0 commit comments

Comments
 (0)