Snapd REST API call to match "snap list --all"

I am able to use the snapd REST API “GET /v2/snaps” to show the currently installed active snaps, but I need to get a list of everything that’s installed including old “disabled” snaps like you can see in the output of “snap list --all”.

“GET /v2/snaps” doesn’t have any examples for keys where the “–all” flag could be supplied. Does anyone have an example of how this can be done?

As documented, you get them all by adding select=all to the query string.

Using the http snap, it’s http snapd:///v2/snaps select==all.

Ahh, that was not in the documentation I was looking at.

I was using netcat to talk to the socket too. If anyone else runs in to this, this is how I had to construct the GET:

GET /v2/snaps?select=all

1 Like