many: model and expose interface meta-data. #3349

Merged
merged 2 commits into from May 19, 2017

Conversation

Projects
None yet
3 participants
Contributor

zyga commented May 18, 2017

This branch adds a new, optional, method that any snapd interface can
implement. The new method allows returning a structure with various
meta-data about the interface. For now only the Description field is
present.

This could be used for constructing various useful flows, like giving
interfaces proper descriptions, documentations URLs, information when it
was first added, possibly even static descriptions of desired
one-to-many connection semantics for slots.

In this experimental patch the common interface is extended to convey
the meta-data, a few interfaces are patched to document themselves and
the daemon and client APIs are extended to carry this information. The
command "snap interfaces -i IFACE" will now display the description of
the interface if one is available (try with network).

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

yusss

client/interfaces_test.go
@@ -92,6 +97,11 @@ func (cs *clientSuite) TestClientInterfaces(c *check.C) {
},
},
},
+ MetaData: map[string]client.InterfaceMetaData{
+ "bool-file": client.InterfaceMetaData{
@chipaca

chipaca May 18, 2017

Member

pretty sure this'll fail gofmt (drop the spurious client.InterfaceMetadata)

@zyga

zyga May 18, 2017

Contributor

This is gofmt -s (simplify) which is not default. Corrected, thanks!

zyga added some commits May 9, 2017

many: model and expose interface meta-data.
This branch adds a new, optional, method that any snapd interface can
implement. The new method allows returning a structure with various
meta-data about the interface. For now only the Description field is
present.

This could be used for constructing various useful flows, like giving
interfaces proper descriptions, documentations URLs, information when it
was first added, possibly even static descriptions of desired
one-to-many connection semantics for slots.

In this experimental patch the common interface is extended to convey
the meta-data, a few interfaces are patched to document themselves and
the daemon and client APIs are extended to carry this information. The
command "snap interfaces -i IFACE" will now display the description of
the interface if one is available (try with network).

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
many: fix typos
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Looks good!

@zyga zyga merged commit 7b2b7d2 into snapcore:master May 19, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@zyga zyga deleted the zyga:feature/iface-metadata branch May 19, 2017

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