The oVirt Python SDK is a Python package that simplyfies access to the oVirt Engine API.
Important
|
This document describes how to generate, build and test the
SDK. If you are interested in how to use it read the README.adoc file
in the sdk directory instead.
|
The SDK uses libxml2 for parsing and rendering
XML documents, and the part that interacts with this library is written
in C. This means that before building you must make sure you have the C
compiler and the required header and libraries files installed in your
system. For example to install with the yum
package manager you will
need to do the following:
# yum -y install \ gcc \ libxml2-devel \ python-devel
Most of the source code of the Python SDK is automatically generated from the API model.
The code generator is a Java program that resides in the generator
directory. This Java program will get the API model and the metamodel
artifacts from the available Maven repositories. To build and run it use
the following commands:
$ git clone git://gerrit.ovirt.org/ovirt-engine-sdk $ mvn package
This will build the code generator, run it to generate the SDK for the
version of the API that corresponds to the branch of the SDK that you
are using, and build the .tar.gz
and .whl
files.
If you need to generate it for a different version of the API then you
can use the model.version
property. For example, if you need to
generate the SDK for version 4.1.0
of the SDK you can use this
command:
$ mvn package -Dmodel.version=4.1.0
By default the build and the tests are executed using the python
command.
If you wish to use a different version of Python you can use the
python.command
property:
$ mvn package -Dpython.command=python3
The generated .tar.gz
and .whl
files will be located in the
sdk/dist
directory:
$ find sdk/dist sdk/dist/ovirt-engine-sdk-4.0.0a0.linux-x86_64.tar.gz sdk/dist/ovirt-engine-sdk-4.0.0a0.tar.gz sdk/dist/ovirt_engine_sdk-4.0.0a0-cp27-none-linux_x86_64.whl