Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning
titlePage 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

Table of Contents

Section

List workflows

Lists all the workflows configured in the Aspire

Panel
borderColorblack
bgColor#fafafb
GET /aspire_api/workflow

Query String Parameters

NameTypeRequiredDescription
descriptionstringOptionalFilter workflows to only those whose description matches the given expression
sparsebooleanOptionalOnly return minimal data such as identifier, description, name etc

Response

Code Block
languagejs
{
  "workflow": [{
    "id": "AAABcID5GBc=",
    "description": "Publish to Elasticsearch",
    ...
  },
  {
    "id": "AAABcIueWUc=",
    "description": "Normalise data",
    ...
  }],
  "message": "optional response message"
}

Status

Response codeDescription
200Success




Section

Get a single workflow

Get information about a single workflow in Aspire

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/:id

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe id of the workflow to return

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcID5GBc=",
    "description": "Publish to Elasticsearch",
    ...
  },
  "message": "optional response message"
}

Status

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




Section

Add a workflow

Adds a workflow to Aspire

Panel
borderColorblack
bgColor#fafafb
POST /aspire_api/workflow

Request Body Parameters

NameTypeRequiredDescription
descriptionstringRequiredA description of the workflow

Query String Parameters

NameTypeRequiredDescription
typestringemptybooleanOptionalRequired

Accepted values are: "connector" and "service"

If connector is set If true, the workflow created will be empty ( with no plans).By default, the following plans events will be created:

  • scan
  • addUpdateonScan
  • onAddUpdatedelete
  • onDeletepublish
  • onPublish
  • onError
  • error

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


Examples

Add a single workflow

Code Block
languagejs
{
  "description": "Publish to Elastic"
  ...
}

Response

Code Block
languagejs
{
  "serviceworkflow": [{
    "id": "AAABcID5GBc=",
    "description": "Publish to Elastic",
    ..."type": "service"
  }],
  "message": "optional response message"
}

Status

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





Section

Delete workflow(s)

Delete one or more workflow from Aspire.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire_api/serviceworkflows/:id

DELETE /aspire_api/serviceworkflows

Path and Request Body Parameters

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

Examples

Delete a single workflow

Code Block
languagejs
{
  "id": "AAABcID5GBc="
}

Delete multiple workflows

Code Block
languagejs
[{
  "id": "AAABcID5GBc="
},
{
  "id": "AAABcIueWUc="
}]DELETE /aspire_api/workflows/AAABcID5GBc=

Delete multiple workflows(alternative form)

Code Block
languagejs
{
  "id": ["AAABcID5GBc=", "AAABcIueWUc="]
}DELETE /aspire_api/workflows?id=AAABcID5GBc%3D&id=AAABcIueWUc%3D

Response

Code Block
languagejs
{
  	"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




Section

Get a workflow

plan

event

Get a plan event from a workflow in Aspire.

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/:id/:planIdeventId

Path Parameters

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

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate"
    }
  }
  "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




Section

Create workflow

plan

event(s)

Create one or more workflow plans events in Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/workflow/:id

PUT /aspire_api/workflow/:id/:planIdeventId

Path Parameters

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

Examples

Create a single planevent

Code Block
languagejs
{
  "id": "onScan"
}

Create multiple plansevents

Code Block
languagejs
[{
  "id": "onScan"
},
{
  "id": "onAddUpdate"
}]

Create multiple plans events (alternative version)

Code Block
languagejs
{
  "id": ["onScan", "onAddUpdate"]
}

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": ["onScan", "onAddUpdate"]
    }
  }
  "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




Section

Delete a workflow

plan

event

Delete a workflow plan event from Aspire.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire_api/workflow/:id/:planIdeventId

Path and Request Body Parameters

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

Response

Code Block
languagejs
{
  "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




Section

Create a workflow

plan

event item

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

Panel
borderColorblack
bgColor#fafafb

POST /aspire_api/workflow/:id/:planIdeventId/:type

Path Parameters

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

Request Body Parameters

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

Item TypeParameter NameParameter TypeRequiredDescription
Rule<TODO>


Application Rule



Condition



Exit



Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": {
        "id": "AAABcQwxWUc=",
        ...
      }
    }
  }
  "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




Section

Update a workflow

plan

event item

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/workflow/:id/:planIdeventId/:itemId

Path Parameters

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

The identifier of the plan event to use

itemIdstringRequiredThe identifier of the item to update

Request Body Parameters

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

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": {
        "id": "AAABcQwxWUc=",
        ...
      }
    }
  }
  "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




Section

Delete a workflow

plan

event item

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire_api/workflow/:id/:planIdeventId/:itemId

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to use
planIdeventIdstringRequiredThe identifier of the plan event to use
itemIdstringRequiredThe identifier of the node item to delete

Response

Code Block
languagejs
{
  "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




Section

Move a workflow

plan

event item

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

PUT/aspire_api/workflow/:id/:planIdeventId/:src/:dest

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to use
planIdeventIdstringRequiredThe identifier of the plan event to use
srcstringRequiredThe identifier of the plan event item to move
deststringRequiredThe identifier of the new parent for the moved item

Response

Code Block
languagejs
{
  "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




Section

Get workflow templates

Retrieve all workflow templates from Aspire.

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/:id/template

Path and Query String Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to get the templates for
descriptionstringOptionalFilter workflows to only those whose description matches the given expression

Response

Code Block
languagejs
{
  "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




Section

Get a workflow template

Retrieve a workflow templates from Aspire.

Panel
borderColorblack
bgColor#fafafb

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

Code Block
languagejs
{
  "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




Section

Get workflow rules

Get all the rules for a given workflow.

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/:id/rule

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to return rules for

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": [{
        "id": "ddSWeq123",
        "description": "Some rule",
        "type": "application",
        ...
      },
      {
        "id": "ddSWeq124",
        "description": "Some rule",
        "type": "groovy",
        ...
      }]
    }
  }
  "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




Section

Get a workflow rule

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

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

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": {
        "id": "ddSWeq123",
        "description": "Some rule",
        "type": "application",
        ...
      }
    }
  }
  "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




Section

Create a workflow rule

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

POST /aspire_api/workflow/:id/rule

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to create a rule for

Request 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



Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": {
        "id": "ddSWeq123",
        "description": "Some rule",
        "type": "application",
        ...
      }
    }
  }
  "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




Section

Update a workflow rule

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

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

Request Body Parameters

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

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": {
        "id": "ddSWeq123",
        "description": "Some rule",
        "type": "application",
        ...
      }
    }
  }
  "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




Section

Delete workflow rule(s)

Delete one or more services from Aspire.

Panel
borderColorblack
bgColor#fafafb

DELETE /aspire_api/workflow/:id/rule

DELETE /aspire_api/workflow/:id/rule/:ruleId

Path and Request Body 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

Examples

Delete a single rule

Code Block
languagejs
{
  "id": "AAABcIueWUc"
}

Delete multiple rules

Code Block
languagejs
[{
  "id": "AAABcIueWUc"
},
{
  "id": "AAABcIueWac"
}]

Delete multiple rules (alternative version)

Code Block
languagejs
{
  "id": ["AAABcIueWUc", "AAABcIueWac"]
}

Response

Code Block
languagejs
{
  "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




Section

Copy (duplicate) a workflow rule

?? Needed ??

Duplicates a workflow rule.

Panel
borderColorblack
bgColor#fafafb

POST /aspire_api/workflow/:id/rule/:ruleId

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to use
ruleIdstringRequiredThe identifier of the rule to copy

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate",
      "rule": {
        "id": "ddSWeq123",
        "description": "Some rule",
        "type": "application",
        ...
      }
    }
  }
  "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




Section

Share a workflow rule

?? Needed ??

Move a workflow rule to a shared library.

Panel
borderColorblack
bgColor#fafafb

PUT /aspire_api/workflow/:id/rule/:ruleId/:destination

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the workflow to use
planIdeventIdstringRequired

The identifier of the plan event to share

destinationstringRequiredThe identifier of the library to share to

Response

Code Block
languagejs
{
  "workflow": {
    "id": "AAABcIueWUc=",
    "description": "Publish to Elasticsearch"
    "planevent": {
      "id": "onAddUpdate"
    }
  }
  "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




Section

Get workflow libraries

?? Needed ??

Get all of the workflow libraries

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/library

Query String Parameters

NameTypeRequiredDescription
descriptionstringOptionalFilter the libraries returned to those matching the given description

Response

Code Block
languagejs
{
  <TODO>
  "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




Section

Get a workflow library

?? Needed ??

Get a single workflow library.

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/library/:id

Path and Request Body Parameters

NameTypeRequiredDescription
idstringRequiredThe identifier of the library to return

Response

Code Block
languagejs
{
  <TODO>
  "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




Section

Reload workflow libraries

?? Needed ??

Reload all workflow libraries.

Panel
borderColorblack
bgColor#fafafb

GET /aspire_api/workflow/library/reload

Response

Code Block
languagejs
{
  "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