Skip to content

Guides | Rest API

Hongsoog Kim edited this page Sep 13, 2022 · 34 revisions

Rest API Guides

In TANGO, there are two types of container.

  • Main container : Project Manager, which coordinates other containers start and stop to proceed workflow.
  • Member containers: All containers except for Project Manager, which perform specific task in whole workflow.

Project Manager keeps the project details and coordinates the member containers task with start()/stop() to start or stop the memeber container, while member containers report their status with status() once start() or stop() is called.

Rest APIs provided by the main container

As a whole workflow coordinator, the main container (Project Manager) should expose following APIs for member containers reports its current status:

status(from=<container_id>, status=<status>)

The member containers calls status() to indicate theirs current status, where <status> is one of the following values:

  • "started" : report that container of <container_id> starts it task.
  • "running" : reports that container of <container_id> is running, reported at interval of<hb_period>
  • "completed": reports that container of <container_id> finishes its task
  • "failed": reports that container of <container_id> fails or stopped.

## Rest APIs provided by the member containers

All containers except for Project Manager should expose following APIs for Project Manager start/stop its workflow participant containers:

start(project_id=<project_id>, user_id=<user_id>, tb_interval=1000)

The Main continer calls start() in order to make the member container start its task.

stop(project_id=<project_id>, user_id=<user_id>)

The Main continer calls stop() in order to make the member container stop its task.