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

Entity Id aliases #161

Open
j-forster opened this issue Sep 14, 2021 · 1 comment
Open

Entity Id aliases #161

j-forster opened this issue Sep 14, 2021 · 1 comment
Assignees
Milestone

Comments

@j-forster
Copy link
Member

The idea of name aliases is taken from docker images tags.

Right now, Waziup sensor-, actuator- and device-Ids can be any arbitrary string when creating any entity.
However, strong unique Ids (either serial or random) should be preferred to avoid Id collisions and to improve database fields (to favor primitive integer keys over string keys).

For that, the server should no longer accept user-defined Ids as entity Ids.

To maintain backwards compatibility, I would like to introduce name aliases.
Name aliases can be used instead of entity Ids at any place (e.g. at URL on API calls). Each entity can have a (maybe empty) set of name aliases, and can be addressed by any of that name. Names can be added or removed from the set through new API endpoints.
Existing endpoints that allow the creation of entities with a specific Id will use that Id as an alias, making it possible to used the initial Id/alias instead of a real Id.

@cdupont
Copy link
Contributor

cdupont commented Sep 14, 2021

We need to include that as part of the new architecture specification.
In particular, entities ids probably need to be the same between the various places (Cloud, GW1, GW2...).
So it's not clear for me at the moment...

Regarding aliases, I think there is already the field "name", which is not necessarily unique.
You can query it like this on the Cloud:

GET /devices?name=XXX

That returns a list of devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants