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

Compare with Current View Page History

« Previous Version 64 Next »

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, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/workflows

Pagination query string parameters

Query String Parameters

NameTypeRequiredDescription
sparsebooleanOptionalOnly return minimal data such as identifier, description, name etc



Get all workflows, filtered

Lists workflows configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the OPERATOR role to be executed.

POST /aspire/_api/workflows/getAll

Pagination query string parameters

Common filter


Response

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

Status: 200



Get a single workflow

Get information about a single workflow in Aspire, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/workflows/:id


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the workflow to return


Query String Parameters

NameTypeRequiredDescription
transformbooleanOptionalWhether to transform the output.  Default "false"
sectionstringOptionalThe section required for the output. The value can be "templates", "rules", "events"


Response

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

Status: 200, 404




Add single workflow

Adds a single workflow to Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

POST /aspire/_api/workflows


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

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


Response

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

Status: 200, 406



Update workflows, filtered

Update connectors configured in the Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.

PUT /aspire/_api/workflows/updateAll

Common filter

Update body parameter


Response

{
  "message": "update result response message"
}

Status: 200, 406

Delete multiple workflows, filtered

Delete multiple workflows from Aspire, filtered by a specified criteria, this endpoint need the at least the ADMINISTRATOR role to be executed.

POST /aspire/_api/workflows/deleteAll

Common filter

Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406




Delete workflow(s)

Delete one or more workflows from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

DELETE /aspire/_api/workflows/:id

DELETE /aspire/_api/workflows

POST /aspire/_api/workflows/delete


Path Parameters and Query parameters

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


Body Parameter

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


Examples

DELETE /aspire/_api/workflows/AAABcID5GBc

DELETE /aspire/_api/workflows?id=AAABcID5GBc&id=AAABcID5GBd

POST /aspire/_api/workflows/delete
{
  "ids":["AAABcID5GBc","AAABcID5GBd"]
}


Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406




Get a workflow event

Get a event from a workflow in Aspire, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/workflows/: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: 200, 404, 406




Create workflow event(s)

Create one or more workflow events in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

PUT /aspire/_api/workflows/:id

PUT /aspire/_api/workflows/: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 multiple events (body parameter)

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


Response

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

Status: 200, 404, 406




Delete a workflow event

Delete a workflow event from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

DELETE /aspire/_api/workflows/:id/:eventId


Path  Parameters

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


Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406




Create a workflow event item

Create a workflow event item - a rule, condition and the like, this endpoint need the at least the ADMINISTRATOR role to be executed.

POST /aspire/_api/workflows/: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: 200, 404, 406




Update a workflow event item

Update a workflow event item from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

PUT /aspire/_api/workflows/:id/:eventId/:itemId


Path Parameters

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

The identifier of the event to use

itemIdintegerRequiredThe 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: 200, 404, 406




Delete single workflow event item

Delete a workflow event item from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

DELETE /aspire/_api/workflows/:id/:eventId/:parentId/:itemId


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
itemIdintegerRequiredThe identifier of the item to delete


Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406




Move a workflow event item

Move a workflow event item from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

PUT/aspire/_api/workflows/: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
orderIdintegerOptionalThe position (which in the children of the parent node) where this item should be inserted


Response

{
  "message": "move result response message"
}

Status: 200, 404, 406




Get workflow templates

Retrieve all workflow templates from Aspire, this endpoint need the at least the OPERATOR role to be executed.

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


Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to get the templates for


Response

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

Status: 200, 404, 406




Get single workflow template

Retrieve a single workflow templates from Aspire, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/workflows/: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",
      ...
    }]
}

Status: 200, 404, 406




Get single workflow rule

Get a single workflow rule from Aspire, this endpoint need the at least the OPERATOR role to be executed.

GET /aspire/_api/workflows/: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: 200, 404, 406




Create a workflow rule

Create a single workflow rule in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

POST /aspire/_api/workflows/: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.

Rule Type
groovy
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: 200, 404, 406




Update single workflow rule

Updatee a single workflow rule in Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

PUT /aspire/_api/workflows/: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: 200, 404, 406




Delete single workflow rule

Deletes a single workflow rule from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

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


Path Parameters

NameTypeRequiredDescription
idstringRequired

The identifier of the workflow from which to delete rule(s) 

ruleIdstringRequiredThe identifier of the rule to delete


Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406

Delete workflow rules

Deletes a single workflow rule from Aspire, this endpoint need the at least the ADMINISTRATOR role to be executed.

DELETE /aspire/_api/workflows/:id/rules


Path Parameters

NameTypeRequiredDescription
idstringRequired

The identifier of the workflow from which to delete rule(s) 


Query Parameters

NameTypeRequiredDescription
idstringRequired

One or more rule ids to be deleted


Response

{
  "message": "delete result response message"
}

Status: 200, 404, 406

  • No labels