API access to Environ

roger peppe rogpeppe at gmail.com
Fri Feb 15 18:52:02 UTC 2013


We want to give the GUI access to as much functionality
from the command line as we can.
Currently various commands make use of the Environ,
and currently the API server has no access to that.

Off the top of my head, the commands that use the Environ are:

bootstrap
   - This is the big one - we'd need some way of getting the GUI
to start a new instance running the required stuff. Thoughts
on the best way of accomplishing this (e.g. in-browser, provider-proxy)
are welcome!

status
  - Status uses the environment to find out DNS names of instances.
We could add another worker that finds DNS names of
machine instances and sets them in the state.

deploy
  - Deploy uses the environment storage to push charms. It has long
been the plan to use the state for charm storage rather than the environment,
and this is a good reason for it.

In the short term (ignoring bootstrap), I see two possibilities:
1) Implement both the above solutions; perhaps they're not
too much work, and it's the right thing to do long term.
2) Provide access to the Environ inside the API server. This is awkward
because there's a chicken-and-egg problem - the Environ isn't
initially valid until someone connects to the API and pushes the
API credentials. We'd have to let the API server come up but refuse
any request that requires an Environ. This probably wouldn't be
*that* much work either, but it's code that will have to be ripped out
later.

Thoughts?

  rog.



More information about the Juju-dev mailing list