Skip to content

Workflow REST API

Chris Churas edited this page May 13, 2015 · 16 revisions
Call Example URL
Create a Workflow /rest/workflows
Update a Workflow /rest/workflows/1234
Get a Workflow /rest/workflows/1234
Get a list of Workflows /rest/workflows
Delete a Workflow /rest/workflows/1234

Create a Workflow

Creates a new Workflow. Upon success a Json representation of the Workflow is returned with id set.

Method: POST
Path: /rest/workflows
Content-Type: application/json
Content:

Json representation of workflow. If version is 0 or less it is set to 1. If workflow has id then a lookup is done to see if it exists already. If the workflow already exists this workflow is given a new id and the old id is set as parent. The version is also incremented by one. If create date is not set, it is set to time of insert.

Return: Json representation of Workflow with id set Example return
Error: Returns 500 Internal Service Error

Example Curl call:

curl -X POST -H "Content-Type: application/json" \
-d '{"name":"wf9","id":9,"parameters":[{"type":null,"hidden":false,"displayName":"displayP","required":false,"valueMap":null,"help":null,"delimiterValue":null,"validationType":null,"advanced":false,"validationHelp":null,"maxValue":0.0,"minValue":0.0,"maxLength":0,"validationRegex":null,"maxFileSize":0,"name":"pname","value":"theValue"},{"type":null,"hidden":false,"displayName":"displayP2","required":false,"valueMap":null,"help":null,"delimiterValue":null,"validationType":null,"advanced":false,"validationHelp":null,"maxValue":0.0,"minValue":0.0,"maxLength":0,"validationRegex":null,"maxFileSize":0,"name":"pname2","value":"theValue2"}],"description":"workflow 9"}' \ 
https://crbsworkflow.appspot.com/rest/workflows

Update a Workflow

Updates version and delete status of Workflow

Method: POST
Path: /rest/workflows/<WORKFLOW ID>?deleted=[]&resave=[]&version=[]
Content-Type: application/json
Content:

Just pass {} since the id of the Workflow is passed in the URL.

Query Parameters:
  • deleted Sets deletion value of Workflow. true for deleted false if not.
  • resave If set to true workflow is resaved in data store. Note: deleted and version are ignored if this is set to true
  • version Sets version value of Workflow. Should be a value >= 1
Return: Json representation of Workflow with changes Example return
Error: Returns 500 Internal Service Error

Example Curl call:

curl -X POST -H "Content-Type: application/json" \
-d '{}' http://localhost:8080/rest/workflows/123?deleted=true&version=3

Get a Workflow

Obtains a single Workflow in Json format

Method: GET
Path: /rest/workflows/<WORKFLOW ID>
Content-Type: application/json
Return: Json representation of Workflow Example return
Error: Returns 500 Internal Service Error

Example Curl call:

curl -X GET \ 
https://crbsworkflow.appspot.com/rest/workflows/1

Get a list of Workflows

Gets a list of Workflows in Json format.

Method: GET
Path: /rest/workflows
Content-Type: application/json
Return: Json representation of Workflows Example return
Error: Returns 500 Internal Service Error

Example Curl call:

curl -X GET \ 
https://crbsworkflow.appspot.com/rest/workflows

Delete a Workflow

Deletes a Workflow. Default operation is to perform a logical delete where deleted field is set to true. This method will return Json denoting outcome of operation. A workflow can only be deleted if no jobs have been run against it.

Method: DELETE
Path: /rest/workflows/<WORKFLOW ID>?permanentlydelete=[]
Query Parameters:
  • permanentlydelete If set to true then delete will completely remove workflow from system, otherwise a logical delete will be performed if unset or false
Content-Type: application/json
Return: Json representation of a DeleteReport Example return
Error: Returns 500 Internal Service Error

Example Curl call:

curl -X DELETE \ 
https://crbsworkflow.appspot.com/rest/workflows/12345
Clone this wiki locally