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") |
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) |
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 endpointmanager |
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 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 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.
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.