-
Notifications
You must be signed in to change notification settings - Fork 0
Workflow REST API
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 |
Creates a new Workflow. Upon success a Json representation of the Workflow is returned with id set.
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
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
Updates version and delete status of Workflow
Just pass {} since the id of the Workflow is passed in the URL.
- 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
Example Curl call:
curl -X POST -H "Content-Type: application/json" \
-d '{}' http://localhost:8080/rest/workflows/123?deleted=true&version=3
Obtains a single Workflow in Json format
Return: Json representation of Workflow
Example return
Example Curl call:
curl -X GET \
https://crbsworkflow.appspot.com/rest/workflows/1
Gets a list of Workflows in Json format.
Return: Json representation of Workflows
Example return
Example Curl call:
curl -X GET \
https://crbsworkflow.appspot.com/rest/workflows
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.
- permanentlydelete If set to true then delete will completely remove workflow from system, otherwise a logical delete will be performed if unset or false
Return: Json representation of a DeleteReport
Example return
Example Curl call:
curl -X DELETE \
https://crbsworkflow.appspot.com/rest/workflows/12345