XenServer includes a XML-RPC based API, providing programmatic access to the extensive set of XenServer management features and tools. The XenServer API can be called from a remote system as well as local to the XenServer host. Remote calls are generally made securely over HTTPS, using port 443.
There are five SDKs available, one for each of C, C#, Java, PowerShell, and Python. For XenServer 6.0.2 and earlier, these were provided under an open-source license (LGPL or GPL with the common linking exception). This allows use (unmodified) in both closed-and open-source applications. From XenServer 6.1 onwards the bindings are in the majority provided under a BSD license that allows modifications. Please do refer to the specific licensing file supplied with the particular version of the binding you chose to work with for full and definitive licensing conditions.
There are also several example code samples also provided for download. Some of the code samples demonstrate creating a VM, running VM power operations, and watching for events.
The XenServer 6.1 SDKs are suitable not just for 6.1 servers, but for use with all versions of XenServer from 4.0 to 6.1, making it possible to address multiple XenServer versions with a single binary. There are, of course, features missing on the older versions, and client programs are expected to check host.software_version["product_version"] to gracefully fall back when appropriate.
The SDKs for XenServer 6.1 are available on the Citrix Download area for XenServer 6.1, here.
The SDKs are located under "XenServer Support Components", in the latter half of the list of components. Documentation is available in the SDK Guide under Citrix Support Article CTX134588.
Release notes specific to this release of the SDKs are detailed in the Citrix Support Article CTX135078. The release notes for XenServer 6.1 details several changes and corrections to the API bindings available in previous releases. We would strongly encourage existing users to familiarise themselves with these changes as some unsupported APIs have been removed.
The C bindings have been considerably enhanced with the addition of Asynchronous API calls for most API functions; giving developers using the C SDK the option to use tasks and create multi-threaded applications with greater ease. A new code asynchronous C code example for XenServer 6.1 (Tampa) is now available on this site. Using asynchronous API calls can help developers avoid writing their own threading. Find out more about asynchronous calls and download the example.
XenCenter Plug-in Development Site. Plug your product or administration scripts seamlessly into XenCenter.
Browse and Share Scripts and Samples on the CDN Script Exchange
Community Code Example Share Page. A place to share and discuss SDK code examples and CLI scripts and XAPI algorithms e.g. Snapshot automation.
xvp: An open-source web interface for XenServer, developed at Durham University
Making use of XenServer's RRDs for metric information. Useful for accessing an even broader range of XenServer metrics such as memory, IOP and C-state/P-state information. Some information on RRD documentation and recent additions to the metrics can be found in CTX135033.
XenServerConsole: A Java client for XenServer consoles
Download XenServerConsole source (Blog: http://blogs.citrix.com/2011/02/11/xenserverconsole-examples/; Some additional compilation and build notes are available, here.)
Note that the XenServer 6.1 SDKs are suitable for use with all versions of XenServer from 4.0 to 6.1. These older releases are here for historical purposes only.