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

Add devOps api function to get a list of all configured connections #605

Closed
patrickse opened this issue Jan 28, 2020 · 5 comments · Fixed by #975
Closed

Add devOps api function to get a list of all configured connections #605

patrickse opened this issue Jan 28, 2020 · 5 comments · Fixed by #975
Labels
community-interest Issues which were explicitly asked for by the Ditto community.
Milestone

Comments

@patrickse
Copy link
Contributor

According to @thjaeckle there´s currently no way to use the API to list all the configured connections. The only way to get an overview is querying the connectivity mongodb.

I think, adding a new devOps command to list all configured connections would make the whole connectiviy-api more feature complete and makes ditto connections management a lot easier.

Maybe something like this...

{
    "targetActorSelection": "/system/sharding/connection",
    "headers": {
      "aggregate": false
    },
    "piggybackCommand": {
        "type": "connectivity.commands:listConnections"
    }
}

The response could contain an array of elements with the following properties:

  • connectionId
  • connectionStatus
  • createdOn

That is probably enough to identify the configured connections at the moment.

@Yannic92
Copy link
Contributor

I suggest to name this command "connectivity.commands:retrieveConnections" to match the name of RetrieveThings for example.

Regarding the content of the response I'd either put only connectionIds in the response or the full JSON of all connections.

The latter would result in a big message, which could be a problem because of the maximum message size in the ditto cluster.

Put these selected fields in the response seems a bit randomly chosen to me.

Would it be enough for your use case to get a list of all connection IDs which you could then retrieve one by one?

@thjaeckle thjaeckle added the community-interest Issues which were explicitly asked for by the Ditto community. label Jan 28, 2020
@patrickse
Copy link
Contributor Author

I am fine with the name of the command :) good point to reuse the naming scheme.

And I am pretty sure returning the complete connections details during retrieveConnections will make things much more complicated. ;)

Returning just the connectionId is ok for me. 👍

@thjaeckle
Copy link
Member

@Yannic92 I'm not sure if retrieveConnections would lead to confusions as retrieveThings requires a list of IDs passed in and as a result you get the actual payload of the ThingIDs you asked for.

So maybe intentionally choosing another term like

  • listConnectionIds
  • findConnectionIds
    etc. could be beneficial.

@Yannic92
Copy link
Contributor

@thjaeckle Valid point. RetrieveAttributes, RetrieveFeatures, RetrieveThings are all commands that receive something based on a given information.
I'm don't want to pedantic about naming, just one last suggestion is RetrieveAllConnectionIds.
It is consistent with the "Retrieve"-naming scheme and it indicates that it contains all existing connection IDs.

@thjaeckle
Copy link
Member

When implementing this, getting all "connection IDs" should be queried by using the Akka persistene read journal readJournal.currentPersistenceIds();, see:
https://doc.akka.io/docs/akka/2.5.30/persistence-query.html#persistenceidsquery-and-currentpersistenceidsquery

The new RetrieveAllConnectionIds command should be handled by e.g. a new actor in the "connectivity" service.

dguggemos pushed a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
dguggemos pushed a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
…ds of all connections

Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
dguggemos pushed a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
…th one bd query from connection-snap collection

Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
dguggemos pushed a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
dguggemos pushed a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
dguggemos added a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
…r, add necessary config, add actor test, add unit for new retrieve command/response

Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
VadimGue added a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
VadimGue added a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
…ds of all connections

Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
VadimGue added a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
…th one bd query from connection-snap collection

Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
VadimGue added a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
VadimGue added a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
VadimGue pushed a commit to bosch-io/ditto that referenced this issue Feb 18, 2021
…r, add necessary config, add actor test, add unit for new retrieve command/response

Signed-off-by: Dominik Guggemos <dominik.guggemos@bosch.io>
@thjaeckle thjaeckle added this to the 2.0.0 milestone Feb 19, 2021
VadimGue added a commit to bosch-io/ditto that referenced this issue Feb 23, 2021
Signed-off-by: Vadim Guenther <vadim.guenther@bosch.io>
yufei-cai added a commit that referenced this issue Feb 24, 2021
[#605] Add devOps api function to get a list of all configured connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-interest Issues which were explicitly asked for by the Ditto community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants