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.
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") |
Flag: use kafka hook for logging | --log-to-kafka | TITAN_FM_LOG_TO_KAFKA | LogToKafak | (false) | Enable to send INFO and ERROR logs to kafak topic |
Host:port of kafka broker | --kafka | TITAN_FM_KAFKA | Kafka | (10.14.0.23:9092) | Kafka broker adddress |
Kafka topic for logs | --service-topic | TITAN_FM_SERVICE_TOPIC | ServiceTopic | (titan.servicelogs) | Kafka topic for Flowmanager logs |
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 : |
Package Manager | --pacakge-manager | TITAN_FM_PACKAGE_MANAGER | PackageManager | "localhost:8087" | PackageManager 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) |
secret key for encryption | --secret-key | TITAN_FM_SECRET_KEY | SecretKey | - | secret key for encryption |
Allowed Service IDs | --service-ids | TITAN_FM_SERVICE_IDS | ServiceIds | no default set, add id of Endpointprovider, UserService | |
Service id | --service-id | TITAN_FM_SERVICE_ID | ServiceId | no default set, set id to allow for communication with UserService | |
Flag: Licencing | --licencing | TITAN_FM_LICENCING | Licencing | true | switch for limiting number of workspaces/user, flows,members/workspace, bricks/flow |
Workspaces per user | --workspaces-per-user | TITAN_FM_WORKSPACES_PER_USER | WorkspacesPerUser | 3 | maximum number of workspaces per user when licencing is set |
Members per workspace | --members-per-workspace | TITAN_FM_MEMBERS_PER_WORKSPACE | MembersPerWorkspace | 5 | maximum number of members per workspace when licencing is set |
Flows per workspace | --flows-per-workspace | TITAN_FM_FLOWS_PER_WORKSPACE | FlowsPerWorkspace | 10 | maximum number of flows per workspace when licencing is set |
Bricks per flow | --bricks-per-flow | TITAN_FM_BRICKS-PER-FLOW | BricksPerFlow | 15 | maximum number of bricks per flow when licencing is set |
Service ids | --service-ids | TITAN_FM_SERVICE_IDS | ServiceIds | no default set | list of ids of services allowed to access the FlowManager |
Usage
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. A complete flow with bricks and connections is returned. A flow can only be fetched by workspace members and the workspace owner.
Copy a flow
API function:
/flowmanager/flows/copy
Type: POST
Request data: A list of two flow objects. The first flow must contain the flowID and the workspaceId, the second the new flow name. A flow can only be copied by workspace members and the workspace owner.
Response data: flow object of the new flow without the config.
Create a flow
API function:
/flowmanager/flows/
Type: POST
Request data: A flow object with name and workspaceId set.
Response data: flow object of the new flow without the config, the owner is set to the user creating the flow. A flow can only be created by workspace members and the workspace owner.
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 by workspace members and the workspace owner.
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 without bricks/connections.
A flow can only be updated by workspace members and the workspace owner.
Create Port JSON
API function:
/flowmanager/ports/create_json
Type: POST
Request data: A port object.
Response data: port object with new JSON schema.
Update a flow name
API function:
/flowmanager/flows/editname
Type: PUT
Request data: A flow object with name, id, and workspaceId set.
Response data: A Object {id, name} of the updated flow. A flow can only be updated by workspace members and the workspace owner.
Update a flow Description
API function:
/flowmanager/flows/editdescription
Type: PUT
Request data: A flow object with description, id, and workspaceId set.
Response data: A Object {id, description} of the updated flow. A flow can only be updated by workspace members and the workspace owner.
Get a decrypted value of a secret parameter
API function:
/flowmanager/flows/<string:FlowID>/decrypt_parameter/<string:BrickID>
/<string:ParameterName>
Type: GET
Request data: No data needs to be sent.
Response data: Decrypted parameter name.
Only flow owners can decrypt secret parameter values.
Get a flow with service key
API function:
/flowmanager/flow/<string:FlowId>
Type: GET
Request data: No data needs to be sent. Request Header: Required "service" key to authenticate the service for accessing the endpoint
Response data: flow object of the flow with the given name if the flow is owned by the one requesting or public.
Create a connection
API function:
/flowmanager/connections/<string:connectionConfigID>
Type: POST
Request data: A connection object.
Response data: connection object with an added buffer based on buffers of upstream connections.
A connection can only be created if the flow is public and not ReadOnly or if it is owned by the user.
Delete a connection
API function:
/flowmanager/connections/<string:connectionConfigID>/<string:connectionID>
Type: DELETE
Request data: No data needs to be sent.
Response data: list of connection objects.
Buffer elements originally added at this connection will be deleted from downstream connections.
A connection can only be deleted if the flow is public and not ReadOnly or if it is owned by the user.
Update a connection
API function:
/flowmanager/connections/<string:connectionConfigID>
Type: PUT
Request data: A connection object.
Response data: list of connection objects. Buffers of downstream connections in the flow will be updated if the connections buffer was changed (elements added or deleted).
A connection can only be updated if the flow is public and not ReadOnly or if it is owned by the user.
Add a brick
API function:
/flowmanager/bricks
Type: POST
Request data: A brick object.
Response data: brick object of the new brick.
Update a brick
API function:
/flowmanager/bricks
Type: PUT
Request data: A brick object.
Response data: brick object of the new brick.
Configure an APIBrick
API function:
/flowmanager/bricks/<brickId:string>/configure
Type: PUT
Request data:
{
"apiId": "the API ID",
"endpointId": "the Endpoint ID",
}
Response data: brick object of the configured brick.
Delete a brick
API function:
/flowmanager/bricks/<brickid string>
Type: DELETE
Request data: none.
Response : only status.
Get users workspaces
API function
/flowmanager/users/<userId:string>/workspaces
Type: GET
Request data: none
Response data: list of workspaces.
Delete a users workspaces and memberships
API function
/flowmanager/users/<userId:string>
Type: DELETE
Request data: none
Response data: status
Delete a users package
API function
/flowmanager/users/<userId:string>/packages/<packageId:string>
Type: DELETE
Request data: none
Response data: status
Get a workspace
API function
/flowmanager/workspaces/<workspaceId:string>
Type: GET
Request data: none
Response data: a workspace.
Create a workspace
API function
/flowmanager/workspaces/
Type: POST
Request data: a workspace with owner, name.
Response data: a workspace.
Delete a workspace
API function
/flowmanager/workspaces/<workspaceId:string>
Type: DELETE
Request data: none
Response data: a workspace.
Only workspace owners can delete a workspace.
List a workspaces flows
API function:
/flowmanager/workspaces/<workspaceID:string>/flows
Type: GET
Request data: No data needs to be sent.
Response data: List of flow objects that contains public and owned flows, without configs.
Only workspaces members and the workspace owner can list the flows.
Add a member to a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/members
Type: POST
Request data: A member object with the email property set.
Response data: A member object.
Only workspaces members and the workspace owner can add new members to a workspace.
Update a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>
Type: PUT
Request data: A workspace object
Response data: A workspace object
Only workspaces members and the workspace owner can update a workspace.
Remove a member from a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/members/{userID:String}
Type: DELETE
Request data: No data
Response data: A status.
Only workspaces members and the workspace owner can remove members from a workspace.
Add a TypeDefinition to a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types
Type: POST
Request data: A NestedTypeDefinition
Response data: The NestedTypeDefinition
Only workspace members and the workspace owner can add Types to a workspace.
List all TypeDefinitions within a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types
Type: GET
Response data: Array of NestedTypeDefinition
Resolve all TypeDefinitions within a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types_resolved
Type: GET
Response data: Array of NestedTypeDefinition
List one TypeDefinition within a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types/<typeid:string>
Type: GET
Response data: The NestedTypeDefinition
Resolve one TypeDefinition within a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types/<typeid:string>/resolved
Type: GET
Response data: The NestedTypeDefinition
Update a TypeDefinition in a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types/<typeid:string>
Type: PUT
Request data: A NestedTypeDefinition
Response data: The NestedTypeDefinition
Only workspace members and the workspace owner can change Types of a workspace.
Delete a TypeDefinition in a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/types/<typeid:string>
Type: DELETE
Response data: HTTP Status OK
Only workspace members and the workspace owner can delete Types in a workspace.
Get APIs of a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/apis
Type: GET
Request data: no data
Response data: A list of API objects
Only workspaces members and the workspace owner can access APIs of workspaces.
Add an API to a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/apis
Type: POST
Request data: An API object
Response data: An API object
Only workspaces members and the workspace owner can add APIs to workspaces.
Get APIs of a workspace
API function:
/flowmanager/workspaces/<workspaceID:string>/apis
Type: GET
Request data: no data
Response data: A list of API objects
Only workspaces members and the workspace owner can access APIs of workspaces.
Delete an API from a a worksapce
API function:
/flowmanager/workspaces/<workspaceID:string>/apis/<apiId:string>
Type: DELETE
Request data: no data
Response data: A status
Only workspaces members and the workspace owner can access APIs of workspaces. If the one of the endpoints of the API is used in a flow, the API can not be deleted (response code 500).
Update an API
API function:
/flowmanager/workspaces/<workspaceID:string>/apis
Type: PUT
Request data: An API object
Response data: An API object
Only workspaces members and the workspace owner can add APIs to workspaces.
Add an endpoint to an API
API function:
/flowmanager/workspaces/<workspaceID:string>/apis/<apiId:string>/endpoints
Type: POST
Request data: An Endpoint object
Response data: An Endpoint object
Only workspaces members and the workspace owner can add APIs to workspaces.
Delete an endpoint from an API
API function:
/flowmanager/workspaces/<workspaceID:string>/apis/<apiId:string>/endpoints/<string:endpointId>
Type: DELETE
Request data: No data
Response data: A status (200, 501, 400)
Only workspaces members and the workspace owner can add APIs to workspaces.
Update endpoint
API function:
/flowmanager/workspaces/<workspaceID:string>/apis/<apiId:string>/endpoints
Type: PUT
Request data: An Endpoint object
Response data: An Endpoint object
Only workspaces members and the workspace owner can add APIs to workspaces.
Update member data (email, username) in all workspaces
API function:
/flowmanager/users
Type: PUT
Request data: A member object with the email property set.
Response data: A status.
Only services can update member data in all workspaces.
Installing a brick package from the brick store to the user space
API function:
endpoint: /flowmanager/users/<userId:string>/packages/<packageId:string>
Type: POST
Request data: No data
Response data: List of Available Bricks in json format
Uploading a brick package to a user space
API function:
endpoint: /flowmanager/users/<userId:string>/packages
Type: POST
Request data: A brick package as multipart form data with the key "package"
Response data: List of Available Bricks in json format
Users with upload rights can post brick packages.
Get a users installed bricks
API function:
endpoint: /flowmanager/users/<userId:string>/bricks
Type: GET
Request data: no data
Response data: List of Available Bricks in json format
Get a users installed packages
API function:
endpoint: /flowmanager/users/<userId:string>/packages
Type: GET
Request data: no data
Response data: List of Package Metadata in json format
Export a flow to a json file
API function:
/flowmanager/flow/<string:FlowId>/export
Type: GET
Request data: No data needs to be sent. In response, you get a json file containing
Flow: {},
APIs: [],
Types: []
the complete flow with bricks and connections, all APIs used in the flow, and all type documents from the type library used in the flow. Values of secret parameters are removed prior to saving the flow.
Import a flow
API function:
/flowmanager/workspaces/<workspaceID:string>/flows/import
Type: POST
Request data: A json file containing
Flow: {},
APIs: [],
Types: []
the complete flow with bricks and connections, all APIs used in the flow, and all type documents from the type library used in the flow.