Users¶
Methods described in this section relate to the users API.
These methods can be accessed at TenableIE.users
.
- class UsersAPI(api: APISession)[source]¶
- change_password(old_password: str, new_password: str) → None[source]¶
Update a user password
- Parameters:
- Return type:
None
Examples
>>> tie.users.change_password( ... old_password='old_password', ... new_password='new_password' ... )
- create(name: str, email: str, password: str, **kwargs) → List[Dict][source]¶
Create users
- Parameters:
name (str) – The name of new user.
email (str) – The email address of the user.
password (str) – The password for the new user.
surname (optional, str) – The surname of new user.
department (optional, str) – The department of user.
biography (optional, str) – The biography of user.
active (optional, bool) – is the user active?
picture (optional, List[int]) – The list of picture numbers
- Returns:
The created user objects
- Return type:
Example
>>> tie.users.create( ... name='username', ... email='test@domain.com', ... password='user_password', ... active=True ... )
- create_password(email: str) → None[source]¶
Sends an email to create new password
- Parameters:
email (str) – The email address of the user.
- Return type:
None
Examples
>>> tie.users.create_password(email='test@domain.com')
- delete(user_id: str) → None[source]¶
Delete an existing user
- Parameters:
user_id (str) – The user instance identifier.
- Return type:
None
Examples
>>> tie.users.delete(user_id='1')
- details(user_id: str) → Dict[source]¶
Retrieves the details for a specific user
- Parameters:
user_id (str) – The user instance identifier.
- Returns:
the user object.
- Return type:
Examples
>>> tie.users.details('1')
- info() → Dict[source]¶
Gets user information
- Returns:
The user info object
- Return type:
Example
>>> tie.users.info()
- list() → List[Dict][source]¶
Retrieve all users
- Returns:
The list of users objects
- Return type:
Examples
>>> tie.users.list()
- retrieve_password(token: str, new_password: str) → None[source]¶
Retrieves a user password
Examples
>>> tie.users.retrieve_password( ... token='token', ... new_password='new_password' ... )
- update(user_id: str, **kwargs) → Dict[source]¶
Update an existing user
- Parameters:
user_id (str) – The user instance identifier.
name (optional, str) – The name of new user.
email (optional, str) – The email address of the user.
password (optional, str) – The password for the new user.
surname (optional, str) – The surname of new user.
department (optional, str) – The department of user.
biography (optional, str) – The biography of user.
active (optional, bool) – is the user active?
picture (optional, List[int]) – The list of picture numbers
- Returns:
The updated user object.
- Return type:
Examples
>>> tie.users.update( ... user_id='1', ... name='EDITED' ... )