<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 7, 2015 at 3:57 PM, Sandro Bonazzola <span dir="ltr"><<a href="mailto:sbonazzo@redhat.com" target="_blank">sbonazzo@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Oct 7, 2015 at 3:51 PM, Piotr Kliczewski <span dir="ltr"><<a href="mailto:pkliczew@redhat.com" target="_blank">pkliczew@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Sandro,<br><br></div>The API hasn't changed between xmlrpc and jsonrpc. The only difference is format how we provide it.<br></div>We need to update the API docs that we have and there is a bit of work (hopefully) scheduled for 4.0<br></div>to define api interface between the engine and vdsm with validation on both sides.<br><br></div>There is a bit of ongoing work to provide jsonrpc client for vdsm and you can code how to use it here [1].<br></div>There is a bit of work that needs to be done in order to merge it but you can take a look at start to play<br></div>with it.<br><div><div><div><br></div><div>Thanks,<br></div><div>Piotr<br></div><div><br><br>[1] <a href="https://gerrit.ovirt.org/#/c/45789" target="_blank">https://gerrit.ovirt.org/#/c/45789</a></div></div></div></div></blockquote><div><br></div><div><br></div></span><div>Ok, so, looking at your URL, a first difference is:</div><div><br></div><div>from vdsm import jsonrpcvdscli</div><div> instead of <br></div><div>from vdsm import vdscli<br></div><div><br></div><div>a second one is that connect API differs:</div><div><br></div><div><div>In [3]: xmlcli = vdscli.connect()</div><div><br></div><div>In [4]: jsoncli = jsonrpcvdscli.connect()</div><div>---------------------------------------------------------------------------</div><div>TypeError Traceback (most recent call last)</div><div><ipython-input-4-71cd6ff663fb> in <module>()</div><div>----> 1 jsoncli = jsonrpcvdscli.connect()</div><div><br></div><div>TypeError: connect() takes at least 1 argument (0 given)</div></div><div><br></div><div>so they're not really coming without changes :-)</div><span class=""><div><br></div><div><br></div></span></div></div></div></blockquote><div><br></div><div>Small changes required since new jsonrpcvdscli is not one to one replacement.<br></div><div>If you have any suggestions/improvements please let me know and we can change<br></div><div>it to be more usable.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><br></div></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 7, 2015 at 3:21 PM, Sandro Bonazzola <span dir="ltr"><<a href="mailto:sbonazzo@redhat.com" target="_blank">sbonazzo@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div>Hi,</div><div>I'm looking at <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1228641" style="color:rgb(102,153,204);text-decoration:none;font-family:'DejaVu Sans','Liberation Sans',sans-serif" target="_blank">Bug 1228641</a><span style="color:rgb(0,0,0);font-family:'DejaVu Sans','Liberation Sans',sans-serif;background-color:rgb(208,208,208)"> -</span><span style="color:rgb(0,0,0);font-family:'DejaVu Sans','Liberation Sans',sans-serif"> <span>[RFE] Switch from XML-RPC to JSON-RPC API </span></span><span style="color:rgb(0,0,0);font-family:'DejaVu Sans','Liberation Sans',sans-serif">and I'm searching google about "vdsm json rpc API documentation" without success.</span></div><div><font face="DejaVu Sans, Liberation Sans, sans-serif" color="#000000"><br></font></div><div><font face="DejaVu Sans, Liberation Sans, sans-serif" color="#000000">I've seen /usr/share/doc/vdsm-jsonrpc/vdsm-api.html shipped within vdsm-jsonrpc rpm but it doesn't explain how to use the api.</font></div><div><br></div>/usr/lib/python2.7/site-packages/vdsmapi.py looks useless<div><br></div><div>/usr/share/vdsm/rpc/ are not public API but something only vdsm process should use.<br></div><div><br></div><div>The feature pages <a href="http://www.ovirt.org/Features/Design/JsonRpc3.5" target="_blank">http://www.ovirt.org/Features/Design/JsonRpc3.5</a> and <a href="http://www.ovirt.org/Features/Design/JsonRpc" target="_blank">http://www.ovirt.org/Features/Design/JsonRpc</a> are incomplete or outdated and miss proper testing section specifying how to test the API.</div><div><br></div><div>VDSM API pages are outdated or incomplete:</div><div><a href="http://www.ovirt.org/Vdsm_API" target="_blank">http://www.ovirt.org/Vdsm_API</a><br></div><div><a href="http://www.ovirt.org/VDSM_Stable_API_Plan" target="_blank">http://www.ovirt.org/VDSM_Stable_API_Plan</a><br></div><div><a href="http://www.ovirt.org/Vdsm_API_Schema" target="_blank">http://www.ovirt.org/Vdsm_API_Schema</a><br></div><div><br></div><div>Any hint on how to use VDSM JSON RPC API anywhere?<br></div><div>Can someone please write a clear VDSM API reference documentation?</div><div><br></div><div>Piotr, as a kickstart, can you give me a code sample for connecting to vdsm and call getVdsCaps using jsonrpc?</div><div><br></div><div>Thanks,</div><span><font color="#888888"><div><br></div><div><div>-- </div><div><div dir="ltr"><div><div dir="ltr">Sandro Bonazzola<br>Better technology. Faster innovation. Powered by community collaboration.<br>See how it works at <a href="http://redhat.com" target="_blank">redhat.com</a><br></div></div></div></div>
</div></font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></span></div><span class=""><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr">Sandro Bonazzola<br>Better technology. Faster innovation. Powered by community collaboration.<br>See how it works at <a href="http://redhat.com" target="_blank">redhat.com</a><br></div></div></div></div>
</span></div></div>
</blockquote></div><br></div></div>