Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ RPMBUILD?=rpmbuild
XEN_RELEASE?=unknown
endif

JQUERY=$(CARBON_DISTFILES)/javascript/jquery/jquery-1.1.3.1.pack.js
JQUERY_TREEVIEW=$(CARBON_DISTFILES)/javascript/jquery/treeview/jquery.treeview.zip

COMPILE_NATIVE=yes
COMPILE_BYTE=no # bytecode version does not build
export COMPILE_NATIVE COMPILE_BYTE
Expand Down Expand Up @@ -108,6 +111,7 @@ srpm:
mkdir -p $(RPM_SOURCESDIR) $(RPM_SPECSDIR) $(RPM_SRPMSDIR)
while ! [ -d .git ]; do cd ..; done; \
git archive --prefix=xapi-0.2/ --format=tar HEAD | bzip2 -z > $(RPM_SOURCESDIR)/xapi-0.2.tar.bz2 # xen-api/Makefile
cp $(JQUERY) $(JQUERY_TREEVIEW) $(RPM_SOURCESDIR)
make -C $(REPO) version
rm -f $(RPM_SOURCESDIR)/xapi-version.patch
(cd $(REPO); diff -u /dev/null ocaml/util/version.ml > $(RPM_SOURCESDIR)/xapi-version.patch) || true
Expand Down
4 changes: 2 additions & 2 deletions OMakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IPROG=install -m 755 -o root -g root
IDATA=install -m 644 -o root -g root
IPROG=install -m 755
IDATA=install -m 644

XEN_COMPILE_ARCH = $(shell uname -m | sed -e"s/i.86/x86_32/g")

Expand Down
2 changes: 1 addition & 1 deletion mk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export PRODUCT_VERSION_TEXT_SHORT
.PHONY: build
build: $(OUTPUT_CLI_RT) $(OUTPUT_SDK) $(MY_SOURCES)/MANIFEST
$(call mkdir_clean,$(MY_LINUX_CDFILES)/client_install)
install -m 755 -o root -g root $(RPM_RPMSDIR)/$(DOMAIN0_ARCH_OPTIMIZED)/xapi-xe-*.rpm $(MY_LINUX_CDFILES)/client_install/xe-cli-$(PRODUCT_VERSION)-$(BUILD_NUMBER).$(DOMAIN0_ARCH_OPTIMIZED).rpm
install -m 755 $(RPM_RPMSDIR)/$(DOMAIN0_ARCH_OPTIMIZED)/xapi-xe-*.rpm $(MY_LINUX_CDFILES)/client_install/xe-cli-$(PRODUCT_VERSION)-$(BUILD_NUMBER).$(DOMAIN0_ARCH_OPTIMIZED).rpm

$(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP) $(OUTPUT_XAPI_SRC)
rm -f $@
Expand Down
22 changes: 16 additions & 6 deletions ocaml/idl/OMakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.SUBDIRS: ocaml_backend lua js_backend

JQUERY = $(CARBON_DISTFILES)/javascript/jquery/jquery-1.1.3.1.pack.js
JQUERYTREEVIEWZIP = $(CARBON_DISTFILES)/javascript/jquery/treeview/jquery.treeview.zip
JQUERY=jquery-1.1.3.1.pack.js
JQUERY_DISTFILE = $(CARBON_DISTFILES)/javascript/jquery/$(JQUERY)
JQUERYTREEVIEWZIP = jquery.treeview.zip
JQUERYTREEVIEWZIP_DISTFILE = $(CARBON_DISTFILES)/javascript/jquery/treeview/jquery.treeview.zip

PSTOPDF = $(shell bash -c "which pstopdf || which ps2pdf || which ps2pdf14 || echo false")

Expand Down Expand Up @@ -44,6 +46,12 @@ api-html-doc: xenapi-html-doc xenenterpriseapi-html-doc
# XXX replace xenapi-html-doc and xenenterpriseapi-html-doc with implicit
# targets instead of hardcoding

