[ovirt-users] Ovirt 4, the missing python sdk

Ben De Luca bdeluca at gmail.com
Fri Apr 28 17:22:33 UTC 2017


ok this works.

docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
    -i /local/swagger.json \
    -c /local/config.json \
    -l python \
    -o /local/out/


where config looks like

{"packageName": "overt",
 "packageVersion": "0.9"
}






On 28 April 2017 at 20:11, Ben De Luca <bdeluca at gmail.com> wrote:
>
> I wrote too soon! oops generated the wrong api!
>
> On 28 April 2017 at 20:09, Ben De Luca <bdeluca at gmail.com> wrote:
>>
>> I just generated the python API with the cmdline tools.
>>
>> 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.
>>
>> docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate
\
>>     -c /local/swagger.json \
>>     -l python \
>>     -o /local/out/
>>
>> to a folder called local/out
>>
>>
>>
>>
>> On 28 April 2017 at 20:01, Juan Hernández <jhernand at redhat.com> wrote:
>>>
>>> On 04/28/2017 06:00 PM, Ben De Luca wrote:
>>> > before people go writing yet another api client wouldn't it make sense
>>> > to just define the api client in terms of some thing like swagger
>>> > ? http://swagger.io/
>>> >
>>>
>>> The oVirt API has a formal specification, defined in this project:
>>>
>>>   https://github.com/oVirt/ovirt-engine-api-model
>>>
>>> The skeleton of the server, the documentation, and the SDKs are
>>> automatically generated from that specification.
>>>
>>> There is also an experimental Swagger/OpenAPI specification, available
here:
>>>
>>>   https://jhernand.fedorapeople.org/ovirt-engine-api-model/swagger.json
>>>
>>> However this seems to be too big for Swagger tools (1 MiB, 17000 lines).
>>> Every time I tried to load it into Swagger editor or Swagger UI it just
>>> burns the CPU of the browser and never finishes loading. If you have
>>> some Swagger expertise would be nice if you can take a look and pinpoint
>>> what is the problem.
>>>
>>> >
>>> >
>>> > On 28 April 2017 at 18:57, Alexander Wels <awels at redhat.com
>>> > <mailto:awels at redhat.com>> wrote:
>>> >
>>> >     On Friday, April 28, 2017 11:41:03 AM EDT Ben De Luca wrote:
>>> >     > does ovirt have a restful api?
>>> >     >
>>> >
>>> >     Yes,
>>> >
>>> >     Its available at https://<engine_url>/ovirt-engine/api
>>> >
>>> >     In fact the python/java/ruby sdk are just wrappers to calling
this api.
>>> >
>>> >     > On 28 April 2017 at 13:43, Fabrice Bacchella
>>> >     <fabrice.bacchella at orange.fr <mailto:fabrice.bacchella at orange.fr>>
>>> >     >
>>> >     > wrote:
>>> >     > > I have started to write a custom sdk/cli in python for Ovirt
4. It
>>> >     > > provides helpers and wrapper for the rather raw level sdk4
provided.
>>> >     > >
>>> >     > > It's still a work in progress, but a big improvement from my
>>> >     previous
>>> >     > > version, made for ovirt 3.
>>> >     > >
>>> >     > > It allows to write simple commands on shell :
>>> >     > >
>>> >     > > $ ./ovcmd host -n hostname maintenance
>>> >     > > $ ./ovcmd host -n hostname activate
>>> >     > >
>>> >     > > It also allows to do fine exports:
>>> >     > >
>>> >     > > $ ./ovcmd vm -n vmname export os type
>>> >     > > rhel_6x64
>>> >     > >
>>> >     > > $ ./ovcmd capabilities -n 4.1 export cpu_types name
>>> >     > > Intel Conroe Family
>>> >     > > Intel Penryn Family
>>> >     > > Intel Nehalem Family
>>> >     > > Intel Westmere Family
>>> >     > > Intel SandyBridge Family
>>> >     > > Intel Haswell-noTSX Family
>>> >     > > Intel Haswell Family
>>> >     > > Intel Broadwell-noTSX Family
>>> >     > > Intel Broadwell Family
>>> >     > > Intel Skylake Family
>>> >     > > AMD Opteron G1
>>> >     > > AMD Opteron G2
>>> >     > > AMD Opteron G3
>>> >     > > AMD Opteron G4
>>> >     > > AMD Opteron G5
>>> >     > > IBM POWER8
>>> >     > >
>>> >     > > Or to get a display console on a mac os:
>>> >     > >
>>> >     > > $open $(./ovcmd vm -n vmname console )
>>> >     > >
>>> >     > >
>>> >     > > It can be found at
>>> >     https://github.com/fbacchella/ovirtcmd/tree/sdk4
>>> >     <https://github.com/fbacchella/ovirtcmd/tree/sdk4>
>>> >     > > It's still works in progress, I need to finish to remove sdk3
code.
>>> >     > >
>>> >     > > Some example of object written to sdk4 can be found at:
>>> >     > >
>>> >     > >
>>> >
https://github.com/fbacchella/ovirtcmd/blob/sdk4/ovlib/vms/__init__.py
>>> >     <
https://github.com/fbacchella/ovirtcmd/blob/sdk4/ovlib/vms/__init__.py>
>>> >     > >
>>> >     > > _______________________________________________
>>> >     > > Users mailing list
>>> >     > > Users at ovirt.org <mailto:Users at ovirt.org>
>>> >     > > http://lists.ovirt.org/mailman/listinfo/users
>>> >     <http://lists.ovirt.org/mailman/listinfo/users>
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > Users mailing list
>>> > Users at ovirt.org
>>> > http://lists.ovirt.org/mailman/listinfo/users
>>> >
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170428/d151e3a2/attachment-0001.html>


More information about the Users mailing list