Skip to content

Function Instances Management APIs

jensenzhang edited this page Sep 13, 2016 · 5 revisions

Function Instances Management APIs

Function Management

GET /fast/function

Description

Get a list of all function.

Response

List<Object>.

Name Type Description
functionId uuid The uuid of function.
function object<function> The information of function. (Same as this response.)

GET /fast/function/{uuid}

Description

Get the information of a function with uuid.

Response

Object. (Function)

Name Type Description
name string The name of the function.
parameters list<parameter> The description of the parameter list.
description string (Optional) The description of the function.

Object. (Parameter)

Name Type Description
parameter string The name of the parameter.
type string The data type of the parameter.
description string (Optional) The description of the parameter.

DELETE /fast/function/{uuid}

Description

Delete a function with uuid. This will cancel the effect of all function instances which invokes this function.

Response

Object.

Name Type Description
success boolean true, if delete the function successfully, else return false.
error string (Optional) If error, return error message.

Instance Management

GET /fast/instance

Description

Get a list of all function instances.

Response

List<Object>.

Name Type Description
instanceId uuid The uuid of function instance.
instance object<instance> The information of function instance. (Same as this response.)

GET /fast/instance/{uuid}

Description

Get the information of a function instance with uuid.

Response

Object. (Function Instance)

Name Type Description
invoke uuid The uuid of invoked function.
status string The status of the function instance. The optional value is pending, running or finished.
groupId uuid (Optional) The group id of the function instance.
parameters list<object> The value of the parameters which are submitted.

POST /fast/instance

Description

Submit a function execution request. (This will create a new function instance.)

Parameters

Object.

Name Type Description
invoke uuid Invoke the function with the same uuid and execute it.
parameters list<object> Send parameter list to fast system.
precedence list<uuid> (Optional) Indicate the precedence of the invoked function.
groupId string (Optional) Indicate the group id for the invoked function.

Response

Object.

Name Type Description
instanceId uuid Return the uuid of the submitted function instance.
error string (Optional) If error, return error message.

DELETE /fast/instance/{uuid}

Description

Delete a function instance with uuid. This will cancel the effect of this function instance.

Response

Object.

Name Type Description
success boolean true, if delete the function instance successfully, else return false.
error string (Optional) If error, return error message.

Dependency Tracking

GET /fast/precedence

Description

Get precedence graph of function instances.

Response

Object.

Name Type Description
nodes list<uuid> The set of function instances' uuid.
links list<precedence> The set of links.

Object. (Precedence)

Name Type Description
source uuid The uuid of the source function instance.
target uuid The uuid of the target function instance.

GET /fast/dataflow

Description

Get data flow graph of all function instances.

Response

Object.

Name Type Description
nodes list The set of data flow nodes.
links list The set of data flow links.

Object. (DFNode)

Name Type Description
id string The id of data flow node, uuid or xpath
type string instance or data.

Object. (DFLink)

Name Type Description
source string The id of source data flow node.
target string The id of target data flow node.

GET /fast/dataflow/{uuid}

Description

Get data flow graph of a given function instance.

Response

Object.

Name Type Description
nodes list The set of data flow nodes.
links list The set of data flow links.

NOTE: Maybe it can be simplified.

Optional Feature

POST /fast/function

Description

Load (register) a new function into the fast system.

Parameters

Name Type Description
name string The name of the function.
uri string The uri of the function feature. It can be parsed and loaded by karaf framework.
description string (Optional) The description of the function.

Response

Name Type Description
functionId uuid Return the uuid of the registered function.
error string (Optional) If error, return error message.