FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
50 stars 42 forks source link

Request for the implementation of the "idPattern" parameter in GET /csourceRegistrations endpoint #1652

Closed ravaga closed 2 weeks ago

ravaga commented 1 month ago

In the aerOS project, we are creating a set of Context Source Registrations to enable the federation of different instances of Orion-LD context brokers. The ID of these CSRs follow the same pattern, which starts with urn:aeros:federation. Therefore, we would like to use the idPattern query parameter to filter the present CSRs in the broker in order to retrieve only the CSRs related with aerOS.

Please @kzangeli , could you implement it?

kzangeli commented 1 month ago

From what I can see, this feature is already implemented. Have you tested it? If so and you've seen some errors, please post here.

The query would look like this:

GET /ngsi-ld/v1/csourceRegistrations?idPattern=urn:aeros:federation.*
kzangeli commented 1 month ago

Wait. You aren't asking for the "idPattern" parameter (that is already implemented). The idPattern parameter operates on entity ids. Those inside the "information" array - entity ids.

What you are requesting is to filter on registration ids and using a regex·

This feature does not exist in NGSI-LD. I could implement it, just for aerOS, but there is a different mechanism we could use instead. One I have not implemented yet, but, better to implement that, as it is "valid" NGSI-LD than some other non-NGSI-LD mechanism.

I'm referring to a parameter called "csf", Too long to explain here. Let's set up a meeting,

ravaga commented 2 weeks ago

Understood Ken, I will add a custom attribute to the registration to then use it as the value of the csf parameter for filtering (I'll probably add a boolean value to just check if it exists)

ravaga commented 2 weeks ago

Tested and working. I've added to the CSRs a couple of custom attributtes (e.g. customAttr1 of type boolean and customAttr2 of type string), and then I've managed to filter them by using the csf query parameter (e.g. csf=customAttr1==true and customAttr1==true&customAttr2!="test")