flowserv.service.descriptor module

API component that provides information about the service iteself.

class flowserv.service.descriptor.ServiceDescriptor(doc: Optional[Dict] = None, routes: Optional[Dict] = {'files:delete': 'uploads/{userGroupId}/files/{fileId}', 'files:download': 'uploads/{userGroupId}/files/{fileId}', 'files:list': 'uploads/{userGroupId}/files', 'files:upload': 'uploads/{userGroupId}/files', 'groups:create': 'workflows/{workflowId}/groups', 'groups:delete': 'groups/{userGroupId}', 'groups:get': 'groups/{userGroupId}', 'groups:list': 'groups', 'groups:runs': 'groups/{userGroupId}/runs?state={state}', 'groups:update': 'groups/{userGroupId}', 'leaderboard': 'workflows/{workflowId}/leaderboard?orderBy={orderBy}&includeAll={includeAll}', 'runs:cancel': 'runs/{runId}', 'runs:delete': 'runs/{runId}', 'runs:download:archive': 'runs/{runId}/downloads/archive', 'runs:download:file': 'runs/{runId}/downloads/files/{fileId}', 'runs:get': 'runs/{runId}', 'runs:start': 'groups/{userGroupId}/runs', 'service': '', 'users:activate': 'users/activate', 'users:list': 'users', 'users:login': 'users/login', 'users:logout': 'users/logout', 'users:pwd:request': 'users/password/request', 'users:pwd:reset': 'users/password/reset', 'users:register': 'users/register', 'users:whoami': 'users/whoami', 'workflows:download:archive': 'workflows/{workflowId}/downloads/archive', 'workflows:download:file': 'workflows/{workflowId}/downloads/files/{fileId}', 'workflows:get': 'workflows/{workflowId}', 'workflows:groups': 'workflows/{workflowId}/groups', 'workflows:list': 'workflows'}, serializer: Optional[flowserv.view.descriptor.ServiceDescriptorSerializer] = None)

Bases: object

API component that provides the API sevice descriptor that contains the basic information and supported route patterns for the service.

static from_config(env: Dict, username: Optional[str] = None) flowserv.service.descriptor.ServiceDescriptor

Get descriptor with basic information from values in the given configuration settings.

Parameters
  • env (dict, default=None) – Dictionary that provides access to configuration parameter values.

  • username (string, default=None) – Optional name for an authenticated user.

Return type

flowserv.service.descriptor.ServiceDescriptor

routes() Dict

Get dictionary of supported API routes. The returned dictionary maps unique route identifiers their route Url pattern.

Return type

dict

to_dict() Dict

Get serialization of descriptor containing the basic information about the API. If the user provided a valid access token then the user name will be set and included in the serialized object. If no user name is present in the returned dictionary the user is not authenticated or authentication is not configured (i.e., open access).

Return type

dict

urls(key: str, **kwargs) str

Get the full Url for the route with the given key.

Parameters
  • key (string) – Url route pattern key.

  • kwargs (dict) – Optional key word arguments to replace Url pattern variables.

Return type

string