3. API

3.1. REANA AMQP Publisher

REANA-Commons module to manage AMQP connections on REANA.

class reana_commons.publisher.WorkflowStatusPublisher(connection=None, queue=None, routing_key=None, exchange=None)

Progress publisher to MQ.


Close connection.

publish_workflow_status(workflow_uuid, status, logs='', message=None)

Publish workflow status using the configured.

  • workflow_uudid – String which represents the workflow UUID.
  • status – Integer which represents the status of the workflow, this is defined in the reana-db Workflow models.
  • logs – String which represents the logs which the workflow has produced as output.
  • message – Dictionary which includes additional information can be attached such as the overall progress of the workflow.

3.2. REANA AMQP Consumer

REANA-Commons module to manage AMQP consuming on REANA.

class reana_commons.consumer.BaseConsumer(connection=None, queues=None, message_default_format=None)

Base RabbitMQ consumer.

get_consumers(Consumer, channel)

Map consumers to specific queues.

on_message(body, message)

Implement this method to manipulate the data received.


3.3. REANA utilities

REANA-Commons utils.


Calculate access times of files in workspace.

reana_commons.utils.calculate_hash_of_dir(directory, file_list=None)

Calculate hash of directory.

reana_commons.utils.calculate_job_input_hash(job_spec, workflow_json)

Calculate md5 hash of job specification and workflow json.

reana_commons.utils.click_table_printer(headers, _filter, data)

Generate space separated output for click commands.