Skip to main content

Python Bindings for OpenNebula XML-RPC API

Project description

Open Nebula Python Bindings

This is an implementation of Open Nebula XML-RPC bindings in Python.

The main goals of this library is completeness and maintainability.

Proxies and generators have been used whenever possible to minimize the impact of API updates, ensuring that the distributed xsd files are the only update required when new API versions are released.

This library is meant to be used together with OpenNebula API documentation:

The XML-RPC API must be used to know which calls to make.

How to use it

Installation

The code is distributed as a package:

pip install pyone

Making Calls

Calls match the API documentation provided by Open Nebula:

import pyone

one = pyone.OneServer("http://one/RPC2", session="oneadmin:onepass" )
hostpool = one.hostpool.info()
host = hostpool.HOST[0]
id = host.ID

Note that the session parameter is automatically included as well as the “one.” prefix to the method.

Returned Objects

The returned types have been generated with PyXB and closely match the XSD specification. You can use the XSD specification as primary documentation while your IDE will offer code completion as you code

marketpool = one.marketpool.info()
m0 = marketpool.MARKETPLACE[0]
print "Markeplace name is " + m0.NAME

Structured Parameters

When making calls, the library will translate flat dictionaries into attribute=value vectors. Such as:

one.host.update(0,  {"LABELS": "HD"}, 1)

When the provided dictionary has a “root” dictionary, it is considered to be root element and it will be translated to XML:

one.vm.update(1,
  {
    'TEMPLATE': {
      'NAME': 'abc',
      'MEMORY': '1024',
      'ATT1': 'value1'
    }
  }, 1)

Building from Source

Note that a Makefile is provided to generate the python bindings

Project details


Release history Release notifications | RSS feed

This version

1.0.0

Download files

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

Source Distribution

pyone-1.0.0.linux-x86_64.tar.gz (128.9 kB view details)

Uploaded Source

Built Distribution

pyone-1.0.0-py2-none-any.whl (82.5 kB view details)

Uploaded Python 2

File details

Details for the file pyone-1.0.0.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for pyone-1.0.0.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 60c47d98f2ab0a0cc76bd4f71dfd7d681b5dd33001410b21dc353a0279728191
MD5 a6d690f945a757c087c164880ee10358
BLAKE2b-256 67f2c5ddd7c6f53b46c74b425727ddd2de04ccde05328bdeddd469686da33976

See more details on using hashes here.

File details

Details for the file pyone-1.0.0-py2-none-any.whl.

File metadata

File hashes

Hashes for pyone-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a48ce1fc9a9a8b57a2e2bbe77cd9b1f433107d310d93d7626b4661fc618a3326
MD5 5b95614285be85fe82f243b19230b54c
BLAKE2b-256 68261c100a39552d69acc1a2cf0b08508b379c5ae077d75f7ab70dcc2deec48c

See more details on using hashes here.

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