Users

Skytap API object wrapping Skytap users.

This roughly translates to the Skytap API call of /v2/users REST call, but gives us better access to the bits and pieces of the user.

If accessed via the command line (python -m skytap.Users) this will return the users from Skytap in a JSON format.

class skytap.Users.Users(json_list=None)

Bases: skytap.models.SkytapGroup.SkytapGroup

Set of Skytap users.

Example:

add(login_name, email=None)

Add one user.

Parameters:
  • login_name (str) – The login id of the account, usually an email.
  • email (str) – The email of the account. If blank, will use login_name.
Returns:

The new user id from Skytap.

Return type:

int

Example:

users = skytap.Users()
new_user = users.add('kermit.frog@fulcrum.net')
print(users[new_user].login_name)
admins()

Count the numbers of admins.

delete(user, transfer_user)

Delete a user.

Warning

This is unrecoverable. Use with caution.

Parameters:
  • user – The user to delete (User or int).
  • transfer_user – Transfer all assets to this user (User or int).
Returns:

True if user deleted.

Return type:

bool

Raises:
  • TypeError – if user or transfer_user is not a User or int.
  • KeyError – If user or transfer_user isn’t a user in the Users list.