This is a dead-simple NodeJS application that show list of Xen DomU available on a specific node. It is intended to be launched internally only (no security yet!) and give a JSON output.
npm install
npm run devstart
Go to http://localhost:3001/api
npm test
The user that is running the NodeJs app must be able to run the xen list
command and list files under /etc/xen
.
Here is how to deploy on a Debian 7.x server. Can be adapted to run on any Debian you can just adapt the NodeJS version (latest is better)
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_6.x | bash -
apt-get install -y nodejs
PM2 is a process manager for NodeJS
sudo npm install pm2 -g
# PM2 will boot at startup
pm2 startup
git clone https://github.com/gbandsmith/xenrestapi.git
pm2 start xenrestapi/bin/www --name xenrestapi
pm2 save