XenAPI client libraries for ocaml
This page describes how to install the XenAPI client libraries for ocaml, and how to use them with tab-completion in a toplevel REPL.
This is currently a draft.
Before you start
Use your distro's package manager to install an ocaml version >= 3.12.1
sudo apt-get install ocaml
Install the ocaml package manager "opam"
The version of the package manager and the package repositories in the xapi-project fork on github are the most recent versions that have passed the xen-specific build tests.
git clone git://github.com/xapi-project/opam (cd opam; ./configure && make && sudo make install)
Initialise from the standard set of base packages
opam init git://github.com/xapi-project/opam-repository
Add the xen-specific package repository
opam remote -add xapi-project git://github.com/xapi-project/opam-repo-dev
Switch to a clean setup of the 3.12.1 compiler
opam switch 3.12.1
Run the following command in your terminal and add this to your .profile to make sure your ocaml environment variables are setup:
eval `opam config -env`
opam --yes install xen-api-client utop
Try the XenAPI
Run "utop" in a terminal -- this should give you an ocaml toplevel with tab-completion. Type the following: (try hitting "tab" a lot)