Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide APIs to search for features #1421

Open
thjaeckle opened this issue Jul 27, 2022 · 3 comments
Open

Provide APIs to search for features #1421

thjaeckle opened this issue Jul 27, 2022 · 3 comments
Labels
outlook something which could be done in the future

Comments

@thjaeckle
Copy link
Member

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 thjaeckle added the outlook something which could be done in the future label Jul 27, 2022
@Abhijeetmishr
Copy link
Contributor

@thjaeckle can I pick up this & can you guide me through it.

@thjaeckle
Copy link
Member Author

@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?

@Abhijeetmishr
Copy link
Contributor

Abhijeetmishr commented Jan 15, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
outlook something which could be done in the future
Projects
None yet
Development

No branches or pull requests

2 participants