Creating an API for XCP-ng tasks
-
Why not using XO API then? What's not covered there for what you need?
-
I can't find any detailed documentation on how to access and use the API, i could only find the xo-cli command reference guide.
We want to create XEN functions (start/restart/shutdown) from our web application which is PHP.
Is there a set of docs somewhere ?
Many thanks
D.
-
Each feature you can access with
xo-cli
can be called with XO API. It's JSON-RPC, so it will be easy to call it in PHP (for example). -
Thanks @olivierlambert
Is there a definitive guide for the xo-cli commands ?
Where can I find an example of a JSON-RPC call that we can learn from ?
D.
-
Pinging @julien-f to give you a good answer
-
@BeDazzleMe
xo-cli
is an advanced tool, mainly for the developers of XO, but useful for advanced users wellThere is no guide of commands, it uses introspection to get the available commands from
xo-server
:xo-cli --list-commands
For more information, take a look at the documentation.
-
Thanks @julien-f
I have played with xo-cli and have an idea on it's workings, however that's not useful for creating scripts to utilise the API.
I want to understand how to form an API instruction to perform a task.
Is there a guide to creating JSON-RPC scripts that work with XO Server?
D.
-
@BeDazzleMe It's JSON-RPC 2.0 over WebSocket on the path
/api
.You can call the method
system.getMethodsInfo
to see which methods are available.You can use
xo-lib
if you want to use JavaScript. -
Thanks @julien-f
We had a discussion with our developer on Friday and he was recommending we look at ovirt to achieve our goal here, but I am not yet convinced we need to start down that path.
We've run XEN/XCP in our environment since version 5, hence I am keen to continue with it as our core, however customer service is a growing issue for us as our customers are complaining about lack of self-service capability which is fair enough.
Thanks for your help.
D.
-
oVirt is the same concept, the only diff is maybe a REST API, but otherwise it's really similar (but even a bit harder to setup).
Anyway, if you need assistance on API calls, let us know.
-
This post is deleted!