XenServer Software Development Kit Guide 4.1.0

Getting Started
3
Directory Description
/SDK/docs/html/ Contains index.html, the HTML version of the
reference for the API
/SDK/windows-cli a Windows version of the CLI xe.exe
/SDK/client-examples/c C examples and a Makefile to build them
/SDK/client-examples/c/src C source for the language bindings
/SDK/client-examples/csharp/XenSdk.net Microsoft Visual Studio 2005 solution which
includes the C# language bindings (which compile
to a .dll) and several example projects
/SDK/client-examples/bash-cli Simple bash scripts which use the xe CLI
/SDK/client-examples/python Several example python programs
2.6. Building Samples for the Linux Platform
The SDK VM comes complete with the tools necessary to build the C samples. Looking at the content
map, the directory /SDK/client-examples/c has a Makefile at the top level which builds the language
bindings, as well as the C language samples that are included as part of the SDK VM.
2.7. Building Samples for the Windows Platform
The C# examples in /SDK/client-examples/csharp/XenSdk.net must first be copied to a Windows
machine with Visual Studio and .NET 2.0 installed. The C# bindings and the samples directories each have
the appropriate solution (.sln) files generated by Microsoft Visual Studio 2005. Launching them via the
Windows Explorer and rebuilding at the top level will build the language bindings as well as the applications.
The IP address of the host is passed in as a parameter to each of the sample applications. This needs to
be set/changed to ensure that the applications work against the right XenServer Host.
2.8. Running the CLI
The CLI for Linux is called xe, and for Windows is called xe.exe. The Windows version is under /SDK/
windows-cli. This needs to be copied onto a PC running Windows XP or higher, and must have .Net 2.0
installed. When running in the SDK VM, the Linux CLI is already installed and in the default path. Typing
xe in the SDK VM console launches the CLI.
2.8.1. Tab Completion
The CLI has comprehensive tab completion that allows discovery of the commands and parameters. On
launching xe, hitting tab twice shows all the commands that the CLI has.
2.9. Accessing SDK reference
The SDK VM has a built-in web server that allows access to the samples and the complete reference
documentation.
Procedure 2.1. To access this information
1. From the command prompt type ifconfig and hit ENTER.
2. Note down the IP address for the eth0 interface for this VM. If there is no eth0 interface, please add
a virtual NIC.