Skip to main content

VMware vCloud Director Python SDK

Project description

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvcloud-18.0.4.dev53.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distribution

pyvcloud-18.0.4.dev53-py2-none-any.whl (1.4 MB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page