API - trma1big/wfm GitHub Wiki

API

The application expose APIs in order to:

  • login in order to obtain a session token -> http://localhost/login
    • METHOD : POST
    • DATA : username, password and the api = 1
    • RETURN FORMAT : json
    • RETURN : session token
  • list workflow file with status -> http://localhost/api/v1/list/tasks
    • METHOD : GET
    • AUTH : 'X-Access-Token' on header ( token get from login call)
    • RETURN FORMAT : json
    • RETURN : name, file, status
  • list tasks in a workflow with status -> http://localhost/api/v1/jobs/{WORKFLOW NAME}
    • METHOD : GET
    • AUTH : 'X-Access-Token' on header ( token get from login call)
    • RETURN FORMAT : json
    • RETURN : name, file, jobs_id, jobs, jobs_description, status, last_start, last_end
  • manage the status of every single TASK of the workflow -> http://localhost/api/v1/chg_task_status
    • METHOD : POST
    • AUTH : 'X-Access-Token' on header ( token get from login call)
    • DATA FORMAT : json
    • DATA : "wsname" ( workflow name), "taskname" ( jobs returned by previous API ) "status" ( new status value )

possible status value are:

  • 0 - Not running ( when the activity in workflow end)
  • 1 - running ( when the activity in workflow start)
  • 2- Error ( when the activity in workflow end with Errors)

you will find a python utility ( start_all_task.py ) under utility folder that permit to change the status of all workflow with a new status or change a specific status of a task in a workflow. start the utility in order to have a context help with parameter.