Search an enrollment device on Device Provisioning

2019-07-23 03:05发布

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条回答
Viruses.
2楼-- · 2019-07-23 03:09

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.

查看更多
登录 后发表回答