event-gateway icon indicating copy to clipboard operation
event-gateway copied to clipboard

Add support for fetching list of spaces being used

Open kenfdev opened this issue 6 years ago • 5 comments

This is a Feature Proposal

For feature proposals, please answer the following question:

  • What is the use case that should be solved? The more detail you describe this in the easier it is to understand for us.

Use cases

Possibly an admin would like to see what functions and subscriptions are present.

Currently we can fetch subscriptions and functions with the following API.

GET <Configuration API URL>/v1/spaces/<space>/subscriptions
GET <Configuration API URL>/v1/spaces/<space>/functions

But we need to know the <space> before hand. It'd be nice if there is an API like the following:

GET <Configuration API URL>/v1/spaces

which returns a list of spaces already in use. If we can retrieve this, it's possible to retrieve all the informations (spaces, functions, subscriptions) via the API.

Would like to know if this is by design or not or if I'm missing something.
Thanks!

kenfdev avatar Jun 04 '18 08:06 kenfdev

Hey @kenfdev, that's a good idea and would make it easier to discover the full setup of your Event Gateway.

@mthenw What are your thoughts?

alexdebrie avatar Jun 04 '18 19:06 alexdebrie

Totally +1 for that. That's natural step forward in Config API.

mthenw avatar Jun 05 '18 07:06 mthenw

@alexdebrie @mthenw Thanks! Ping me if there's any way I can help.

Also, a bit off topic but should the user be able to create and delete a space via an API?

POST <Configuration API URL>/v1/spaces
DELETE <Configuration API URL>/v1/spaces/<space>

This will probably lead to checking the existence of a space when creating functions and subscriptions which is a breaking change in the workflow.

One thing I though of is that, currently one can easily have a typo in the and accidentally create a space. Perhaps it'll be better to have a CREATE and DELETE workflow for spaces. WDYT?

(I think this should be a different issue but didn't want to pollute the tracker much)

kenfdev avatar Jun 05 '18 07:06 kenfdev

@kenfdev IMHO until there is no properties/options that can be set on space level we shouldn't provide CRUD API for spaces and space should be created implicitly. Right now space without functions or subs doesn't provide any value.

mthenw avatar Jun 05 '18 07:06 mthenw

@mthenw Thanks again for the fast response. Totally understand your opinion 👍

kenfdev avatar Jun 05 '18 08:06 kenfdev