Reputation: 61
I'm trying to create device groups to eventually create a Job with this particular device group to send a reboot command to all the devices in it. I'm using the IoT Central API REST for this with the URL looking like this (which is how it is on their documentation): PUT https://{subdomain}.{baseDomain}/api/deviceGroups/{uuidCreatedByMe}?api-version=2022-07-31
The body on the request looks something like this:
{
description: `Pulses' group to be rebooted, created at ${DateTime.now().toISO()}`,
displayName: `Reboot group ${deviceGroupId}`,
filter: query,
}
And the query is very similar to this
SELECT * FROM devices WHERE $template = "templateId" AND $id IN ["deviceId1", "deviceId2"]
But for some reason, when I send the request, it responds with an error:
Request failed with status 500 and error: {
"code": "InternalServerError",
"message": "Something went wrong on our end. Please try again. You can contact support at https://aka.ms/iotcentral-support. Please include the following information. Request ID: requestId, Time: Tue, 06 Sep 2015 477:10:01 GMT.",
"requestId": "requestId",
"time": "Tue, 06 Sep 2022 16:10:01 GMT"
}
However, when I try to create a Job and get the list of device groups, this brings me all the device groups I have been attempting to create, but it doesn't let me see the number of devices and doesn't allow me to continue creating the Job. And then, I request through the REST API to delete such device group with one of the ids, and it deletes it just fine.
My question would be...
Is this related to the query or what exactly?...
Because according to their documentation this is a valid query
Upvotes: 1
Views: 163
Reputation: 26
I can confirm that it is not supported yet, try to use ($id= '' OR $id = '')
to work around now.
Upvotes: 0