lorawan-stack icon indicating copy to clipboard operation
lorawan-stack copied to clipboard

Support entity tags

Open kschiffer opened this issue 3 years ago • 1 comments

Summary

As a means of logically grouping entities and assigning different treatments or performing batch actions based on such groups, we should introduce entity tags.

Current Situation

There is no way of grouping entities other than maybe assigning IDs with a prefix, which is only an implicit way of grouping.

Why do we need this? Who uses it, and when?

As stated above, tags are a way of grouping entities. Such grouping has several benefits:

  • Enabling explicit visual grouping as a means of organizing an entity fleet logically and facilitate device fleet management.
  • Improving entity search.
  • Assigning different settings to groups of end devices based on tags. For e.g. we could make integrations assignable by tags so that multiple integrations can be set up for different slices of an application's end devices.
  • Selecting devices for batch operations, such as moving devices between applications or deleting end devices in batch.

Proposed Implementation

This issue should be scoped to only the tags themselves and their assignment to entities.

We would need a new tag model which contains information about the tag such as:

  • ID
  • Name
  • Description
  • Color

Then we need to add an array field to the entities tags which contains the list of assigned tag IDs.

To assign the tags, we would require an API that allows adding/removing a list of tags to/from a list of entities.

Then eventually, we need to update our list/search APIs to include filtering by tag IDs.

@adriansmares @johanstokking assigning you initially to provide some input and to reassign as appropriate.

Contributing

  • [X] I can help by doing more research.
  • [X] I can help by implementing the feature after the proposal above is approved.
  • [X] I can help by testing the feature before it's released.

Code of Conduct

kschiffer avatar Aug 17 '22 11:08 kschiffer

As discussed offline, this would work very much like GitHub labels. This would indeed not just be for end devices, but for other entities as well, most notably gateways and applications.

This is different from attributes in the sense that this is a list of independent values, and we should efficiently filter on the presence of a value. Since TTS would have first class support for this, it wouldn't be an attribute anyway, as those are custom user defined things.

johanstokking avatar Aug 17 '22 14:08 johanstokking