juju.user

Summary

User

Methods:

Reference

class juju.user.User(controller, user_info, secret_key=None)[source]

Bases: object

property access

Identifies the controller access levels of this user

property created_by
property date_created
coroutine disable()[source]

Disable this user.

property disabled
property display_name
coroutine enable()[source]

Re-enable this user.

property enabled
coroutine grant(acl, **kwargs)[source]

Grant the given access level of this user on model, offer or controller, depending on the access level (see the access module)

Parameters:

acl (str) – Access control level

Depending on the access level, the available keyword parameters are: :param str model_name: name of the model if acl is one of model access levels :param str offer_url: url for the offer if acl is one of offer access levels

Returns:

None or Error

coroutine grant_or_revoke(acl, action, **kwargs)[source]

Grants or revokes the given access level of this user on model, offer or controller, depending on the access level (see the access module)

Parameters:
  • acl (str) – Access control level

  • action (str) – ‘grant’ or ‘revoke’

Depending on the access level, the available keyword parameters are: :param str model_name: name of the model if acl is one of model access levels :param str offer_url: url for the offer if acl is one of offer access levels

Returns:

True if access changed, False if user already has it

property last_connection
coroutine modify_controller_access(acl, action)[source]

Grants or revokes the given access level for this user on the current controller

Parameters:
  • acl (str) – Controller access levels (see access module)

  • action (str) – grant/revoke

Return bool:

True if access changed, Error if user already has it

coroutine modify_model_access(acl, action, model_name)[source]

Grants or revokes the given access level for this user for a given model

Parameters:
  • acl (str) – Model access levels (see access module)

  • action (str) – grant/revoke

  • model_name (str) – Name of the model

Return bool:

True if access changed, Error if user already has it

coroutine modify_offer_access(acl, action, offer_url)[source]

Grants or revokes the given access level for this user on a given offer

Parameters:
  • acl (str) – Controller access levels (see access module)

  • action (str) – grant/revoke

  • offer_url (str) – url for the offer

Return bool:

True if access changed, Error if user already has it

coroutine revoke(acl='login', **kwargs)[source]

The opposite of user.grant(). Revokes the given access level of this user on model, offer or controller, depending on the given access level.

Parameters:

acl (str) – Access control level (see access module)

Available keyword parameters are: :param str model_name: name of the model if acl is one of model access levels :param str offer_url: url for the offer if acl is one of offer access levels

property secret_key
coroutine set_password(password)[source]

Update this user’s password.

property tag
property username