You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 47 Next »

Page in development

This page is in development and as such, its contents may be incorrect

The workflow API provides functionality that allows a administrator to perform actions such as adding and configuring workflow

Get all workflows

Lists all the workflows configured in the Aspire

GET /aspire/_api/workflow


Query String Parameters

fromintegerOptionalIndicates the initial page to be retrieved
sizeintegerOptionalSpecifies the size of results page
sortBystringOptionalField by which results are sorted
sortModestringOptional

Sort mode

  • "asc" for ascending sort,
  • "desc" for descending sort
expandstringOptionalList of fields to expand, * will expand everything
sparsebooleanOptionalOnly return minimal data such as identifier, description, name etc


Response

{
  "workflow": [{
    "id": "AAABcID5GBc=",
    "description": "Publish to Elasticsearch",
    ...
  },
  {
    "id": "AAABcIueWUc=",
    "description": "Normalise data",
    ...
  }]
}

Status

Response codeDescription
200Success




Get all workflows, filtered

Lists workflows configured in the Aspire, filtered by a specified criteria

POST /aspire/_api/workflows/getAll


Query String Parameters

NameTypeRequiredDescription
fromintegerOptionalIndicates the initial page to be retrieved
sizeintegerOptionalSpecifies the size of results page
sortBystringOptionalField by which results are sorted
sortModestringOptional

Sort mode

  • "asc" for ascending sort,
  • "desc" for descending sort
expandstringOptionalList of fields to expand, * will expand everything
sparsebooleanOptionalOnly return minimal data such as identifier, description, name etc


Body Parameters

NameTypeRequiredDescription
filterJSONRequiredFilters retrieved connectors. Check the filter definition here


Response

{
  "workflow": [{
    "id": "AAABcID5GBc=",
    "description": "Publish to Elasticsearch",
    ...
  },
  {
    "id": "AAABcIueWUc=",
    "description": "Normalise data",
    ...
  }]
}


Status

Response codeDescription
200Success




Get a single workflow

Get information about a single workflow in Aspire

GET /aspire/_api/workflow/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the workflow to return


Response

{
  "workflow": {
    "id": "AAABcID5GBc=",
    "description": "Publish to Elasticsearch",
    ...
  }
}

Status

Response codeDescription
200Success
404The given workflow id was not found




Add single workflow

Adds a single workflow to Aspire

POST /aspire/_api/workflow


Body Parameters

NameTypeRequiredDescription
descriptionstringRequiredA description of the workflow


Query String Parameters

NameTypeRequiredDescription
typestringRequired

Accepted values are: "connector" and "service"

If connector is set the workflow created with the following events will be created:

  • onScan
  • onAddUpdate
  • onDelete
  • onPublish
  • onError

If service is set the workflow will be created without events.


Example

/aspire/_api/workflow?type=connector
{
  "description": "Publish to Elastic"
}


Response

{
  "workflow": {
    "id": "AAABcID5GBc=",
    "description": "Publish to Elastic",
    "type": "connector"
    ....
  }
}


Status

Response codeDescription
201Created
406Not acceptable - there was an issue validating the input




Delete multiple workflows, filtered

Delete multiple workflows from Aspire, filtered by a specified criteria

POST /aspire/_api/workflows/deleteAll


Body Parameters

NameTypeRequiredDescription
filterJSONRequiredFilters workflows to be deleted. Check the filter definition here


Response

{
  "message": "optional response message"
}

See Response Body for details regrading the response body returned where multiple items are affected with some (or all) returning errors

Status

Response codeDescription
200Success
404Not found - a given credential identifier was not found
406Not acceptable - there was an issue validating the input




Delete single workflow

Delete a single workflow from Aspire.

DELETE /aspire/_api/workflow/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier(s) of the workflow(s) to delete


Example

DELETE /aspire/_api/workflows/AAABcID5GBc=


Response

