<div dir="ltr">Hi, Janjaap Bos!<div><br></div><div>I tried jq. But as i have already wrote, some useful fileds like container name are missing in json output...</div></div><br><div class="gmail_quote"><div dir="ltr">чт, 10 нояб. 2016 г. в 14:27, Janjaap Bos <<a href="mailto:janjaapbos@gmail.com">janjaapbos@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">You can pipe the json through jq.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">See: <a href="https://stedolan.github.io/jq/tutorial" class="gmail_msg" target="_blank">https://stedolan.github.io/jq/tutorial</a></div><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">2016-11-10 11:17 GMT+01:00 Andriy Tovstik <span dir="ltr" class="gmail_msg"><<a href="mailto:andriy.tovstik@gmail.com" class="gmail_msg" target="_blank">andriy.tovstik@gmail.com</a>></span>:<br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg">Hi all!<div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><br class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg">During LXD learning i encountered with lack of some features.</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><br class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg">The first one is "raw" output format of lxc list. Currently lxc list supports two formats: table and json. Unfortunately both formats are unusable for scripting.</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg">It is very difficult to pass to script output likes:</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"># lxc list --format table -c n</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">+------------+</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">| NAME |</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">+------------+</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">| mysql-rep1 |</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">+------------+</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">| mysql-rep2 |</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">+------------+</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">| mysql-rep3 |</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg">+------------+</font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><font face="monospace" class="gmail_msg"><br class="gmail_msg"></font></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg">When i try to use json format i see that useful fields like container name are missing in output. May be it will be useful to implement feature like:</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"># lxc list --format raw -c n --no-header</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><span style="font-family:monospace" class="gmail_msg">mysql-rep1</span><br class="gmail_msg"></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><span style="font-family:monospace" class="gmail_msg">mysql-rep2</span><br class="gmail_msg"></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><span style="font-family:monospace" class="gmail_msg">mysql-rep3</span><br class="gmail_msg"></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><br class="gmail_msg"></div></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg">The second feature looks useful is ability run commands on multiplie containers simultaneously. For example:</div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><br class="gmail_msg"></div><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"><div class="m_-4716041546707148171m_4043528725062552382gmail_msg gmail_msg"># lxc exec web-node* -- apt update</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">What do you think about it?<span class="m_-4716041546707148171HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br class="gmail_msg"></font></span></div></div></div></div></div><span class="m_-4716041546707148171HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><div dir="ltr" class="gmail_msg">-- <br class="gmail_msg"></div><div data-smartmail="gmail_signature" class="gmail_msg"><div dir="ltr" class="gmail_msg">WBR, Andriy Tovstik</div></div>
</font></span><br class="gmail_msg"></blockquote></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br class="gmail_msg">
lxc-users mailing list<br class="gmail_msg">
<a href="mailto:lxc-users@lists.linuxcontainers.org" class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br class="gmail_msg">
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br class="gmail_msg"></blockquote></div><br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
lxc-users mailing list<br class="gmail_msg">
<a href="mailto:lxc-users@lists.linuxcontainers.org" class="gmail_msg" target="_blank">lxc-users@lists.linuxcontainers.org</a><br class="gmail_msg">
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">WBR, Andriy Tovstik</div></div>