#$(JQUERY) :
# cp $(JQUERY_DISTFILE) .
#
#$(JQUERYTREEVIEWZIP) :
# cp $(JQUERYTREEVIEWZIP_DISTFILE) .

sdk-classes: sdk-classes.dot
dot -Tps2 -Kneato -Goverlap=false sdk-classes.dot > sdk-classes.ps
dot -Tgif -Kneato -Goverlap=false sdk-classes.dot > sdk-classes.gif
Expand Down Expand Up @@ -110,8 +118,11 @@ clean:
rm -rf /tmp/docs
rm -rf $(SDKWWW)/docs/html

sdk-README.txt : sdk-README.html
lynx -dump sdk-README.html > sdk-README.txt

.PHONY: sdk-install
sdk-install: datamodel html_build xenenterpriseapi.pdf
sdk-install: datamodel html_build xenenterpriseapi.pdf $(JQUERY) $(JQUERYTREEVIEWZIP)
mkdir -p $(SDK)/docs/html
cp xenenterpriseapi-datamodel-graph.map $(SDK)/docs/html
cp xenenterpriseapi-datamodel-graph.gif $(SDK)/docs/html
Expand All @@ -131,12 +142,11 @@ sdk-install: datamodel html_build xenenterpriseapi.pdf
cp $(JQUERY) $(SDK)/docs/html
mkdir -p $(SDK)/docs/html/images
unzip -o -j -d $(SDK)/docs/html/images $(JQUERYTREEVIEWZIP) images/*
unzip -o -j -d $(SDK)/docs/html $(JQUERYTREEVIEWZIP) *.js images/*
unzip -o -j -d $(SDK)/docs/html $(JQUERYTREEVIEWZIP) '*.js' images/*
#./datamodel -closed -html $(SDK)/docs/html
mkdir -p $(SDK)/docs/pdf
cp xenenterpriseapi.pdf $(SDK)/docs/pdf/
cp sdk-README.html $(SDK)/README.html
lynx -dump sdk-README.html > $(SDK)/README.txt
cp sdk-README.txt $(SDK)/README.txt
cp sdk-index.html $(SDK)/index.html

.PHONY: doc
Expand Down
96 changes: 96 additions & 0 deletions ocaml/idl/sdk-README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@

INTRODUCTION

This README describes the Software Development Kit (SDK) for the XenServer
4.0 product family. The SDK provides programmatic access to the extensive
set of XenServer management features and tools.

SYSTEM REQUIREMENTS

The SDK is provided in the form of a Xen Virtual Appliance (XVA). The XVA
can be imported into XenServer 4.0 or above. In order to use the Windows
CLI, you must first install the [1].NET Version 2.0 runtime on your Windows
client system.

INSTRUCTIONS FOR INSTALLING THE SDK

* Download the zip file and unzip it on your client system where you have
XenCenter installed
* On the XenCenter File menu, click on "Import VM" and browse to the
unzipped directory tree.
* Double-click on the "sdk" and then click OK.
* When the import has finished click on the "Network" tab of the XenVM and
inspect the networking configuration. If the SDK is to be accessed
remotely or you intend to run the examples to access a host system, then
you must use XenCenter to add a network interface to the VM. Once you
have done this, the VM will attempt to acquire an IP address by DHCP
each time it boots.

USING THE SDK

* Start the SDK VM (labelled in the UI as "XenServer SDK #.#.#-####") in
XenCenter.
* On first boot the VM will prompt for a password for the "root" account.
This password allows remote logins via SSH as well as via the Text
Console in XenCenter.

SDK CONTENT MAP

The following is a overview of the contents of the /SDK directory tree.
Where necessary, subdirectories have their own individual README files.
/SDK/README.txt

This file

/SDK/docs/pdf/xenenterpriseapi.pdf

PDF reference for the API

/SDK/docs/html/index.html

html reference for the API

/SDK/windows-cli

CLI ('xe.exe') for Windows systems

/SDK/client-examples/c

C examples and a Makefile to build them

/SDK/client-examples/c/test

Test program

/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 CLI ('xe')

/SDK/client-examples/python

Several example python programs

BUILDING THE EXAMPLES

The SDK VM comes complete with the tools necessary to build the C examples
and also to run the bash scripts (which use the CLI) and the python
programs. By contrast, the C# examples in
/SDK/client-examples/csharp/XenSdk.net ([2]zip) must first be copied to a
Windows machine with Visual Studio and .NET 2.0 installed.

QUESTIONS AND FEEDBACK

Please voice your questions and feedback about the SDK VM, as well as
development issues, at [3]http://community.citrix.com/cdn/xs.

References

1. http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en
2. file://localhost/SDK/XenSdk.net.zip
3. http://community.citrix.com/cdn/xs
2 changes: 1 addition & 1 deletion ocaml/lvhdrt/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend
OCAMLINCLUDES = ../idl/ocaml_backend/ ../idl ../autogen
OCAMLPACKS = xml-light2 stdext stunnel http-svr log

IEXE=install -m 755 -o root -g root
IEXE=install -m 755

OCamlProgram(lvhdrt, lvhdrt lvhdrt_exceptions utils globs fists tc_8670 tc_8682 tc_8699 tc_8700 tc_8707 tc_8766 tc_8775)

Expand Down
2 changes: 1 addition & 1 deletion ocaml/multipathrt/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ OCAML_LIBS = ../util/version ../idl/ocaml_backend/common ../idl/ocaml_backend
OCAMLINCLUDES = ../idl/ocaml_backend ../idl ../autogen ../client_records
OCAMLPACKS = xml-light2 stdext stunnel http-svr log

IEXE=install -m 755 -o root -g root
IEXE=install -m 755

OCamlProgram(multipathrt, \
multipathrt multipathrt_exceptions \
Expand Down
6 changes: 3 additions & 3 deletions ocaml/xe-cli/rt/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ clean:
install:
rm -rf $(DESTDIR)/cli-rt
mkdir -p $(DESTDIR)/cli-rt/gtserver
install -m 755 -o root -g root test_host gtclient xgetip $(DESTDIR)/cli-rt
install -m 755 test_host gtclient xgetip $(DESTDIR)/cli-rt
cp gtmessages.ml gtcomms.ml gtlinuxops.ml gtserver_linux.ml $(DESTDIR)/cli-rt/gtserver/
cp Makefile.gtserver $(DESTDIR)/cli-rt/gtserver/Makefile
# and this is for easier developer testing:
rm -rf /tmp/cli-rt-domu
mkdir -p /tmp/cli-rt-domu
install -m 755 -o root -g root install.sh /tmp/cli-rt-domu
install -m 755 install.sh /tmp/cli-rt-domu
mkdir -p /tmp/cli-rt-domu/root
cp gtmessages.ml gtcomms.ml gtlinuxops.ml gtserver_linux.ml /tmp/cli-rt-domu/root
(cd $(ROOT)/scripts; /bin/sh ./make-patch /tmp/cli-rt-domu /tmp/cli-rt-domu-shar.sh)
mv /tmp/cli-rt-domu-shar.sh $(DESTDIR)/opt/xensource/debug
install -m 755 -o root -g root install-debian-pv.sh install-debian-pv-inside.sh $(DESTDIR)/opt/xensource/debug
install -m 755 install-debian-pv.sh install-debian-pv-inside.sh $(DESTDIR)/opt/xensource/debug
2 changes: 1 addition & 1 deletion scripts/examples/OMakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IEXE=install -m 755 -o root -g root
IEXE=install -m 755

.SUBDIRS: bash-cli python

Expand Down
5 changes: 4 additions & 1 deletion scripts/examples/bash-cli/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ WWWBASH_DIR=$(SDKWWW)/client-examples/bash-cli
EXAMPLES=install-debian suspend-resume clone-vms move-management-to-bond
EXAMPLES_HTML=$(addsuffix .html, $(EXAMPLES))

README : index.html
lynx -dump index.html > README

.PHONY: sdk-install
sdk-install:
# copy in the bash examples
Expand All @@ -12,7 +15,7 @@ sdk-install:
$(IDATA) $(EXAMPLES_HTML) $(BASH_DIR)

$(IDATA) index.html $(BASH_DIR)
lynx -dump index.html > $(BASH_DIR)/README
$(IDATA) README $(BASH_DIR)

mkdir -p $(WWWBASH_DIR)
$(IDATA) $(EXAMPLES) $(WWWBASH_DIR)
Expand Down
49 changes: 49 additions & 0 deletions scripts/examples/bash-cli/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

Introduction

This file describes the XE CLI + bash examples included in the [1]Software
Development Kit (SDK) for the [2]XenServer 4.0 product family.

XE CLI + bash examples

install-debian

[3][ browse ] [4][ download ]

A very simple example which installs Debian Etch 4.0 from the pre-existing
VM template.

suspend-resume

[5][ browse ] [6][ download ]

A very simple example which demonstrates how to suspend and resume a VM.

clone-vms

[7][ browse ] [8][ download ]

An example which takes the uuid of a VM which is either running or halted.
If it is running it is shutdown. The VM is cloned and if the original VM was
running then both it and the clone are started.

move-management-to-bond

[9][ browse ] [10][ download ]

An example which detects when some hosts management interfaces are still
using a regular interface when a suitable bond configuration exists, and
moves the management interfaces to the bond.

References

1. file://localhost/bind/myrepos/xen-api/scripts/index.html
2. http://www.xensource.com/
3. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/install-debian.html
4. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/install-debian
5. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/suspend-resume.html
6. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/suspend-resume
7. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/clone-vms.html
8. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/clone-vms
9. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/move-management-to-bond.html
10. file://localhost/bind/myrepos/xen-api/scripts/examples/bash-cli/move-management-to-bond
4 changes: 3 additions & 1 deletion scripts/examples/python/OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ sdk-install:
$(IDATA) $(PYTHON_LIB) $(DIR)
$(IDATA) $(PYTHON_HTML) $(DIR)
$(IDATA) index.html $(DIR)
lynx -dump index.html > $(SDK)/README
cp README $(SDK)

mkdir -p $(DIRWWW)
$(IDATA) $(PYTHON_SRC) $(DIRWWW)
$(IDATA) $(PYTHON_HTML) $(DIRWWW)
$(IDATA) index.html $(DIRWWW)

README : index.html
lynx -dump index.html > README
.PHONY: install
install:
mkdir -p $(DESTDIR)/opt/xensource/libexec
Expand Down
5 changes: 4 additions & 1 deletion xapi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Group: System/Hypervisor
License: LGPL+linking exception
URL: http://www.xen.org
Source0: xapi-%{version}.tar.bz2
Source1: jquery-1.1.3.1.pack.js
Source2: jquery.treeview.zip
Patch0: xapi-version.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: pam-devel tetex xapi-libs-devel ocaml omake ocaml-findlib ocaml-xmlm
BuildRequires: pam-devel tetex-latex xapi-libs-devel ocaml omake ocaml-findlib ocaml-xmlm ocaml-type-conv ocaml-xmlm-devel xen-devel zlib-devel

%description
XCP toolstack.
Expand Down Expand Up @@ -92,6 +94,7 @@ This package contains Xen-API documentation and examples in several programming

%prep
%setup -q
cp $RPM_SOURCE_DIR/jquery* $RPM_BUILD_DIR/xapi-0.2/ocaml/idl
%patch0 -p0 -b xapi-version.patch

%build
Expand Down