Skip to content

Commit c18913b

Browse files
committed
update rest api jobs and version
1 parent cdd7164 commit c18913b

File tree

3 files changed

+56
-32
lines changed

3 files changed

+56
-32
lines changed

articles/iot-central/core/howto-manage-device-templates-with-rest-api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ The response to this request looks like the following example:
987987
You can use ODATA filters to filter the results returned by the list device templates API.
988988

989989
> [!NOTE]
990-
> Currently, ODATA support is only available for `api-version=2022-06-30-preview`.
990+
> Currently, ODATA support is only available for `api-version=2022-07-31`.
991991
992992
### $top
993993

@@ -996,7 +996,7 @@ Use the **$top** filter to set the result size. The maximum returned result size
996996
Use the following request to retrieve the top 10 device templates from your application:
997997

998998
```http
999-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-06-30-preview&$top=10
999+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-07-31&$top=10
10001000
```
10011001

10021002
The response to this request looks like the following example:
@@ -1050,7 +1050,7 @@ The response to this request looks like the following example:
10501050
},
10511051
...
10521052
],
1053-
"nextLink": "https://custom-12qmyn6sm0x.azureiotcentral.com/api/deviceTemplates?api-version=2022-06-30-preview&%24top=1&%24skiptoken=%7B%22token%22%3A%22%2BRID%3A%7EJWYqAKZQKp20qCoAAAAACA%3D%3D%23RT%3A1%23TRC%3A1%23ISV%3A2%23IEO%3A65551%23QCF%3A4%22%2C%22range%22%3A%7B%22min%22%3A%2205C1DFFFFFFFFC%22%2C%22max%22%3A%22FF%22%7D%7D"
1053+
"nextLink": "https://custom-12qmyn6sm0x.azureiotcentral.com/api/deviceTemplates?api-version=2022-07-31&%24top=1&%24skiptoken=%7B%22token%22%3A%22%2BRID%3A%7EJWYqAKZQKp20qCoAAAAACA%3D%3D%23RT%3A1%23TRC%3A1%23ISV%3A2%23IEO%3A65551%23QCF%3A4%22%2C%22range%22%3A%7B%22min%22%3A%2205C1DFFFFFFFFC%22%2C%22max%22%3A%22FF%22%7D%7D"
10541054
}
10551055
```
10561056

@@ -1097,7 +1097,7 @@ $filter=contains(displayName, 'template1) eq false
10971097
The following example shows how to retrieve all the device templates where the display name contains the string `thermostat`:
10981098

10991099
```http
1100-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-06-30-preview&$filter=contains(displayName, 'thermostat')
1100+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-07-31&$filter=contains(displayName, 'thermostat')
11011101
```
11021102

11031103
The response to this request looks like the following example:
@@ -1187,7 +1187,7 @@ $orderby=displayName desc
11871187
The following example shows how to retrieve all the device templates where the result is sorted by `displayName` :
11881188

11891189
```http
1190-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-06-30-preview&$orderby=displayName
1190+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-07-31&$orderby=displayName
11911191
```
11921192

11931193
The response to this request looks like the following example:
@@ -1270,7 +1270,7 @@ You can also combine two or more filters.
12701270
The following example shows how to retrieve the top 2 device templates where the display name contains the string `thermostat`.
12711271

12721272
```http
1273-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-06-30-preview&$filter=contains(displayName, 'thermostat')&$top=2
1273+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-07-31&$filter=contains(displayName, 'thermostat')&$top=2
12741274
```
12751275

12761276
The response to this request looks like the following example:

articles/iot-central/core/howto-manage-devices-with-rest-api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ The response to this request looks like the following example:
202202
You can use ODATA filters to filter the results returned by the list devices API.
203203

204204
> [!NOTE]
205-
> Currently, ODATA support is only available for `api-version=2022-06-30-preview`
205+
> Currently, ODATA support is only available for `api-version=2022-07-31`
206206
207207
### $top
208208

@@ -211,7 +211,7 @@ Use the **$top** to set the result size, the maximum returned result size is 100
211211
Use the following request to retrieve a top 10 device from your application:
212212

213213
```http
214-
GET https://{subdomain}.{baseDomain}/api/devices?api-version=2022-06-30-preview&$top=10
214+
GET https://{subdomain}.{baseDomain}/api/devices?api-version=2022-07-31&$top=10
215215
```
216216

217217
The response to this request looks like the following example:
@@ -239,7 +239,7 @@ The response to this request looks like the following example:
239239
},
240240
...
241241
],
242-
"nextLink": "https://custom-12qmyn6sm0x.azureiotcentral.com/api/devices?api-version=2022-06-30-preview&%24top=1&%24skiptoken=%257B%2522token%2522%253A%2522%252BRID%253A%7EJWYqAOis7THQbBQAAAAAAg%253D%253D%2523RT%253A1%2523TRC%253A1%2523ISV%253A2%2523IEO%253A65551%2523QCF%253A4%2522%252C%2522range%2522%253A%257B%2522min%2522%253A%2522%2522%252C%2522max%2522%253A%252205C1D7F7591D44%2522%257D%257D"
242+
"nextLink": "https://custom-12qmyn6sm0x.azureiotcentral.com/api/devices?api-version=2022-07-31&%24top=1&%24skiptoken=%257B%2522token%2522%253A%2522%252BRID%253A%7EJWYqAOis7THQbBQAAAAAAg%253D%253D%2523RT%253A1%2523TRC%253A1%2523ISV%253A2%2523IEO%253A65551%2523QCF%253A4%2522%252C%2522range%2522%253A%257B%2522min%2522%253A%2522%2522%252C%2522max%2522%253A%252205C1D7F7591D44%2522%257D%257D"
243243
}
244244
```
245245

