cmd/snap,client: add snap set and snap get commands#1828
Conversation
This commit adds the `snap set` and `snap get` commands and client changes required to communicate with the API. The API changes themselves will be added in a subsequent commit. Updates: #1596629 Signed-off-by: Kyle Fazzari <kyle@canonical.com>
| ) | ||
|
|
||
| // SetConfig requests a snap to set the provided config. | ||
| func (client *Client) SetConfig(snapName string, config map[string]interface{}) (changeID string, err error) { |
There was a problem hiding this comment.
Reading this PR made me wonder: since we're shortening the word anyway, can we try to build the feature everywhere around the "conf" term instead of "config"? It's nice, shorter, and reminds of ".conf".
Also, can we please call the parameter above "patch" rather than "conf" or "config", to make it clear that this is not a full config?
There was a problem hiding this comment.
Alright done (I think). Let me know if I missed any!
|
Thanks for breaking it down. This is looking good. General ideas, and hopefully nothing too controversial. |
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Also update help messages for get and set subcommands. Signed-off-by: Kyle Fazzari <kyle@canonical.com>
…p_config_commands
|
LGTM |
| if err != nil { | ||
| return "", err | ||
| } | ||
| return client.doAsync("PUT", "/v2/snaps/"+snapName+"/conf", nil, nil, bytes.NewReader(b)) |
There was a problem hiding this comment.
where are these endpoints documented?
There was a problem hiding this comment.
I'll document them in the PR that adds them (queued up after this one).
|
LGTM, FWIW |
This PR updates LP: #1596629 by adding the
snap setandsnap getcommands and client changes required to communicate with the API. The API changes themselves will be added in a subsequent PR.