<div dir="ltr">I wrote too soon! oops generated the wrong api!</div><div class="gmail_extra"><br><div class="gmail_quote">On 28 April 2017 at 20:09, Ben De Luca <span dir="ltr">&lt;<a href="mailto:bdeluca@gmail.com" target="_blank">bdeluca@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I just generated the python API with the cmdline tools. <br><br>I tend to use docker with random things like this from the internet, but with docker installed this will generate a python version of the api. <br><br>docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \<br>    -c /local/swagger.json \<br>    -l python \<br>    -o /local/out/<div><br></div><div>to a folder called local/out </div><div><br></div><div><br><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 28 April 2017 at 20:01, Juan Hernández <span dir="ltr">&lt;<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 04/28/2017 06:00 PM, Ben De Luca wrote:<br>
&gt; before people go writing yet another api client wouldn&#39;t it make sense<br>
&gt; to just define the api client in terms of some thing like swagger<br>
&gt; ? <a href="http://swagger.io/" rel="noreferrer" target="_blank">http://swagger.io/</a><br>
&gt;<br>
<br>
</span>The oVirt API has a formal specification, defined in this project:<br>
<br>
  <a href="https://github.com/oVirt/ovirt-engine-api-model" rel="noreferrer" target="_blank">https://github.com/oVirt/ovirt<wbr>-engine-api-model</a><br>
<br>
The skeleton of the server, the documentation, and the SDKs are<br>
automatically generated from that specification.<br>
<br>
There is also an experimental Swagger/OpenAPI specification, available here:<br>
<br>
  <a href="https://jhernand.fedorapeople.org/ovirt-engine-api-model/swagger.json" rel="noreferrer" target="_blank">https://jhernand.fedorapeople.<wbr>org/ovirt-engine-api-model/swa<wbr>gger.json</a><br>
<br>
However this seems to be too big for Swagger tools (1 MiB, 17000 lines).<br>
Every time I tried to load it into Swagger editor or Swagger UI it just<br>
burns the CPU of the browser and never finishes loading. If you have<br>
some Swagger expertise would be nice if you can take a look and pinpoint<br>
what is the problem.<br>
<span><br>
&gt;<br>
&gt;<br>
&gt; On 28 April 2017 at 18:57, Alexander Wels &lt;<a href="mailto:awels@redhat.com" target="_blank">awels@redhat.com</a><br>
</span><span>&gt; &lt;mailto:<a href="mailto:awels@redhat.com" target="_blank">awels@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On Friday, April 28, 2017 11:41:03 AM EDT Ben De Luca wrote:<br>
&gt;     &gt; does ovirt have a restful api?<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     Yes,<br>
&gt;<br>
&gt;     Its available at https://&lt;engine_url&gt;/ovirt-eng<wbr>ine/api<br>
&gt;<br>
&gt;     In fact the python/java/ruby sdk are just wrappers to calling this api.<br>
&gt;<br>
&gt;     &gt; On 28 April 2017 at 13:43, Fabrice Bacchella<br>
</span>&gt;     &lt;<a href="mailto:fabrice.bacchella@orange.fr" target="_blank">fabrice.bacchella@orange.fr</a> &lt;mailto:<a href="mailto:fabrice.bacchella@orange.fr" target="_blank">fabrice.bacchella@oran<wbr>ge.fr</a>&gt;&gt;<br>
<div><div class="m_-5312137592057239469h5">&gt;     &gt;<br>
&gt;     &gt; wrote:<br>
&gt;     &gt; &gt; I have started to write a custom sdk/cli in python for Ovirt 4. It<br>
&gt;     &gt; &gt; provides helpers and wrapper for the rather raw level sdk4 provided.<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; It&#39;s still a work in progress, but a big improvement from my<br>
&gt;     previous<br>
&gt;     &gt; &gt; version, made for ovirt 3.<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; It allows to write simple commands on shell :<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; $ ./ovcmd host -n hostname maintenance<br>
&gt;     &gt; &gt; $ ./ovcmd host -n hostname activate<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; It also allows to do fine exports:<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; $ ./ovcmd vm -n vmname export os type<br>
&gt;     &gt; &gt; rhel_6x64<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; $ ./ovcmd capabilities -n 4.1 export cpu_types name<br>
&gt;     &gt; &gt; Intel Conroe Family<br>
&gt;     &gt; &gt; Intel Penryn Family<br>
&gt;     &gt; &gt; Intel Nehalem Family<br>
&gt;     &gt; &gt; Intel Westmere Family<br>
&gt;     &gt; &gt; Intel SandyBridge Family<br>
&gt;     &gt; &gt; Intel Haswell-noTSX Family<br>
&gt;     &gt; &gt; Intel Haswell Family<br>
&gt;     &gt; &gt; Intel Broadwell-noTSX Family<br>
&gt;     &gt; &gt; Intel Broadwell Family<br>
&gt;     &gt; &gt; Intel Skylake Family<br>
&gt;     &gt; &gt; AMD Opteron G1<br>
&gt;     &gt; &gt; AMD Opteron G2<br>
&gt;     &gt; &gt; AMD Opteron G3<br>
&gt;     &gt; &gt; AMD Opteron G4<br>
&gt;     &gt; &gt; AMD Opteron G5<br>
&gt;     &gt; &gt; IBM POWER8<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; Or to get a display console on a mac os:<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; $open $(./ovcmd vm -n vmname console )<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; It can be found at<br>
&gt;     <a href="https://github.com/fbacchella/ovirtcmd/tree/sdk4" rel="noreferrer" target="_blank">https://github.com/<wbr>fbacchella/ovirtcmd/tree/sdk4</a><br>
&gt;     &lt;<a href="https://github.com/fbacchella/ovirtcmd/tree/sdk4" rel="noreferrer" target="_blank">https://github.com/fbacchell<wbr>a/ovirtcmd/tree/sdk4</a>&gt;<br>
&gt;     &gt; &gt; It&#39;s still works in progress, I need to finish to remove sdk3 code.<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; Some example of object written to sdk4 can be found at:<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt;<br>
&gt;     <a href="https://github.com/fbacchella/ovirtcmd/blob/sdk4/ovlib/vms/__init__.py" rel="noreferrer" target="_blank">https://github.com/<wbr>fbacchella/ovirtcmd/blob/sdk4/<wbr>ovlib/vms/__init__.py</a><br>
&gt;     &lt;<a href="https://github.com/fbacchella/ovirtcmd/blob/sdk4/ovlib/vms/__init__.py" rel="noreferrer" target="_blank">https://github.com/fbacchell<wbr>a/ovirtcmd/blob/sdk4/ovlib/<wbr>vms/__init__.py</a>&gt;<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; &gt; ______________________________<wbr>_________________<br>
&gt;     &gt; &gt; Users mailing list<br>
</div></div>&gt;     &gt; &gt; <a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a> &lt;mailto:<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a>&gt;<br>
&gt;     &gt; &gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
&gt;     &lt;<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailm<wbr>an/listinfo/users</a>&gt;<br>
<div class="m_-5312137592057239469HOEnZb"><div class="m_-5312137592057239469h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
&gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>