Skip to content

Commit 3457e19

Browse files
committed
changes after review
1 parent b6c93bf commit 3457e19

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

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

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -226,53 +226,39 @@ The response to this request looks like the following example:
226226

227227
## Create a job
228228

229-
Use the following request to retrieve the details of the devices in a job:
229+
Use the following request to create a job:
230230

231231
```http
232232
PUT https://{your app subdomain}.azureiotcentral.com/api/jobs/job-006?api-version=1.2-preview
233233
```
234234

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+
236237

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:
238239

239240
```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
241242
```
242243

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`.
244245

245246
```json
246247
{
247248
"displayName": "Device group 1",
248249
"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"
253251
}
254252
```
255253

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-
265254
The response to this request looks like the following example:
266255

267256
```json
268257
{
269258
"id": "group1",
270259
"displayName": "Device group 1",
271260
"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"
276262
}
277263
```
278264

0 commit comments

Comments
 (0)