@@ -289,7 +289,7 @@ $filter=indexof(displayName, 'device1') ge 0
289289
The following example shows how to retrieve all the devices where the display name has index the string `thermostat`:
290290

291291
```http
292-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-06-30-preview&$filter=index(displayName, 'thermostat')
292+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-07-31&$filter=index(displayName, 'thermostat')
293293
```
294294

295295
The response to this request looks like the following example:
@@ -331,7 +331,7 @@ $orderby=displayName desc
331331
The following example shows how to retrieve all the device templates where the result is sorted by `displayName` :
332332

333333
```http
334-
GET https://{subdomain}.{baseDomain}/api/devices?api-version=2022-06-30-preview&$orderby=displayName
334+
GET https://{subdomain}.{baseDomain}/api/devices?api-version=2022-07-31&$orderby=displayName
335335
```
336336

337337
The response to this request looks like the following example:
@@ -366,7 +366,7 @@ You can also combine two or more filters.
366366
The following example shows how to retrieve the top 2 device where the display name contains the string `thermostat`.
367367

368368
```http
369-
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-06-30-preview&$filter=contains(displayName, 'thermostat')&$top=2
369+
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=2022-07-31&$filter=contains(displayName, 'thermostat')&$top=2
370370
```
371371

372372
The response to this request looks like the following example:

articles/iot-central/core/howto-manage-jobs-with-rest-api.md

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ The IoT Central REST API lets you develop client applications that integrate wit
1717
- List jobs and view job details in your application.
1818
- Create jobs in your application.
1919
- Stop, resume, and rerun jobs in your application.
20-
- Schedule Jobs and view scheduled job details in your application.
20+
- Schedule jobs and view scheduled job details in your application.
21+
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.
2123

