You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use this to perform an incremental update to an export. The sample request body looks like the following example which updates the `displayName` to a destination:
@@ -163,15 +163,15 @@ The response to this request looks like the following example:
163
163
Use the following request to delete a destination:
You can use this to perform an incremental update to an export. The sample request body looks like the following example which updates the `enrichments` to an export:
@@ -353,7 +353,7 @@ The response to this request looks like the following example:
353
353
Use the following request to delete an export definition:
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-manage-jobs-with-rest-api.md
+210-9Lines changed: 210 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,10 @@ The IoT Central REST API lets you develop client applications that integrate wit
17
17
- List jobs and view job details in your application.
18
18
- Create jobs in your application.
19
19
- Stop, resume, and rerun jobs in your application.
20
+
- Schedule Jobs and view scheduled job details in your application.
20
21
21
22
> [!IMPORTANT]
22
-
> The jobs API is currently in preview. All The REST API calls described in this article should include `?api-version=1.2-preview`.
23
+
> The jobs API is currently in preview. All The REST API calls described in this article should include `?api-version=2022-06-30-preview`.
23
24
24
25
This article describes how to use the `/jobs/{job_id}` API to control devices in bulk. You can also control devices individually.
25
26
@@ -91,7 +92,7 @@ The following table describes the fields in the previous JSON snippet:
91
92
Use the following request to retrieve the list of the jobs in your application:
92
93
93
94
```http
94
-
GET https://{your app subdomain}.azureiotcentral.com/api/jobs?api-version=1.2-preview
95
+
GET https://{your app subdomain}.azureiotcentral.com/api/jobs?api-version=2022-06-30-preview
95
96
```
96
97
97
98
The response to this request looks like the following example:
@@ -160,7 +161,7 @@ The response to this request looks like the following example:
160
161
Use the following request to retrieve an individual job by ID:
161
162
162
163
```http
163
-
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004?api-version=1.2-preview
164
+
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004?api-version=2022-06-30-preview
164
165
```
165
166
166
167
The response to this request looks like the following example:
@@ -195,7 +196,7 @@ The response to this request looks like the following example:
195
196
Use the following request to retrieve the details of the devices in a job:
196
197
197
198
```http
198
-
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004/devices?api-version=1.2-preview
199
+
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004/devices?api-version=2022-06-30-preview
199
200
```
200
201
201
202
The response to this request looks like the following example:
@@ -228,7 +229,7 @@ The response to this request looks like the following example:
228
229
Use the following request to create a job:
229
230
230
231
```http
231
-
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006?api-version=1.2-preview
232
+
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006?api-version=2022-06-30-preview
232
233
```
233
234
234
235
The `group` field in the request body identifies a device group in your IoT Central application. A job uses a device group to identify the set of devices the job operates on.
@@ -237,7 +238,7 @@ The `group` field in the request body identifies a device group in your IoT Cent
237
238
If you don't already have a suitable device group, you can create one with REST API call. The following example creates a device group with `group1` as the group ID:
238
239
239
240
```http
240
-
PUT https://{subdomain}.{baseDomain}/api/deviceGroups/group1?api-version=1.2-preview
241
+
PUT https://{subdomain}.{baseDomain}/api/deviceGroups/group1?api-version=2022-06-30-preview
241
242
```
242
243
243
244
When you create a device group, you define a `filter` that selects the devices to include in the group. A filter identifies a device template and any properties to match. The following example creates device group that contains all devices associated with the "dtmi:modelDefinition:dtdlv2" device template where the `provisioned` property is `true`.
@@ -323,23 +324,223 @@ The response to this request looks like the following example. The initial job s
323
324
Use the following request to stop a running job:
324
325
325
326
```http
326
-
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/stop?api-version=1.2-preview
327
+
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/stop?api-version=2022-06-30-preview
327
328
```
328
329
329
330
If the request succeeds, it returns a `204 - No Content` response.
330
331
331
332
Use the following request to resume a stopped job:
332
333
333
334
```http
334
-
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/resume?api-version=1.2-preview
335
+
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/resume?api-version=2022-06-30-preview
335
336
```
336
337
337
338
If the request succeeds, it returns a `204 - No Content` response.
338
339
339
340
Use the following command to rerun an existing job on any failed devices:
340
341
341
342
```http
342
-
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/rerun/rerun-001?api-version=1.2-preview
343
+
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/rerun/rerun-001?api-version=2022-06-30-preview
344
+
```
345
+
346
+
## Create a scheduled job
347
+
348
+
Use the following request to create a scheduled job
349
+
350
+
```http
351
+
PUT https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-06-30-preview
352
+
```
353
+
354
+
The following example shows a request body that creates a scheduled job.
355
+
356
+
```json
357
+
{
358
+
"displayName": "New Scheduled Job",
359
+
"group": "6fecf96f-a26c-49ed-8076-6960f8efba31",
360
+
"data": [
361
+
{
362
+
"type": "cloudProperty",
363
+
"target": "dtmi:azurertos:devkit:hlby5jgib2o",
364
+
"path": "Company",
365
+
"value": "Contoso"
366
+
}
367
+
],
368
+
"schedule": {
369
+
"start": "2022-10-24T22:29:01Z",
370
+
"recurrence": "daily"
371
+
}
372
+
}
373
+
```
374
+
375
+
The response to this request looks like the following example:
0 commit comments