adrian
adrian

Reputation: 327

Discovering devices in Orion

I'm new in Fi-Ware and I'm trying to do something useful with it. In particular, I've found some of the commands to get some information, but you know that when you ask you need the ID of the device. I haven't found a clear command, with curl, to get the list of the ID in SmartSantander.

Can anyone tell me if he/she could, and what command it is? thank you very much

Upvotes: 1

Views: 339

Answers (3)

LeandroGuillen
LeandroGuillen

Reputation: 518

By what I gather from the comments in other answers, it looks like you are trying to use convenience operations to get a list of entities by ID and using regular expressions.

This is simply not supported (according to this):

It is not possible to use convenience operations to query for lists of entities, entity patterns nor lists of attributes.

You must either:

  • Use convenience operations, but query by type to get a list of entities, or by ID to get individual entities.
  • Use standard operations, which allow you to use regexps in the ID field (such as suggested by Perrolobo).

Upvotes: 1

fgalan
fgalan

Reputation: 12294

The list of the different entities types at orion.lab.fi-ware.org can be found in the table in this section of the Orion Context Broker manual. In that table, you can see the different entity types you have available (e.g. santander:lux , santander:traffic, etc.).

Next, in order to know all the IDs belonging to a given type, please have a look to this question and its answer. Pay special attention to the remark about pagination (by default, you will get a maximun of 20 entities).

Finally, once you know the IDs, you can retrieve them either using patterns (as described in other answer to this question) or direcctly for the ID.

Upvotes: 1

Perrolobo
Perrolobo

Reputation: 663

I think It will depend on how the EntityIds are modeled in that scenario.

The idea could be to use the query context command returning all the Entities matching a given regexp pattern (functionality available just in the ID field). Ideally the EntityId must be namespaced enough to make posible this kind of query requests.

Take into account the "attributeList" param, if you don't want to retrieve all the information from the whole response set.

More info:

https://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_User_and_Programmers_Guide#Query_Context_operation

Upvotes: 2

Related Questions