vantage6.client.subclients.store.user.StoreUserSubClient

class StoreUserSubClient(parent)

Bases: SubClient

Subclient for the user registrations in the algorithm store.

__init__(parent)

Methods

__init__(parent)

delete(id_)

Delete a user registration by id

get(id_)

Get a user registration by id

list([username, role, page, per_page])

List algorithms

register(username, roles)

Register a vantage6 user in this algorithm store.

update(id_, roles)

Update a user registration by id

delete(id_)

Delete a user registration by id

Parameters:

id (int) – The id of the user registration

Return type:

None

get(id_)

Get a user registration by id

Parameters:
  • id (int) – The id of the user registration

  • field (str, optional) – Which data field to keep in the result. For instance, “field=’username’” will only return the username of the user. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the result. For instance, “fields=[‘username’, ‘id’]” will only return the username and id of the user. Default is None.

Returns:

The user

Return type:

dict

list(username=None, role=None, page=1, per_page=10)

List algorithms

Parameters:
  • username (str, optional) – Filter by username (with LIKE operator).

  • role (int, optional) – Filter by role id.

  • field (str, optional) – Which data field to keep in the result. For instance, “field=’username’” will only return the username of the registered users. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the result. For instance, “fields=[‘username’, ‘id’]” will only return the username and id of the registered users. Default is None.

  • filter (tuple, optional) – Filter the result on key-value pairs. For instance, “filter_=(‘username’, ‘my_username’)” will only return the registered users with the username ‘my_username’. Default is None.

  • filters (list[tuple], optional) – Filter the result on multiple key-value pairs. For instance, “filters=[(‘username’, ‘my_username’), (‘id’, 1)]” will only return the registered users with the username ‘my_username’ and id 1. Default is None.

  • page (int, optional) – Page number for pagination (default=1)

  • per_page (int, optional) – Number of items per page (default=10)

Returns:

List of user registrations

Return type:

list[dict]

register(username, roles)

Register a vantage6 user in this algorithm store.

Parameters:
  • username (str) – The username of the user

  • roles (list[int]) – The roles of the user in this algorithm store

  • field (str, optional) – Which data field to keep in the returned dict. For instance, “field=’username’” will only return the username of the user. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the returned dict. For instance, “fields=[‘username’, ‘id’]” will only return the username and id of the user. Default is None.

Returns:

The user registration

Return type:

dict

update(id_, roles)

Update a user registration by id

Parameters:
  • id (int) – The id of the user registration

  • roles (list[int]) – The new roles of the user in this algorithm store

  • field (str, optional) – Which data field to keep in the returned dict. For instance, “field=’username’” will only return the username of the user. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the returned dict. For instance, “fields=[‘username’, ‘id’]” will only return the username and id of the user. Default is None.

Returns:

The updated user registration

Return type:

dict