eclipse / kapua

Eclipse Public License 2.0
227 stars 160 forks source link

Support Query objects in REST API query methods #803

Open lorthirk opened 7 years ago

lorthirk commented 7 years ago

We currently have a very limited support for querying entities via the REST APIs: only scopeId, fetchAttributes, offset and limit are supported, so no entity-specific query is possible with the query method. We should implement query objects support in order to enable their use in such methods.

mmb-davidsmith commented 5 years ago

Are there any designs / plans for this feature? We're considering Kapua for a project and this will be important to have in the device registry solution we choose. If there's a clear estimate of the work, it's something we could consider contributing back as part of our evaluations.

Having looked through issues, it seems like #2206 indicates there's been some discussion on the predicate design and impacts it could have in the future. Has that settled down, or is there a clearer picture of the things it could affect in the future? From what I see right now, I could picture a simplified version of something like mongo db's query mechanism (https://docs.mongodb.com/manual/reference/operator/query/)

Coduz commented 5 years ago

Hi @mmb-davidsmith ,

Yes we have some ideas around this. We want to implement this as soon as possible due to the importance that filtering of the results has. This should be implemented in Kapua 1.2.0 (and, according to requests, may backport this in Kapua 1.1.0 which is scheduled to be released by October).

Since we are used to Elasticsearch we would like to follow a similar schema which, looking at MongoDB query mechanism, is similar also to MongoDB.

Do you have a general idea of what would be your proposal?

BTW, we have some basic filtering of the results via query parameters using the GET. Have you tried that? Is it not enough for what you are trying to achieve?

Regards,

Alberto

mmb-davidsmith commented 5 years ago

Hi @Coduz, I don't have a general idea yet. I'll need to dig into the elasticsearch query mechanism to understand how queries would be formulated.

In terms of the general filtering, I've seen it but we will eventually need to be able to filter on things like model, app versions, firmware versions, multiple tags (both and and or operations), and it would also be very nice to be able to query by location.

Is there a public roadmap for 1.2 release? As said, we're still in the evaluation phase, so understanding what sort of timeline we could expect to see features like this in a release would help in the decision making process.

Thanks, David