Users

class txcouchbase.management.users.UserManager(impl: TxUserMgmtInterface)

Performs management operations on users, groups and roles.

change_password(new_password: str, options: ChangePasswordOptions | None = None, **kwargs: Unpack[ChangePasswordOptionsKwargs]) → Deferred[None]

Changes the password of the currently authenticated user.

The previous credentials stop being valid, so the SDK must be restarted and a new connection established with the new password.

Parameters:
  • new_password (str) – The new password for the user.

  • options (ChangePasswordOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

InvalidArgumentException – If the new password is not a valid value or type.

drop_group(group_name: str, options: DropGroupOptions | None = None, **kwargs: Unpack[DropGroupOptionsKwargs]) → Deferred[None]

Drops an existing group.

Parameters:
  • group_name (str) – The name of the group to drop.

  • options (DropGroupOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

GroupNotFoundException – If the group does not exist.

drop_user(username: str, options: DropUserOptions | None = None, **kwargs: Unpack[DropUserOptionsKwargs]) → Deferred[None]

Drops an existing user.

Parameters:
  • username (str) – The name of the user to drop.

  • options (DropUserOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

UserNotFoundException – If the user does not exist.

get_all_groups(options: GetAllGroupsOptions | None = None, **kwargs: Unpack[GetAllGroupsOptionsKwargs]) → Deferred[Iterable[Group]]

Returns a list of all existing groups.

Parameters:
  • options (GetAllGroupsOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

A list of existing groups.

Return type:

Deferred[Iterable[Group]]

get_all_users(options: GetAllUsersOptions | None = None, **kwargs: Unpack[GetAllUsersOptionsKwargs]) → Deferred[Iterable[UserAndMetadata]]

Returns a list of all existing users.

Parameters:
  • options (GetAllUsersOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

A list of existing users.

Return type:

Deferred[Iterable[UserAndMetadata]]

get_group(group_name: str, options: GetGroupOptions | None = None, **kwargs: Unpack[GetGroupOptionsKwargs]) → Deferred[Group]

Returns a group by it’s name.

Parameters:
  • group_name (str) – The name of the group to retrieve.

  • options (GetGroupOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

A Group instance.

Return type:

Deferred[Group]

Raises:

GroupNotFoundException – If the group does not exist.

get_roles(options: GetRolesOptions | None = None, **kwargs: Unpack[GetRolesOptionsKwargs]) → Deferred[Iterable[RoleAndDescription]]

Returns a list of roles available on the server.

Parameters:
  • options (GetRolesOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

A list of roles available on the server.

Return type:

Deferred[Iterable[RoleAndDescription]]

get_user(username: str, options: GetUserOptions | None = None, **kwargs: Unpack[GetUserOptionsKwargs]) → Deferred[UserAndMetadata]

Returns a user by its username.

Parameters:
  • username (str) – The name of the user to retrieve.

  • options (GetUserOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Returns:

The user, with what the server records about it.

Return type:

Deferred[UserAndMetadata]

Raises:

UserNotFoundException – If the user does not exist.

upsert_group(group: Group, options: UpsertGroupOptions | None = None, **kwargs: Unpack[UpsertGroupOptionsKwargs]) → Deferred[None]

Creates a new group or updates an existing group.

Parameters:
  • group (Group) – The group to create or update.

  • options (UpsertGroupOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

InvalidArgumentException – If the provided group argument contains an invalid value or type.

upsert_user(user: User, options: UpsertUserOptions | None = None, **kwargs: Unpack[UpsertUserOptionsKwargs]) → Deferred[None]

Creates a new user or updates an existing user.

Parameters:
  • user (User) – The user to create or update.

  • options (UpsertUserOptions) – Optional parameters for this operation.

  • **kwargs – keyword arguments that can be used as optional parameters for this operation.

Raises:

InvalidArgumentException – If the provided user argument contains an invalid value or type.

This module also publishes these, described where they are first documented: