Skip to content

h-medjahed/pyvcloud

 
 

Repository files navigation

pyvcloud

Documentation Status Stable Version build status

Python SDK for VMware vCloud Director and vCloud Air.

This project is under development, the classes, methods and parameters might change over time. This README usually reflects the syntax of the latest version.

New vCD support is located under pyvcloud/vcd directory.

Sample Usage

Import modules and instantiate a VCA object:

from pyvcloud.vcloudair import VCA
vcd = VCA(host, user, service_type, service_version, verify)

Login to a vCloud Director instance:

result = vcd.login(password=password, org=org)

See changes log for a list of changes.

Installation

The Python SDK requires the libxml2 and libxslt libraries, see lxml for more details.

On Debian/Ubuntu, you can install lxml and Python development dependencies with this command:

sudo apt-get install libxml2-dev libxslt-dev python-dev python-pip

On RHEL-based distributions:

sudo yum install libxslt-devel libxml2-devel python-devel python-pip

The Python SDK can then be installed with the following command:

pip install --user pyvcloud

pyvcloud can also be installed with virtualenv

Examples

See the examples directory for sample code.

Development and Test

To run the source code, check it out from GitHub and install it with:

python setup.py develop

To log the requests, add the log=True parameter to the VCA constructor. The log is appended to file $TMPDIR/pyvcloud.log.

vcd = VCA(host=host,
          username=username,
          service_type='vcd',
          version='5.7',
          verify=False,
          log=True)

To test pyvcloud:

git clone https://github.com/vmware/pyvcloud.git
cd pyvcloud
virtualenv .venv
source .venv/bin/activate
python setup.py develop
pip install -r test-requirements.txt
cp tests/config.yaml my_config.yaml
# customize credentials and other parameters
nosetests --verbosity=2  --tc-format yaml --tc-file my_config.yaml tests/00010_vcd_login.py

See .gitlab-ci.yml for current tests.

About

Python SDK for VMware vCloud

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%