]>
Ganeti remote API Documents Ganeti version 1.2 Introduction Ganeti supports a remote API for enable external tools to easily retrieve information about a cluster's state. The remote API daemon, ganeti-rapi, is automatically started on the master node if the --enable-rapi parameter is passed to the configure script. Alternatively you can start it manually. By default it runs on TCP port 5080, but this can be changed either in …/constants.py or via the command line parameter -p. SSL support can also be enabled by passing command line parameters. Ganeti 1.2 only supports a limited set of calls, all of them read-only. The next major version will have support for write operations. Protocol The protocol used is JSON over HTTP designed after the REST principle. Usage examples You can access the API using your favorite programming language as long as it supports network connections. Shell wget -q -O - http://CLUSTERNAME:5080/info Python import urllib2 f = urllib2.urlopen('http://CLUSTERNAME:5080/info') print f.read() JavaScript While it's possible to use JavaScript, it poses several potential problems, including browser blocking request due to non-standard ports or different domain names. Fetching the data on the webserver is easier. var url = 'http://CLUSTERNAME:5080/info'; var info; var xmlreq = new XMLHttpRequest(); xmlreq.onreadystatechange = function () { if (xmlreq.readyState != 4) return; if (xmlreq.status == 200) { info = eval("(" + xmlreq.responseText + ")"); alert(info); } else { alert('Error fetching cluster info'); } xmlreq = null; }; xmlreq.open('GET', url, true); xmlreq.send(null); Resources @INCLUDE_RAPI_RESOURCES@