Missing API documentation for /v2/snaps/[name] POST

Bug #1633111 reported by Aleix Pol
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Undecided
Unassigned

Bug Description

I'm implementing snapd support for KDE's Discover Software Center.

I'm using the API from here:
https://github.com/snapcore/snapd/blob/master/docs/rest.md

/v2/snaps/[name] POST variant has a list of actions that can be performed but they're not documented. install is obvious but revert, enable, disable aren't so much.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1633111] [NEW] Missing API documentation for /v2/snaps/[name] POST

On 13/10/16 17:03, Aleix Pol wrote:
> I'm implementing snapd support for KDE's Discover Software Center.

Great to see this in progress, shout if I can help! Will be seeing
everyone next week at the snap community sprint, we can tap someone on
the shoulder then for you if you haven't had a good answer by Monday,
unless you are planning to be there already :)

Mark

Revision history for this message
John Lenton (chipaca) wrote :

Gustavo was working on moving those docs to a wiki, so I'll defer to him as to how best to address the bug.

Meanwhile, to unblock you:

* install installs a snap :-) you can specify a channel (one of stable, candidate, beta, edge), devmode (a boolean), and jailmode (a boolean), and a revision (if it's your snap).

* remove removes all revisions of a snap, including associated data. You can also ask to remove a single revision, which will also remove the data for just that revision. (the revision field seems to be undocumented at the moment, also)

* refresh queries the store for the latest revision, downloads it if you don't already have it, and switches you to it if it's not what you're already on. You can also specify a revision, which must be available on disc or be current in the channel map, unless you own the snap in which case you can ask for any revision that you've published. You can modify exactly what you get (and how it's installed) by specifying channel, devmode, and jailmode. Note that mode flags are dropped unless you explicitly ask for them when you refresh a single snap.

* revert moves a snap back to whatever was current before the latest refresh. You can also specify a revision to revert to, which must be available on disc. You need to specify the mode if you want to override whatever is the default (ie devmode, jailmode, etc). Revision-specific data is left alone on revert (ie if you are on revision A and refresh to B but then decide to revert back to A for whatever reason you get the A data back).

* disabling a snap means to stop its services and remove its binaries from your path. The snap is still on the system and mounted, but not "active"; it has no current revision.

* enabling a snap undoes what disable just did :-)

Phew. I think that covers it, but I probably forgot or jumbled some things, so let me know.

Revision history for this message
Aleix Pol (aleixpol-kde) wrote :

That was helpful, thanks. I'll see tomorrow if I can get it working so that I can have something to show for in the Hague.

See you.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

The REST API is currently documented on the snapd wiki: https://github.com/snapcore/snapd/wiki/REST-API (though it might move to the forum eventually). The particular request is https://github.com/snapcore/snapd/wiki/REST-API#post-v2snapsname

I'm marking it as fix released. Please feel free to reopen if something is missing.

affects: snappy → snapd
Changed in snapd:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.