2224
> [!IMPORTANT]
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`.
25+
> The jobs API is currently in preview. All The REST API calls described in this article should include `?api-version=2022-07-31`.
2426
2527
This article describes how to use the `/jobs/{job_id}` API to control devices in bulk. You can also control devices individually.
2628

@@ -92,7 +94,7 @@ The following table describes the fields in the previous JSON snippet:
9294
Use the following request to retrieve the list of the jobs in your application:
9395

9496
```http
95-
GET https://{your app subdomain}.azureiotcentral.com/api/jobs?api-version=2022-06-30-preview
97+
GET https://{your app subdomain}.azureiotcentral.com/api/jobs?api-version=2022-07-31
9698
```
9799

98100
The response to this request looks like the following example:
@@ -161,7 +163,7 @@ The response to this request looks like the following example:
161163
Use the following request to retrieve an individual job by ID:
162164

163165
```http
164-
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004?api-version=2022-06-30-preview
166+
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004?api-version=2022-07-31
165167
```
166168

167169
The response to this request looks like the following example:
@@ -196,7 +198,7 @@ The response to this request looks like the following example:
196198
Use the following request to retrieve the details of the devices in a job:
197199

198200
```http
199-
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004/devices?api-version=2022-06-30-preview
201+
GET https://{your app subdomain}.azureiotcentral.com/api/jobs/job-004/devices?api-version=2022-07-31
200202
```
201203

202204
The response to this request looks like the following example:
@@ -229,7 +231,7 @@ The response to this request looks like the following example:
229231
Use the following request to create a job:
230232

231233
```http
232-
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006?api-version=2022-06-30-preview
234+
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006?api-version=2022-07-31
233235
```
234236

235237
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.
@@ -238,7 +240,7 @@ The `group` field in the request body identifies a device group in your IoT Cent
238240
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:
239241

240242
```http
241-
PUT https://{subdomain}.{baseDomain}/api/deviceGroups/group1?api-version=2022-06-30-preview
243+
PUT https://{subdomain}.{baseDomain}/api/deviceGroups/group1?api-version=2022-07-31
242244
```
243245

244246
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`.
@@ -324,31 +326,53 @@ The response to this request looks like the following example. The initial job s
324326
Use the following request to stop a running job:
325327

326328
```http
327-
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/stop?api-version=2022-06-30-preview
329+
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/stop?api-version=2022-07-31
328330
```
329331

330332
If the request succeeds, it returns a `204 - No Content` response.
331333

332334
Use the following request to resume a stopped job:
333335

334336
```http
335-
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/resume?api-version=2022-06-30-preview
337+
POST https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/resume?api-version=2022-07-31
336338
```
337339

338340
If the request succeeds, it returns a `204 - No Content` response.
339341

340342
Use the following command to rerun an existing job on any failed devices:
341343

342344
```http
343-
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/rerun/rerun-001?api-version=2022-06-30-preview
345+
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006/rerun/rerun-001?api-version=2022-07-31
344346
```
345347

346348
## Create a scheduled job
347349

348-
Use the following request to create a scheduled job
350+
The payload for a scheduled job is similar to a standard job but includes the following additional fields:
351+
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.
349373

350374
```http
351-
PUT https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-06-30-preview
375+
PUT https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-07-31
352376
```
353377

354378
The following example shows a request body that creates a scheduled job.
@@ -400,10 +424,10 @@ The response to this request looks like the following example:
400424

401425
## Get a scheduled job
402426

403-
Use the following request to get a scheduled job
427+
Use the following request to get a scheduled job:
404428

405429
```http
406-
GET https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-06-30-preview
430+
GET https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-07-31
407431
```
408432

409433
The response to this request looks like the following example:
@@ -432,12 +456,12 @@ The response to this request looks like the following example:
432456
}
433457
```
434458

435-
## List Scheduled Jobs
459+
## List scheduled jobs
436460

437-
Use the following request to get a list of scheduled jobs
461+
Use the following request to get a list of scheduled jobs:
438462

439463
```http
440-
GET https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs?api-version=2022-06-30-preview
464+
GET https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs?api-version=2022-07-31
441465
```
442466

443467
The response to this request looks like the following example:
@@ -492,10 +516,10 @@ The response to this request looks like the following example:
492516

493517
## Update a scheduled job
494518

495-
Use the following request to update a scheduled job
519+
Use the following request to update a scheduled job:
496520

497521
```http
498-
PATCH https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-06-30-preview
522+
PATCH https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-07-31
499523
```
500524

501525
The following example shows a request body that updates a scheduled job.
@@ -540,7 +564,7 @@ The response to this request looks like the following example:
540564
Use the following request to delete a scheduled job
541565

542566
```http
543-
GET https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-06-30-preview
567+
GET https://{your app subdomain}.azureiotcentral.com/api/scheduledJobs/scheduled-Job-001?api-version=2022-07-31
544568
```
545569

546570
## Next steps

0 commit comments

Comments
 (0)