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
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-manage-jobs-with-rest-api.md
+15-26Lines changed: 15 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,6 @@ The IoT Central REST API lets you develop client applications that integrate wit
21
21
22
22
Scheduled jobs are created to run at a future time. You can set a start date and time for a scheduled job to run one-time, daily, or weekly. Non-scheduled jobs run only one-time.
23
23
24
-
> [!IMPORTANT]
25
-
> The jobs API is currently in preview. All The REST API calls described in this article should include `?api-version=2022-07-31`.
26
-
27
24
This article describes how to use the `/jobs/{job_id}` API to control devices in bulk. You can also control devices individually.
28
25
29
26
Every IoT Central REST API call requires an authorization header. To learn more, see [How to authenticate and authorize IoT Central REST API calls](howto-authorize-rest-api.md).
@@ -349,27 +346,11 @@ PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/rerun/reru
349
346
350
347
The payload for a scheduled job is similar to a standard job but includes the following additional fields:
351
348
352
-
| Field |Type| Description |
353
-
| ----- | --------| ----------- |
354
-
schedule|JobSchedule| The schedule at which to execute the job.
355
-
356
-
### JobSchedule
357
-
358
-
The schedule definition of job.
359
-
360
-
| Field |Type| Description |
361
-
| ----- | --------| ----------- |
362
-
end| `JobScheduleEnd`, `DateJobScheduleEnd`, `OccurrencesJobScheduleEnd`|The specification of when to end the scheduled job.
363
-
recurrence | `JobRecurrence`| The recurrence of the scheduled job. If not provided, the job will run once at the specified start time.
364
-
start| string |The start time for the scheduled job.
365
-
366
-
### JobRecurrence
367
-
368
-
| Field |Type| Description |
369
-
| ----- | --------| ----------- |
370
-
daily| string |The job will run once daily.
371
-
monthly| string| The job will run once every month.
372
-
weekly| string| The job will run once every week.
349
+
| Field | Description |
350
+
| ----- | ----------- |
351
+
schedule/start |The start date and time for the job in ISO 8601 format
352
+
schedule/recurrence| One of `daily`, `monthly`, `yearly`
353
+
schedule/end| An optional field that either specifies the number of occurrences for the job or an end date in ISO 8601 format
373
354
374
355
```http
375
356
PUT https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-07-31
@@ -391,7 +372,11 @@ The following example shows a request body that creates a scheduled job.
391
372
],
392
373
"schedule": {
393
374
"start": "2022-10-24T22:29:01Z",
394
-
"recurrence": "daily"
375
+
"recurrence": "daily",
376
+
"end": {
377
+
"type": "date",
378
+
"date": "2022-12-30"
379
+
}
395
380
}
396
381
}
397
382
```
@@ -414,7 +399,11 @@ The response to this request looks like the following example:
0 commit comments