ditto
ditto copied to clipboard
Provide APIs to search for features
After having formulated the 2 "bulk API" ideas in #1419 and #1420 I think it becomes quite obvious that in order for those to work Ditto would need an additional API to "search" for features.
Currently Ditto can search and find things, e.g. via HTTP API:
GET /api/2/search/things?filter=eq(attributes/manufacturer,'Eclipse')&fields=thingId
response (list of found thingIds):
[
{"thingId":"org.eclipse.ditto:thing-1"},
{"thingId":"org.eclipse.ditto:thing-3"},
{"thingId":"org.eclipse.ditto:thing-3"}
]
GET /api/2/search/things?filter=eq(attributes/manufacturer,'Eclipse')
--> returns as convenience the actual payload of all found things
It might however be sometimes more relevant to find features instead. This could be an example HTTP API for that:
GET /api/2/search/features?filter=eq(properties/on,true)&fields=thingId,featureId
response (list of found thingId + featureId combinations):
[
{"thingId":"org.eclipse.ditto:thing-1","featureId":"myFeature-0815"},
{"thingId":"org.eclipse.ditto:thing-3","featureId":"myFeature-0815"},
{"thingId":"org.eclipse.ditto:thing-3","featureId":"myFeature-0815"}
]
The response of such a search would of course have to contain:
- matched combination of thingId + featureId
As convenience the payload of the matched features could be returned, e.g. in such a way:
[{
"thingId": "org.eclipse.ditto:thing-1",
"featureId": "myFeature-0815",
"definition": [
],
"properties": {
},
"desiredProperties": {
}
}]
@thjaeckle can I pick up this & can you guide me through it.
@thjaeckle can I pick up this & can you guide me through it.
@Abhijeetmishr could you please explain your motivation to work on this rather complex topic? Are you missing that particular feature from Ditto?
@thjaeckle maybe I could have interpreted this issue wrongly I thought that we have to enhance existing API to support multiple parameter very likely I may me wrong because I am complete newbie to open source and ditto as well.