Search an enrollment device on Device Provisioning Service via initialTwin tag

拥有回忆 提交于 2019-12-24 11:43:39

问题


I want to search a specific enrollment device on DPS (based on its 'OL' tag). For that, I use the next piece of code:

QuerySpecification querySpecification = new QuerySpecificationBuilder("*",QuerySpecificationBuilder.FromType.ENROLLMENTS)
            .where("initialTwin.tags.OL='12345678ABCD'")
            .createSqlQuery();
Query query = provisioningServiceClient.createIndividualEnrollmentQuery(querySpecification);

But, when I execute query.next() to fetch the results, always is returning all the devices in the DPS.

I've also tried to use the deviceId in the "where" clause but it returns all devices too.

What I'm doing wrong?


回答1:


Currently the service does not support where clause or any filter options. The best option for now is to retrieve the full list and do a client side filtering.



来源:https://stackoverflow.com/questions/52946958/search-an-enrollment-device-on-device-provisioning-service-via-initialtwin-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!