I am looking for REST API counterpart of snap connections <snap-name>
I know there is GET /v2/connections/ But this is very exhaustive. I am looking for an option that gives me o/p for specific snap. Also issue with /v2/connections is that it does not include the interfaces that are not connected for a snap, whereas snap connections <snap-name> gives this info.
The /v2/connections end point takes query parameters to restrict its output. For instance, I can limit the results to only show connections involving a particular snap (either on the plug or slot side):
I’m sorry, but the Snapd REST API did not include a proper description of the parameters you can pass to the /v2/connections endpoint. I’ve update the documentation now. Feel free to ask if you have any further questions regarding the API.
Thanks @mborzecki@jamesh
Above information helped me to narrow down the result to the snap I am interested in. But is there a way to combine snap=<name> and select=all parameter as with only snap=<name> the o/p does not include interfaces that are not connected.
The requirement that I have is to find if any interface(s) of the snap is(are) not connected.
In above case, I only see the network interface in o/p of 'curl -sS --unix-socket /run/snapd.socket http://localhost/v2/connections?snap=platform-qa&select=all'
Are you quoting the URL? If not, you might be putting the curl invocation into the background and setting select=all as an environment variable in your shell.