Develop for XenServer

Getting Started with Python

The XenServer-SDK directory contains the following folders that are relevant to Python developers:

  • XenServerPython: This directory contains the XenServer Python module XenAPI.py.

Python 2 is deprecated in XenServer 8. Use Python 3 to ensure future compatibility for your scripts and clients.

Alternative installation

The Python module is also available as a package on PyPi. To install the package, enable the virtual environment where it will be used and run

pip install XenAPI

RPC protocol

The Python module supports the XML-RPC protocol.

Platform supported

  • Linux
  • Windows

Library

  • XenAPI.py

Dependencies

  • xmlrpclib

Examples

Examples on the usage of the XenServer Powershell module can be found at XenAPI.py usage examples on GitHub.

Getting Started with Python