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
+8-22Lines changed: 8 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,53 +226,39 @@ The response to this request looks like the following example:
226
226
227
227
## Create a job
228
228
229
-
Use the following request to retrieve the details of the devices in a job:
229
+
Use the following request to create a job:
230
230
231
231
```http
232
232
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006?api-version=1.2-preview
233
233
```
234
234
235
-
The request body requires the `group` of the device group that the job applies to.
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.
236
+
236
237
237
-
Use the following request to create a new device group.
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/{deviceGroupId}?api-version=1.2-preview
241
+
PUT https://{subdomain}.{baseDomain}/api/deviceGroups/group1?api-version=1.2-preview
241
242
```
242
243
243
-
When you create a device group, you define a `filter` that selects the devices to add to 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" template where the `provisioned` property is true
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`.
244
245
245
246
```json
246
247
{
247
248
"displayName": "Device group 1",
248
249
"description": "Custom device group.",
249
-
"filter": "SELECT * FROM devices WHERE $template = \"dtmi:modelDefinition:dtdlv2\" AND $provisioned = true",
250
-
"organizations": [
251
-
"seattle"
252
-
]
250
+
"filter": "SELECT * FROM devices WHERE $template = \"dtmi:modelDefinition:dtdlv2\" AND $provisioned = true"
253
251
}
254
252
```
255
253
256
-
The request body has some required fields:
257
-
258
-
-`@displayName`: Display name of the device group.
259
-
-`@filter`: Query defining which devices should be in this group.
260
-
-`@etag`: ETag used to prevent conflict in device updates.
261
-
-`description`: Short summary of device group.
262
-
263
-
The organizations field is only used when an application has an organization hierarchy defined. To learn more about organizations, see [Manage IoT Central organizations](howto-edit-device-template.md)
264
-
265
254
The response to this request looks like the following example:
266
255
267
256
```json
268
257
{
269
258
"id": "group1",
270
259
"displayName": "Device group 1",
271
260
"description": "Custom device group.",
272
-
"filter": "SELECT * FROM devices WHERE $template = \"dtmi:modelDefinition:dtdlv2\" AND $provisioned = true",
273
-
"organizations": [
274
-
"seattle"
275
-
]
261
+
"filter": "SELECT * FROM devices WHERE $template = \"dtmi:modelDefinition:dtdlv2\" AND $provisioned = true"
0 commit comments