astarte-platform / astarte

Core Astarte Repository
https://docs.astarte-platform.org/
Apache License 2.0
240 stars 46 forks source link

Listing all interface definitions #970

Closed Pavinati closed 2 months ago

Pavinati commented 2 months ago

Tools like the Astarte dashboard, astartectl and the Grafana datasource plugin do not know the whole list of interface beforehand. To provide a better user experience, those tools would need to know the list of interfaces in advance and guide the user based on existing interfaces.

Currently this is not easily achievable because only one interface definition can be retrieved with a single API call. This requires to retrieve the list of interface names, for each of them, retrieve its list of majors, and for each major, retrieve the interface definition.

It would be much easier to list all interfaces in a single query with a parameter detailed=true like we do with the device list.

GET /realmmanagement/interfaces?detailed=true

[
  { name: "foo", major: 0, minor: 1, mappings: [...]},
  { name: "foo", major: 1, minor: 0, mappings: [...]},
  { name: "bar", major: 0, minor: 3, mappings: [...]},
  ...
]