Documents Ganeti version 1.2
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. |
You can access the API using your favorite programming language as long as it supports network connections.
![]() | 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);
/ resource.
Cluster info.
Method | Description |
---|---|
GET | Returns cluster information. |
/instances resource.
Method | Description |
---|---|
GET | Returns a list of all available instances. |
/instances/[instance_name]/tags resource.
Manages per-instance tags.
/nodes resource.
Method | Description |
---|---|
GET | Returns a list of all nodes. |
/version resource.
This resource should be used to determine the remote API version and to adapt
clients accordingly.