Ubuntu – Is there a Juju REST API

clientjuju

Is there a REST API for juju or the only possible ways to communicate with it are by juju command-line and juju gui?
A service can communicate with juju main agent and, for instance, add a new unit or start another service? What is the proper way to do this?

Best Answer

The Juju clients (command line and GUI) both use a websocket protocol to communicate with the Juju controller (main agent).

We have plans to provide client libraries that will wrap this API nicely and allow you to develop your own clients that can control Juju.

If you're interested in studying the wire format of the protocol, this document is a good starting point: https://github.com/juju/juju/blob/master/doc/api.txt

There are already some (unofficial) libraries available. More info here: What's the best way to have a charm control Juju?