cterasdk.core.users module#

class cterasdk.core.users.Credentials(portal)#

Bases: BaseCommand

Portal Credential Management APIs

Variables:

s3 (cterasdk.core.credentials.S3) – Object holding the Portal User S3 Credential Management APIs.

class cterasdk.core.users.S3(portal)#

Bases: BaseCommand

S3 Credential Management APIs

all(user_account)#

List Credentials

Parameters:

user_account (cterasdk.core.types.UserAccount) – User account

create(user_account)#

Create Credential

Parameters:

user_account (cterasdk.core.types.UserAccount) – User account

delete(access_key_id, user_account)#

Delete Credential

Parameters:
class cterasdk.core.users.Users(portal)#

Bases: BaseCommand

Portal User Management APIs

Variables:

credentials (cterasdk.core.credentials.Credentials) – Object holding Portal User Credential Management APIs.

add(name, email, first_name, last_name, password, role, company=None, comment=None, password_change=False)#

Create a local user account

Parameters:
  • name (str) – User name for the new user

  • email (str) – E-mail address of the new user

  • first_name (str) – The first name of the new user

  • last_name (str) – The last name of the new user

  • password (str) – Password for the new user

  • role (cterasdk.core.enum.Role) – User role of the new user

  • company (str,optional) – The name of the company of the new user, defaults to None

  • comment (str,optional) – Additional comment for the new user, defaults to None

  • password_change (variable,optional) – Require the user to change the password on the first login. Pass datetime.date for a specific date, integer for days from creation, or True for immediate , defaults to False

apply_changes(wait=False)#

Apply provisioning changes.

Parameters:

wait (bool,optional) – Wait for all changes to apply

default = ['name']#
delete(user)#

Delete a user

Parameters:

user (cterasdk.core.types.UserAccount) – the user account

get(user_account, include=None)#

Get a user account

Parameters:
  • user_account (cterasdk.core.types.UserAccount) – User account, including the user directory and user name

  • include (list[str]) – List of fields to retrieve, defaults to [‘name’]

Returns:

The user account, including the requested fields

list_domain_users(domain, include=None)#

List all the users in the domain

Parameters:
  • domain (str) – Domain name

  • include (list[str]) – List of fields to retrieve, defaults to [‘name’]

Returns:

Iterator for all the domain users

Return type:

cterasdk.lib.iterator.Iterator

list_local_users(include=None)#

List all local users

Parameters:

include (list[str]) – List of fields to retrieve, defaults to [‘name’]

Returns:

Iterator for all local users

Return type:

cterasdk.lib.iterator.Iterator

modify(current_username, new_username=None, email=None, first_name=None, last_name=None, password=None, role=None, company=None, comment=None)#

Modify a local user account

Parameters:
  • current_username (str) – The current user name

  • new_username (str,optional) – New name

  • email (str,optional) – E-mail address

  • first_name (str,optional) – First name

  • last_name (str,optional) – Last name

  • password (str,optional) – Password

  • role (cterasdk.core.enum.Role,optional) – User role

  • company (str,optional) – Company name

  • comment (str,optional) – Comment