commons Package

decoders

class tvb.interfaces.rest.commons.decoders.CustomDecoder(*args, **kargs)[source]

Bases: JSONDecoder

static custom_hook(d)[source]

dtos

class tvb.interfaces.rest.commons.dtos.AlgorithmDto(algorithm: Algorithm = None, **kwargs: {})[source]

Bases: BaseDto

class tvb.interfaces.rest.commons.dtos.BaseDto[source]

Bases: object

update(kwargs: {}) None[source]

This method is setting object fields starting from a dictionary :param kwargs: fields dictionary (rest server response)

class tvb.interfaces.rest.commons.dtos.DataTypeDto(datatype: DataType = None, **kwargs: {})[source]

Bases: BaseDto

class tvb.interfaces.rest.commons.dtos.OperationDto(operation: {} = None, **kwargs: {})[source]

Bases: BaseDto

property description
property displayname
class tvb.interfaces.rest.commons.dtos.ProjectDto(project: Project = None, **kwargs: {})[source]

Bases: BaseDto

class tvb.interfaces.rest.commons.dtos.UserDto(user: User = None, **kwargs: {})[source]

Bases: BaseDto

exceptions

exception tvb.interfaces.rest.commons.exceptions.AuthorizationRequestException(message=None, code=401)[source]

Bases: BaseRestException

get_default_message()[source]
exception tvb.interfaces.rest.commons.exceptions.BadRequestException(message, payload=None)[source]

Bases: BaseRestException

get_default_message()[source]
exception tvb.interfaces.rest.commons.exceptions.BaseRestException(message=None, code=None, payload=None)[source]

Bases: TVBException

abstract get_default_message()[source]
to_dict()[source]
exception tvb.interfaces.rest.commons.exceptions.ClientException(message, code=400)[source]

Bases: BaseRestException

get_default_message()[source]
exception tvb.interfaces.rest.commons.exceptions.InvalidIdentifierException(message=None, payload=None)[source]

Bases: BaseRestException

get_default_message()[source]
exception tvb.interfaces.rest.commons.exceptions.InvalidInputException(message=None, payload=None)[source]

Bases: BadRequestException

get_default_message()[source]
exception tvb.interfaces.rest.commons.exceptions.ServiceException(message, code=500, payload=None)[source]

Bases: BaseRestException

get_default_message()[source]
message_prefix = 'Something went wrong on the server side'

files_helper

tvb.interfaces.rest.commons.files_helper.create_temp_folder()[source]
tvb.interfaces.rest.commons.files_helper.save_file(file_path, response)[source]
tvb.interfaces.rest.commons.files_helper.save_temporary_file(file, destination_folder=None)[source]

status_codes

strings

class tvb.interfaces.rest.commons.strings.FormKeyInput(value)[source]

Bases: Enum

An enumeration.

CODE = 'code'
CREATE_PROJECT_DESCRIPTION = 'project_description'
CREATE_PROJECT_NAME = 'project_name'
KEYCLOAK_REFRESH_TOKEN = 'refresh_token'
NEW_MEMBERS_GID = 'new_members_gid'
REDIRECT_URI = 'redirect_uri'
class tvb.interfaces.rest.commons.strings.LinkPlaceholder(value)[source]

Bases: Enum

An enumeration.

ALG_CLASSNAME = 'algorithm_classname'
ALG_MODULE = 'algorithm_module'
DATATYPE_GID = 'datatype_gid'
OPERATION_GID = 'operation_gid'
PROJECT_GID = 'project_gid'
USERNAME = 'username'
class tvb.interfaces.rest.commons.strings.RequestFileKey(value)[source]

Bases: Enum

An enumeration.

LAUNCH_ANALYZERS_MODEL_FILE = 'model_file'
SIMULATION_FILE_KEY = 'simulation_zip_file'
SIMULATION_FILE_NAME = 'SimulationData.zip'

Bases: Enum

An enumeration.

DATATYPE_EXTRA_INFO = '/{datatype_gid}/extra_info'
DATATYPE_OPERATIONS = '/{datatype_gid}/operations'
DATA_IN_PROJECT = '/{project_gid}/data'
FIRE_SIMULATION = '/{project_gid}'
GET_DATATYPE = '/{datatype_gid}'
IS_DATA_ENCRYPTED = '/is_data_encrypted'
LAUNCH_OPERATION = '/{project_gid}/algorithm/{algorithm_module}/{algorithm_classname}'
LOGIN = '/login'
OPERATIONS_IN_PROJECT = '/{project_gid}/operations'
OPERATION_RESULTS = '/{operation_gid}/results'
OPERATION_STATUS = '/{operation_gid}/status'
PROJECTS = '/logged/projects'
PROJECT_MEMBERS = '/{project_gid}/members'
USEFUL_URLS = '/kc-urls'
compute_url(include_namespace=False, values=None)[source]
class tvb.interfaces.rest.commons.strings.RestNamespace(value)[source]

Bases: Enum

An enumeration.

DATATYPES = '/datatypes'
OPERATIONS = '/operations'
PROJECTS = '/projects'
SIMULATION = '/simulation'
USERS = '/users'
class tvb.interfaces.rest.commons.strings.Strings(value)[source]

Bases: Enum

An enumeration.

ACCOUNT_URL = 'account_url'
AUTH_HEADER = 'Authorization'
AUTH_URL = 'auth_url'
BASE_PATH = 'api'
BEARER = 'Bearer '
PAGE_NUMBER = 'page'