b15c687a47f147b9b62b2e44042ac8ad11264e73
1 class Controller(object):
2 def add_model(self
, name
, config
=None, credential
=None, owner
=None):
3 """Add a model to this controller.
5 :param str name: Name of the model
6 :param dict config: Model configuration
7 :param str credential: e.g. '<cloud>:<credential>'
8 :param str owner: Owner username
13 def add_user(self
, username
, display_name
=None, acl
=None, models
=None):
14 """Add a user to this controller.
16 :param str username: Username
17 :param str display_name: Display name
18 :param str acl: Access control, e.g. 'read'
19 :param list models: Models to which the user is granted access
24 def change_user_password(self
, username
, password
):
25 """Change the password for a user in this controller.
27 :param str username: Username
28 :param str password: New password
33 def destroy(self
, destroy_all_models
=False):
34 """Destroy this controller.
36 :param bool destroy_all_models: Destroy all hosted models in the
42 def disable_user(self
, username
):
45 :param str username: Username
50 def enable_user(self
):
51 """Re-enable a previously disabled user.
57 """Forcibly terminate all machines and other associated resources for
63 def get_models(self
, all_
=False, username
=None):
64 """Return list of available models on this controller.
66 :param bool all_: List all models, regardless of user accessibilty
68 :param str username: User for which to list models (admin use only)
73 def get_payloads(self
, *patterns
):
74 """Return list of known payloads.
76 :param str \*patterns: Patterns to match against
78 Each pattern will be checked against the following info in Juju::
91 def get_users(self
, all_
=False):
92 """Return list of users that can connect to this controller.
94 :param bool all_: Include disabled users
100 """Log in to this controller.
105 def logout(self
, force
=False):
106 """Log out of this controller.
108 :param bool force: Don't fail even if user not previously logged in
114 def get_model(self
, name
):
115 """Get a model by name.
120 def get_user(self
, name
):
121 """Get a user by name.