A simple usage example in the readme, more needed.
The beginnings of the OO interface are here, though it isn't complete.
--- /dev/null
+# Getting Started
+
+```python
+from juju import Juju
+
+juju = Juju()
+lxd = juju.get_cloud('lxd')
+controller = lxd.bootstrap('lxd-test')
+model = controller.get_model('default')
+
+# We might want an async and blocking version of deploy()?
+model.deploy('mediawiki-single')
+
+mediawiki = model.get_service('mediawiki')
+mediawiki.expose()
+```
+
+
--- /dev/null
+class Cloud(object):
+ def add_credential(self):
+ """Add or replaces credentials for this cloud.
+
+ """
+ pass
+
+ def get_credentials(self):
+ """Return list of all credentials for this cloud.
+
+ """
+ pass
+
+ def remove_credential(self):
+ """Remove a credential for this cloud.
+
+ """
+ pass
+
+ def bootstrap(self):
+ """Initialize a cloud environment.
+
+ """
+ pass
+
+ def set_default_credential(self):
+ """Set the default credentials for this cloud.
+
+ """
+ pass
+
+ def set_default_region(self):
+ """Set the default region for this cloud.
+
+ """
+ pass
--- /dev/null
+class Controller(object):
+ def add_model(self):
+ """Add a model to this controller.
+
+ """
+ pass
+
+ def add_user(self):
+ """Add a user to this controller.
+
+ """
+ pass
+
+ def change_user_password(self):
+ """Change the password for a user in this controller.
+
+ """
+ pass
+
+ def destroy(self):
+ """Destroy this controller.
+
+ """
+ pass
+
+ def disable_user(self):
+ """Disable a user.
+
+ """
+ pass
+
+ def enable_user(self):
+ """Re-enable a previously disabled user.
+
+ """
+ pass
+
+ def kill(self):
+ """Forcibly terminate all machines and other associated resources for
+ this controller.
+
+ """
+ pass
+
+ def get_models(self):
+ """Return list of available models on this controller.
+
+ """
+ pass
+
+ def get_payloads(self):
+ """Return list of known payloads.
+
+ """
+ pass
+
+ def get_users(self):
+ """Return list of users that can connect to this controller.
+
+ """
+ pass
+
+ def login(self):
+ """Log in to this controller.
+
+ """
+ pass
+
+ def logout(self):
+ """Log out of this controller.
+
+ """
+ pass
+
+ def get_model(self, name):
+ """Get a model by name.
+
+ """
+ pass
+
+ def get_user(self, name):
+ """Get a user by name.
+
+ """
+ pass
--- /dev/null
+class Juju(object):
+ def add_cloud(self):
+ """Add a user-defined cloud to Juju from among known cloud types.
+
+ """
+ pass
+
+ def agree(self):
+ """Agree to the terms of a charm.
+
+ """
+ pass
+
+ def autoload_credentials(self):
+ """Finds cloud credentials and caches them for use by Juju when
+ bootstrapping.
+
+ """
+ pass
+
+ def create_budget(self):
+ """Create a new budget.
+
+ """
+ pass
+
+ def get_agreements(self):
+ """Return list of terms to which the current user has agreed.
+
+ """
+ pass
+
+ def get_budgets(self):
+ """Return list of available budgets.
+
+ """
+ pass
+
+ def get_clouds(self):
+ """Return list of all available clouds.
+
+ """
+ pass
+
+ def get_controllers(self):
+ """Return list of all available controllers.
+
+ (maybe move this to Cloud?)
+ """
+ pass
+
+ def get_plans(self, charm_name):
+ """Return list of plans available for the specified charm.
+
+ """
+ pass
+
+ def register(self, registration_string):
+ """Register a user to a controller.
+
+ """
+ pass
+
+ def set_budget(self, name, amount):
+ """Set a budget limit.
+
+ """
+ pass
+
+ def get_cloud(self, name):
+ """Get a cloud by name.
+
+ """
+ pass
+
+ def get_controller(self):
+ """Get a controller by name.
+
+ (maybe move this to Cloud?)
+ """
+ pass
+
+ def update_clouds(self):
+ """Update public cloud info available to Juju.
+
+ """
+ pass
+
+ def version(self):
+ """Return the Juju version.
+
+ """
+ pass
--- /dev/null
+class Machine(object):
+ def run(self):
+ """Run command on this machine.
+
+ """
+ pass
+
+ def scp(self):
+ """Transfer files to this machine.
+
+ """
+ pass
+
+ def ssh(self):
+ """Execute a command over SSH on this machine.
+
+ """
+ pass
+
+ def status_history(self):
+ """Get status history for this machine.
+
+ """
+ pass
--- /dev/null
+class Model(object):
+ def add_machine(self):
+ """Start a new, empty machine and optionally a container, or add a
+ container to a machine.
+
+ """
+ pass
+ add_machines = add_machine
+
+ def add_relation(self):
+ """Add a relation between two services.
+
+ """
+ pass
+
+ def add_space(self):
+ """Add a new network space.
+
+ """
+ pass
+
+ def add_ssh_key(self):
+ """Add a public SSH key to this model.
+
+ """
+ pass
+ add_ssh_keys = add_ssh_key
+
+ def add_subnet(self):
+ """Add an existing subnet to this model.
+
+ """
+ pass
+
+ def get_backups(self):
+ """Retrieve metadata for backups in this model.
+
+ """
+ pass
+
+ def block(self):
+ """Add a new block to this model.
+
+ """
+ pass
+
+ def get_blocks(self):
+ """List blocks for this model.
+
+ """
+ pass
+
+ def get_cached_images(self):
+ """Return a list of cached OS images.
+
+ """
+ pass
+
+ def create_backup(self):
+ """Create a backup of this model.
+
+ """
+ pass
+
+ def create_storage_pool(self):
+ """Create or define a storage pool.
+
+ """
+ pass
+
+ def debug_log(self):
+ """Get log messages for this model.
+
+ """
+ pass
+
+ def deploy(self):
+ """Deploy a new service or bundle.
+
+ """
+ pass
+
+ def destroy(self):
+ """Terminate all machines and resources for this model.
+
+ """
+ pass
+
+ def get_backup(self):
+ """Download a backup archive file.
+
+ """
+ pass
+
+ def enable_ha(self):
+ """Ensure sufficient controllers exist to provide redundancy.
+
+ """
+ pass
+
+ def get_config(self):
+ """Return the configuration settings for this model.
+
+ """
+ pass
+
+ def get_constraints(self):
+ """Return the machine constraints for this model.
+
+ """
+ pass
+
+ def grant(self):
+ """Grant a user access to this model.
+
+ """
+ pass
+
+ def import_ssh_key(self):
+ """Add a public SSH key from a trusted indentity source to this model.
+
+ """
+ pass
+ import_ssh_keys = import_ssh_key
+
+ def get_machine(self, machine_id):
+ """Get a machine by id.
+
+ """
+ pass
+
+ def get_machines(self):
+ """Return list of machines in this model.
+
+ """
+ pass
+
+ def get_shares(self):
+ """Return list of all users with access to this model.
+
+ """
+ pass
+
+ def get_spaces(self):
+ """Return list of all known spaces, including associated subnets.
+
+ """
+ pass
+
+ def get_ssh_key(self):
+ """Return known SSH keys for this model.
+
+ """
+ pass
+ get_ssh_keys = get_ssh_key
+
+ def get_storage(self):
+ """Return details of storage instances.
+
+ """
+ pass
+
+ def get_storage_pools(self):
+ """Return list of storage pools.
+
+ """
+ pass
+
+ def get_subnets(self):
+ """Return list of known subnets.
+
+ """
+ pass
+
+ def remove_blocks(self):
+ """Remove all blocks from this model.
+
+ """
+ pass
+
+ def remove_backup(self):
+ """Delete a backup.
+
+ """
+ pass
+
+ def remove_cached_images(self):
+ """Remove cached OS images.
+
+ """
+ pass
+
+ def remove_machine(self):
+ """Remove a machine from this model.
+
+ """
+ pass
+ remove_machines = remove_machine
+
+ def remove_ssh_key(self):
+ """Remove a public SSH key(s) from this model.
+
+ """
+ pass
+ remove_ssh_keys = remove_ssh_key
+
+ def resolved(self):
+ """Mark unit errors resolved.
+
+ """
+ pass
+
+ def restore_backup(self):
+ """Restore a backup archive to a new controller.
+
+ """
+ pass
+
+ def retry_provisioning(self):
+ """Retry provisioning for failed machines.
+
+ """
+ pass
+
+ def revoke(self):
+ """Revoke a user's access to this model.
+
+ """
+ pass
+
+ def run(self):
+ """Run command on all machines in this model.
+
+ """
+ pass
+
+ def set_config(self):
+ """Set configuration keys on this model.
+
+ """
+ pass
+
+ def set_constraints(self):
+ """Set machine constraints on this model.
+
+ """
+ pass
+
+ def get_action_output(self, action_uuid):
+ """Get the results of an action by ID.
+
+ """
+ pass
+
+ def get_action_status(self, uuid_or_prefix):
+ """Get the status of all actions, filtered by ID or prefix.
+
+ """
+ pass
+
+ def get_budget(self, budget_name):
+ """Get budget by name.
+
+ """
+ pass
+
+ def get_status(self):
+ """Return the status of the model.
+
+ """
+ pass
+ status = get_status
+
+ def sync_tools(self):
+ """Copy Juju tools into this model.
+
+ """
+ pass
+
+ def unblock(self, operation):
+ """Unblock an operation that would alter this model.
+
+ """
+ pass
+
+ def unset_config(self):
+ """Unset configuration on this model.
+
+ """
+ pass
+
+ def upgrade_gui(self):
+ """Upgrade the Juju GUI for this model.
+
+ """
+ pass
+
+ def upload_backup(self):
+ """Store a backup archive remotely in Juju.
+
+ """
+ pass
--- /dev/null
+class Service(object):
+ def add_relation(self):
+ """Add a relation to another service.
+
+ """
+ pass
+
+ def add_unit(self):
+ """Add one or more units to this service.
+
+ """
+ pass
+ add_units = add_unit
+
+ def allocate(self):
+ """Allocate budget to this service.
+
+ """
+ pass
+
+ def attach(self):
+ """Upload a file as a resource for this service.
+
+ """
+ pass
+
+ def collect_metrics(self):
+ """Collect metrics on this service.
+
+ """
+ pass
+
+ def destroy_relation(self):
+ """Remove a relation to another service.
+
+ """
+ pass
+ remove_relation = destroy_relation
+
+ def destroy(self):
+ """Remove this service from the model.
+
+ """
+ pass
+ remove = destroy
+
+ def expose(self):
+ """Make this service publicly available over the network.
+
+ """
+ pass
+
+ def get_config(self):
+ """Return the configuration settings for this service.
+
+ """
+ pass
+
+ def get_constraints(self):
+ """Return the machine constraints for this service.
+
+ """
+ pass
+
+ def get_actions(self):
+ """Get actions defined for this service.
+
+ """
+ pass
+
+ def get_resources(self):
+ """Return resources for this service.
+
+ """
+ pass
+
+ def run(self):
+ """Run command on all units for this service.
+
+ """
+ pass
+
+ def set_config(self):
+ """Set configuration options for this service.
+
+ """
+ pass
+
+ def set_constraints(self):
+ """Set machine constraints for this service.
+
+ """
+ pass
+
+ def set_meter_status(self):
+ """Set the meter status on this status.
+
+ """
+ pass
+
+ def set_plan(self):
+ """Set the plan for this service, effective immediately.
+
+ """
+ pass
+
+ def unexpose(self):
+ """Remove public availability over the network for this service.
+
+ """
+ pass
+
+ def update_allocation(self):
+ """Update existing allocation for this service.
+
+ """
+ pass
+
+ def upgrade_charm(self):
+ """Upgrade the charm for this service.
+
+ """
+ pass
--- /dev/null
+class Unit(object):
+ def add_storage(self):
+ """Add unit storage dynamically.
+
+ """
+ pass
+
+ def collect_metrics(self):
+ """Collect metrics on this unit.
+
+ """
+ pass
+
+ def destroy(self):
+ """Destroy this unit.
+
+ """
+ pass
+ remove = destroy
+
+ def get_resources(self):
+ """Return resources for this unit.
+
+ """
+ pass
+
+ def run(self):
+ """Run command on this unit.
+
+ """
+ pass
+
+ def run_action(self):
+ """Run action on this unit.
+
+ """
+ pass
+
+ def scp(self):
+ """Transfer files to this unit.
+
+ """
+ pass
+
+ def set_meter_status(self):
+ """Set the meter status on this unit.
+
+ """
+ pass
+
+ def ssh(self):
+ """Execute a command over SSH on this unit.
+
+ """
+ pass
+
+ def status_history(self):
+ """Get status history for this unit.
+
+ """
+ pass