LXD Rest API run command and get output


Running commands via the API works fine.
But how can I get a result/output of the command I ran?

I played around with it, but never could get any output.


I’m not sure what you mean, can you provide some examples of what you are doing?

To put it simply, I want to run ls -l on a container and want to get that specific output.

However, I was not able to get a working example, where I can get the result as output.
Any idea or any example how this can be done?

You can either use the - exec api (enable recording the output & then get the output from the log)

Exec API
Files API

Or you can use the files api


Turns out, the reason why this is not working, was that THAT ONE FUCKING THING was RAW and not JSON. But why? EVERYTHING is JSON, unexpected

Case closed.