{
	"message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Get a workflow event

Get a event from a workflow in Aspire.

GET /aspire/_api/workflow/:id/:eventId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow(s) to return
eventIdstringRequiredThe identifier of the event to get


Response

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "event": {
      "id": "onUpdate"
       ....
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Create workflow event(s)

Create one or more workflow events in Aspire.

PUT /aspire/_api/workflow/:id

PUT /aspire/_api/workflow/:id/:eventId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow(s) to add a event to
eventIdstringRequiredThe identifier of the event to add


Examples

Create a single event

Create multiple events (body parameter)

[{
  "id": "scan"
},
{
  "id": "addUpdate"
}]

Create multiple events (alternative version)


Response

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "event": {
      "id": ["scan", "addUpdate"]
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Delete a workflow event

Delete a workflow event from Aspire.

DELETE /aspire/_api/workflow/:id/:eventId


Path  Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow(s) to use
eventIdstringRequiredThe identifier of the event to delete


Response

{
  "message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Create a workflow event item

Create a workflow event item - a rule, condition and the like.

POST /aspire/_api/workflow/:id/:eventId/:type


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow(s) to return
eventIdstringRequiredThe identifier of the event to get
typestringRequiredThe type of the item to create


Body Parameters

The request body parameters will differ depending on the type of item created. Some examples are shown below

Item TypeParameter NameParameter TypeRequiredDescription
ReferenceparentIdstringOptionalThe identifier of the node in to which the item should be inserted. Defaults to the root node

orderIdintegerRequiredThe position (which in the children of the parent node) where this reference should be inserted

ruleIdStringRequiredThe rule to be referenced

enabledbooleanOptionalWhether or not the item is enabled (default true)
ConditionparentIdstringOptionalThe identifier of the node in to which the item should be inserted. Defaults to the root node

valueobjectRequiredThe value to be compared against

enabledbooleanOptionalWhether or not the item is enabled (default true)
ExitparentIdstringOptionalThe identifier of the node in to which the item should be inserted. Defaults to the root node

orderIdintegerRequiredThe position (which in the children of the parent node) where this reference should be inserted

enabledbooleanOptionalWhether or not the item is enabled (default true)


Response

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "event": {
      "id": "onAddUpdate",
      "rule": {
        "id": "AAABcQwxWUc=",
        ...
      }
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Update a workflow event item

Delete one or more services from Aspire.

PUT /aspire/_api/workflow/:id/:eventId/:orderId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow(s) to use
eventIdstringRequired

The identifier of the event to use

orderIdintegerRequiredThe order identifier of the item to update


Body Parameters

The request body parameters will differ depending on the type of item created. See Create a workflow event item above


Response

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "event": {
      "id": "onAddUpdate",
      "rule": {
        "id": "AAABcQwxWUc=",
        ...
      }
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Delete single workflow event item


DELETE /aspire/_api/workflow/:id/:eventId/:parentId/:orderId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to use
eventIdstringRequiredThe identifier of the event to use
parentIdstringRequiredThe identifier of the node with the item to be deleted
orderIdintegerRequiredThe order identifier of the item to delete


Response

{
  "message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Move a workflow event item

Delete one or more services from Aspire.

PUT/aspire/_api/workflow/:id/move/:eventId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to use
eventIdstringRequiredThe identifier of the event to use


Body Parameters

NameTypeRequiredDescription
srcstringRequiredThe identifier of the event item to move
deststringRequiredThe identifier of the new parent for the moved item


Response

{
  "message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Get workflow templates

Retrieve all workflow templates from Aspire.

GET /aspire/_api/workflows/:id/templates


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to get the templates for


Query String Parameters

NameTypeRequiredDescription
fromintegerOptionalIndicates the initial page to be retrieved
sizeintegerOptionalSpecifies the size of results page
sortBystringOptionalField by which results are sorted
sortModestringOptional

Sort mode

  • "asc" for ascending sort,
  • "desc" for descending sort


Response

{
  "template": [{
      "id": "AAABcQwrWUc",
      ...
    },
	  "id": "AAABcQwrWUd",
      ...
    }]
  "message": "optional response message"
}



Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Get single workflow template

Retrieve a single workflow templates from Aspire.

GET /aspire/_api/workflow/:id/template/:templateId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to get the templates for
templateIdstringRequiredThe identifier of the template to get


Response

{
  "template": [{
      "id": "AAABcQwrWUc",
      ...
    }]
  "message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input



Get single workflow rule

Get a single workflow rule from Aspire.

GET /aspire/_api/workflow/:id/rule/:ruleId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to return rules for
ruleIdstringRequiredThe identifier of the rule to get


Response

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "rule": {
      "id": "ddSWeq123",
      "description": "Some rule",
      "type": "application",
      ...
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Create a workflow rule

Create a single workflow rule in Aspire.

POST /aspire/_api/workflow/:id/rules


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to create a rule for


Body Parameters

The request body parameters will differ depending on the type of rule created. Some examples are shown below

Rule TypeParameter NameParameter TypeRequiredDescription
groovy<TODO>


application




Optionally you may opt to add the created rule to a workflow event by adding the following query parameters


Parameter NameParameter TypeRequiredDescription
parentIdstringOptionalThe identifier of the node in to which the item should be inserted. Defaults to the root node
orderIdintegerOptionalThe position (which in the children of the parent node) where this reference should be inserted


Response when parentId used

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "event": {
      "id": "onAddUpdate",
      "rule": {
        "id": "ddSWeq123",
        "description": "Some rule",
        "type": "application",
        ...
      }
    }
  }
}


Response without parentId

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "rule": {
      "id": "ddSWeq123",
      "description": "Some rule",
      "type": "application",
      ...
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Update single workflow rule

Updatee a single workflow rule in Aspire.

PUT /aspire/_api/workflow/:id/rule/:ruleId


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to update a rule for
ruleIdstringRequiredThe identifier of the rule to update


Body Parameters

The request body parameters will differ depending on the type of rule created. See Create a workflow rule above


Response

{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "rule": {
      "id": "ddSWeq123",
      "description": "Some rule",
      "type": "application",
      ...
    }
  }
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Delete single workflow rule

Deletes a single workflow rule from Aspire.

DELETE /aspire/_api/workflows/:id/rule/:ruleId


Path Parameters

NameTypeRequiredDescription
idstringRequired

The identifier of the workflow from which to delete rule(s) or the identifier of the rule to delete when used in the body

ruleIdstringRequiredThe identifier of the rule to delete


Response

{
  "message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given workflow identifier was not found
406Not acceptable - there was an issue validating the input




Get workflow item types (to be moved)

Lists all available workflow item types

GET /aspire/_api/workflows/itemType


Response

{
  type: [ "application", "publisher", "function"]
}


Status

Response codeDescription
200Success




Get specific workflow items by type (to be moved)

Returns a workflow item by its type

GET /aspire/_api/workflows/itemType/:id


Path Parameters

NameTypeRequiredDescription
idstringRequired

The identifier of the workflow item type


Example

/aspire/_aspire/workflows/types/applications 


Response

{
    items: [{
			  "id": "AAABcID5GBc="
			  "type": "application",
        	  "description": "Application_1",
          	  "coordinates": "com.accenture.aspire:aspire-example-app"
            },
            {
			  "id":	"AAABcID5GBd="
	 		  "type": "application",
              "display": "Application_2",
              "coordinates": "com.accenture.aspire:aspire-example-app"
            }]
}


Status

Response codeDescription
200Success




Get workflow item type dxf (to be moved)

Returns the dxf for a specific workflow item type

GET /aspire/_api/workflows/itemType/:itemTypeId/dxf


Response

{
  "dxf": {...}
  "message": "optional response message"
}


Status

Response codeDescription
200Success
404Not found - a given service identifier was not found




Filters

 Some endpoint queries require a filter. A filter is basically a JSON object with the following format:

Credentials filter:

  "filter" : {
    "ids" : ["ID1", "ID2", "ID3", ...],
    "type" : "TYPE",
    "description" : "DESCRIPTION"
  }
When using endpoints that use this filter, the filter cannot be empty: at least one field of the filter must be specified.
  • No labels