* dameon: include connection plug/slot attributes in /v2/connections endpoint
* overlord/ifacestate: extend connections state API to include plug/slot attributes
* client: add definitions for connection plug/slot attributes
* cmd/snap: show leading attribute when displaying connections
Some interfaces, such as 'content', have an attribute that is used internally to
match the plug and slot. Display the value of the leading attribute of an
established connection in 'snap connections' output.
* tests/main/snap-connections: account for content interface attributes
Introduce helper structures for marshalling data returned by /v2/connections API
endpoint.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There were two very similar types that deal with JSON encoding of an
interface info. They were used by the legacy and non-legacy response for
/v2/interfaces. One of the types is a subset of the other so we can just
merge them.
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
This patch moves JSON marshaling code from the interface repository to
the daemon API layer. This is the first step towards cleaning up the
return types so that upcoming interface re-mapping patches can stop
changing deeply connected snap.{Plug,Slot}Info types.
Because JSON marshaling requires instance methods we can no longer use
interfaces.Info.MarshalJSON. Instead the code is inlined in the only
place using that type, namely the getInterfaces function in the daemon.
The duplicated tests are removed since this is already tested with
existing API tests.
While doing this I noticed some duplication and some (perhaps) confusing
names, those will be handled in upcoming patches. I added a TODO for
this.
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>