Difference between revisions of "XenAPI client libraries for ocaml"

From Xen
(Created page with "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 s…")
 
(Add the xen-specific package repository)
 
(2 intermediate revisions by 2 users not shown)
Line 12: Line 12:
 
== Install the ocaml package manager "opam" ==
 
== Install the ocaml package manager "opam" ==
   
The version of the package manager and the package repositories in the xen-org fork on github are the most recent versions that have passed the xen-specific build tests.
+
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.
   
 
<nowiki>
 
<nowiki>
git clone git://github.com/xen-org/opam
+
git clone git://github.com/xapi-project/opam
 
(cd opam; ./configure && make && sudo make install)
 
(cd opam; ./configure && make && sudo make install)
 
</nowiki>
 
</nowiki>
Line 22: Line 22:
   
 
<nowiki>
 
<nowiki>
opam init git://github.com/xen-org/opam-repository
+
opam init git://github.com/xapi-project/opam-repository
 
</nowiki>
 
</nowiki>
   
Line 28: Line 28:
 
== Add the xen-specific package repository ==
 
== Add the xen-specific package repository ==
 
<nowiki>
 
<nowiki>
opam remote add xen git://github.com/xen-org/opam-repo-dev
+
opam remote -add xapi-project git://github.com/xapi-project/opam-repo-dev
 
</nowiki>
 
</nowiki>
   

Latest revision as of 15:00, 20 June 2013

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`

Install packages

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)

#require "xen-api-client.lwt";;