Fossology Users¶
Methods used to access “users/” endpoints.
- class fossology.users.Users¶
Class dedicated to all “users” related endpoints
- create_user(user_spec: dict)¶
Create a new Fossology user
API Endpoint: POST /users
- Example:
>>> user_spec = { ... "id": 0, ... "name": "New User", ... "description": "A brand new user", ... "email": "new.user@fossology.com", ... "accessLevel": "none", ... "rootFolderId": 0, ... "emailNotification": True, ... "defaultGroup": 0, ... "agents": { ... "bucket": True, ... "copyright_email_author": True, ... "ecc": True, ... "keyword": True, ... "mime": True, ... "monk": True, ... "nomos": True, ... "ojo": True, ... "package": True, ... "reso": True, ... "heritage": True ... }, ... "defaultBucketpool": 0, ... "user_pass": "$PASSWORD", ... "defaultVisibility": "public" ... } >>> foss.create_user(user_spec)
- Parameters:
user_spec (dict) – the user creation data
- Raises:
FossologyApiError – if the REST call failed
- delete_user(user)¶
Delete a Fossology user.
API Endpoint: DELETE /users/{id}
- Parameters:
user (User) – the user to be deleted
- Raises:
FossologyApiError – if the REST call failed
- detail_user(user_id: int)¶
Get details of Fossology user.
API Endpoint: GET /users/{id}
- Parameters:
id (int) – the ID of the user
- Returns:
the requested user’s details
- Return type:
- Raises:
FossologyApiError – if the REST call failed
- list_users()¶
List all users from the Fossology instance
API Endpoint: GET /users
- Returns:
the list of users
- Return type:
list of User
- Raises:
FossologyApiError – if the REST call failed