Users API Reference

Users

class neuro_sdk.Users

User management subsystem, available as Client.users.

coroutine get_acl(user: str, scheme: Optional[str] = None, *, uri: Optional[URL] = None) Sequence[Permission][source]

Get a list of permissions for user.

Parameters
  • user (str) – user name of person whom permissions are retrieved.

  • scheme (str) – a filter to fetch permissions for specified URI scheme only, e.g. "job" or "storage". Passing scheme is equivalent to passing uri=scheme + ":".

  • uri (URL) – a filter to fetch permissions for specified URI prefix only, e.g. URL("job:") or URL("storage://mycluster/myname/mydir"). You should specify full URI.

Returns

a typing.Sequence of Permission objects. Consider the return type as immutable list.

coroutine get_shares(user: str, scheme: Optional[str] = None, *, uri: Optional[URL] = None) Sequence[Share][source]

Get resources shared with user by others.

Parameters
  • user (str) – user name of person whom shares are retrieved.

  • scheme (str) – a filter to fetch shares for specified URI scheme only, e.g. "job" or "storage". Passing scheme is equivalent to passing uri=scheme + ":".

  • uri (URL) – a filter to fetch permissions for specified URI prefix only, e.g. "job:" or "storage://mycluster/myname/mydir". You should specify full URI.

Returns

a typing.Sequence of Share objects. Consider the return type as immutable list.

coroutine get_subroles(user: str) Sequence[str][source]

Get subroles of given user.

Parameters

user (str) – user name of person whom subroles are retrieved.

Returns

a typing.Sequence of str objects. Consider the return type as immutable list.

coroutine share(user: str, permission: Permission) None[source]

Share a resource specified by permission with user.

Parameters
  • user (str) – user name to share a resource with.

  • permission (Permission) – a new permission to add.

coroutine revoke(user: str, uri: URL) None[source]

Revoke all permissions for a resource specified by uri from user.

Parameters
  • user (str) – user name to revoke a resource from.

  • uri (URL) – a resource to revoke.

coroutine add(role_name: str) None[source]

Add new role.

Parameters

role_name (str) – role name. Components are separated by “/”.

coroutine remove(role_name: str) None[source]

Remove existing role.

Parameters

role_name (str) – role name. Components are separated by “/”.

Action

class neuro_sdk.Action

Enumeration that describes granted rights.

Can be one of the following values:

READ

Read-only access.

WRITE

Read and write access.

MANAGE

Full access: read, write and change access mode are allowed.

Share

class neuro_sdk.Share

Read-only dataclass for describing objects shared with user.

user

User name of person who shared a resource.

permission

Share specification (uri and action), Permission.

Permission

class neuro_sdk.Permission

Read-only dataclass for describing a resource.

uri

yarl.URL of resource, e.g. URL("storage:folder")

action

Access mode for resource, Action enumeration.