The titan Flow Manager

The titan Flow Manager is in charge of storing and providing flow configurations. It can be reached via a REST API that serves under the port number HOST:9002.

UseCaseDiagram

Building/ running

To run the service simply use go run ./cmd/flowmanager

or to create an executable file go build ./cmd/flowmanager

The FlowManager has the following configurable options:

- CommandLine Flag Environment Variable Configuration File Default Value Description
Configuration File --config-file TITAN_FM_CONFIG_FILE "./config.yaml" Path to a configuration file for the Flowmanager
Port --port TITAN_FM_PORT Port "9002" The port on which to serve the API
Log Level --log-level TITAN_FM_LOG_LEVEL LogLevel "warning" Only show log information equal or above to the given level ("error" > "warning" > "info" > "debug")
Database --database TITAN_FM_DATABASE Database "localhost:27017" Database provider as
User Manager --user-manager TITAN_FM_USER_MANAGER UserManager "localhost:9000" UserManager address as :
Allowed Request Origins --allowed-origins TITAN_FM_ALLOWED_ORIGINS AllowOrigins "http://localhost:5000" "http://localhost:8080" "http://localhost:8081" "http://localhost:8082" List of allowed request origins (CORS)

Usage

List flows

API function:

/flowmanager/flows Type: GET

Request data: No data needs to be sent.

Response data: List of flow objects that contains public and owned flows.

List a flow

API function:

/flowmanager/flows/<string:FlowId> Type: GET

Request data: No data needs to be sent.

Response data: flow object of the flow with the given name if the flow is owned by the one requesting or public.

Copy a flow

API function:

/flowmanager/flows/copy Type: POST

Request data: A list of two flow objects, with flowID and new flow name. The first element of the list must be the flowID, the second the new flow name. A flow can only be copied if it is public or owned.

Response data: flow object of the new flow.

Create a flow

API function:

/flowmanager/flows/ Type: POST

Request data: A flow object.

Response data: flow object of the new flow, which is private (isPublic=false) and the owner is set to the user creating the flow.

Delete a flow

API function:

/flowmanager/flows/<string:FlowID> Type: DELETE

Request data: No data needs to be sent.

Response data: No data is returned.

A flow can only be deleted if it is public or owned.

Update a flow

API function:

/flowmanager/flows/<string:FLowID> Type: PUT

Request data: A flow object. The flow must exist for this operation.

Response data: flow object of the updated flow.

A flow can only be updated if it is public or owned. A public flow can not be made private by others than the owner.

Create Port binaries

API function:

/flowmanager/ports/create_binaries Type: POST

Request data: A port object.

Response data: port object with new binaries.

Update a flow name

API function:

/flowmanager/flows/editname Type: PUT

Request data: A Object {id, name}. The flow must exist for this operation.

Response data: A Object {id, name} of the updated flow. A flow can only be updated if it is public or owned.

Update a flow Description

API function:

/flowmanager/flows/editdescription Type: PUT

Request data: A Object {id, description}. The flow must exist for this operation.

Response data: A Object {id, description} of the updated flow. A flow can only be updated if it is public or owned.

Validate connections

API function:

endpoint: /flowmanager/ports/validate_connection Type: POST

Request data: a portConnection object as json with the information of the source and target ports:

portConnection

Represents connection that is to be drawn

Items:

Name Type Doc Constraints
source port specifics of the source port [not null]
target port specifics of the target port [not null]

port

Details on the port

Items:

Name Type Doc Constraints
binaries bytes Binary representation of the port schema
name string name of the Port as listed in the ports section of availableBrick [not null]

Response data: no data is sent, status code 200 indicates a match, status code 403 a mismatch of the ports.