flowserv.service.api module

Base class to access all API resources. Different types of resourecs are managed by different components of the API.

class flowserv.service.api.API(service: flowserv.service.descriptor.ServiceDescriptor, workflow_service: flowserv.service.workflow.base.WorkflowService, group_service: flowserv.service.workflow.base.WorkflowService, upload_service: flowserv.service.files.base.UploadFileService, run_service: flowserv.service.run.base.RunService, user_service: flowserv.service.user.base.UserService)

Bases: object

The API object is a wrapper for the following API components:

  • groups()

  • runs()

  • service()

  • uploads()

  • users()

  • workflows()

groups() flowserv.service.group.base.WorkflowGroupService

Get API service component that provides functionality to access and manipulate workflows groups.

Return type

flowserv.service.group.WorkflowGroupService

runs() flowserv.service.run.base.RunService

Get API service component that provides functionality to access workflows runs.

Return type

flowserv.service.run.RunService

server() flowserv.service.descriptor.ServiceDescriptor

Get API component for the service descriptor.

Return type

flowserv.service.server.Service

uploads() flowserv.service.files.base.UploadFileService

Get API service component that provides functionality to access, delete, and upload files for workflows groups.

Return type

flowserv.service.files.UploadFileService

users() flowserv.service.user.base.UserService

Get instance of the user service component.

Return type

flowserv.service.user.UserService

workflows() flowserv.service.workflow.base.WorkflowService

Get API service component that provides functionality to access workflows and workflow leader boards.

Return type

flowserv.service.workflow.WorkflowService

class flowserv.service.api.APIFactory(defaults: Dict)

Bases: flowserv.controller.base.WorkflowController, flowserv.config.Config

Factory pattern for creating API instances. Extends the workflow controller with a __call__ method that returns a context manager for creating new instances of either a local or remote service API.

login(username: str, password: str)

Authenticate the user using the given credentials. Updates the internal configuration with the returned access token.

logout()

Delete an access token from the internal configuration.