<div dir="ltr">Thanks Robert Johnson,  great guitarist ;) but i dont want to read log files.<div><br></div><div>Now y try to read the websocket but the return is, "error": "missing secret". I read the doc but i dont understand what is this secret ???</div><div><br><div><div>t=$(/usr/bin/curl  -s -k --cert .config/lxc/client.crt --key .config/lxc/client.key <a href="https://localhost:8443/1.0/containers/wondrous-mackerel/exec">https://localhost:8443/1.0/containers/wondrous-mackerel/exec</a> -X POST -d '{"command": ["/bin/df"], "wait-for-websocket": true, "interactive": false }'|jq .|grep operation |awk -F " " '{print $NF}'| tr -d '"');/usr/bin/curl  -s -k --cert .config/lxc/client.crt --key .config/lxc/client.key https://localhost:8443$t/websocket|jq .</div><div><br></div><div>{</div><div>  "error": "missing secret",</div><div>  "error_code": 500,</div><div>  "type": "error"</div><div>}</div></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-12-23 18:47 GMT+01:00 Robert Johnson <span dir="ltr"><<a href="mailto:robert.j@bendtel.com" target="_blank">robert.j@bendtel.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've been working on obtaining two way communications with the /exec URI, but your needs may more simple then mine.<br>
<br>
When you POST to /exec, you probably want to include the 'record-output' key with a (boolean) value of true. ie<br>
<br>
'{"command": ["df -f /"], "record-output": true}'<br>
<br>
The doc's state that stdout and stderr will be redirected to a log file.<br>
<br>
It doesn't state where the log file is; but I'm willing to bet that the reply will include a path that you can subsequently GET.<br>
<br>
If this works for you, let me know, I'm interested in at least obtaining the output from some commands.<br>
<br>
On 12/23/2016 05:02 AM, laurent ducos wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello.<br>
<br>
Is there a solution to get the return of a command launch by lxd exec API ?<br>
<br>
curl -s --unix-socket /var/lib/lxd/unix.socket<br>
a/1.0/containers/$CONTAINER/ex<wbr>ec -X POST -d '{"command": ["df -f /"]}' |<br>
jq .<br>
<br>
I would like to see something like this in return of the command.<br>
<br>
output: /dev/sda5           15G    4,6G  9,8G  32% /<br>
<br>
<br>
______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainer<wbr>s.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.o<wbr>rg/listinfo/lxc-users</a><br>
<br>
</blockquote>
______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.linuxcontainer<wbr>s.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.o<wbr>rg/listinfo/lxc-users</a></blockquote></div><br></div>