Users
dadosfera.services.maestro.get_all_users
get_all_users(maestro_base_url, token, user_deleting)
Fetches all users from the specified Maestro base URL.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
The base URL of the Maestro API.
TYPE:
|
token
|
The authentication token.
TYPE:
|
user_deleting
|
The user performing the deletion action.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
JSON response containing the list of users. |
Raises: requests.exceptions.HTTPError: For failed API requests. Common cases: - 401: Invalid or expired token - 403: Insufficient permissions requests.exceptions.ConnectionError: For network connectivity issues requests.exceptions.Timeout: For request timeouts requests.exceptions.RequestException: For other request-related errors
Source code in dadosfera/services/maestro/users.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
dadosfera.services.maestro.delete_user
delete_user(user_id, token)
Deletes a user by their ID.
PARAMETER | DESCRIPTION |
---|---|
user_id
|
The ID of the user to be deleted.
TYPE:
|
token
|
The authentication token.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
HTTPError
|
For failed API requests. Common cases: - 401: Invalid or expired token - 403: Insufficient permissions |
ConnectionError
|
For network connectivity issues |
Timeout
|
For request timeouts |
RequestException
|
For other request-related errors |
Note: - This operation is irreversible - the user cannot be restored after deletion - The function logs both the start and completion of the deletion process
Source code in dadosfera/services/maestro/users.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
dadosfera.services.maestro.delete_users_from_date
delete_users_from_date(maestro_base_url, threshold_date_str, token, user_deleting)
Deletes users who haven't logged in after a specified date. This is useful for cleaning up stale or abandoned users logins. The deletion is permanent and cannot be undone.
PARAMETER | DESCRIPTION |
---|---|
maestro_base_url
|
The base URL of the Maestro API.
TYPE:
|
threshold_date_str
|
The threshold date in YYYY format.
TYPE:
|
token
|
The authentication token.
TYPE:
|
user_deleting
|
The user performing the deletion action.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the threshold_date_str is not in the correct format. |
Source code in dadosfera/services/maestro/users.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|