Role API

class supervisely_lib.api.role_api.RoleApi(api)[source]

Bases: supervisely_lib.api.module_api.ModuleApiBase

API for working with Roles. RoleApi object is immutable.

Parameters

api (Api) – API connection to the server

Usage example
# You can connect to API directly
address = 'https://app.supervise.ly/'
token = 'Your Supervisely API Token'
api = sly.Api(address, token)

# Or you can use API from environment
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
api = sly.Api.from_env()

roles = api.role.get_list() # api usage example
class DefaultRole(value)[source]

Bases: enum.IntEnum

An enumeration.

ADMIN = 1
DEVELOPER = 2
ANNOTATOR = 3
VIEWER = 4
static info_sequence()[source]

NamedTuple RoleInfo information about Role.

Example
RoleInfo(id=71,
         role='manager',
         created_at='2019-12-10T14:31:41.878Z',
         updated_at='2019-12-10T14:31:41.878Z')
get_list(filters: Optional[List[dict]] = None) → list[source]

List of all roles that are available on private Supervisely instance.

Parameters

filters (list) – List of params to sort output Roles.

Returns

List of all roles with information. See info_sequence

Return type

list

Usage example
os.environ['SERVER_ADDRESS'] = 'https://app.supervise.ly'
os.environ['API_TOKEN'] = 'Your Supervisely API Token'
api = sly.Api.from_env()

roles = api.role.get_list()
InfoType

alias of supervisely_lib.api.module_api.RoleInfo