Skip to content

The titan Package Manager

The titan Package Manager is in charge of storing and providing brick configurations. It can be reached via a REST API that serves under the port number HOST:8087 (per default).

UseCaseDiagram

Building/ running

To run the service simply navigate to the root of flowengine-go and use go run ./cmd/packagemanager

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

The command line interface features following arguments;

Name Options (default) Purpose
port (8087) Port on which the Package Manager serves
log-level info/debug/warning/error (info) Log level
log-to-kafka (false) Flag: use kafka hook for logging
kafka (10.14.0.23:9092) host:port of kafka broker
service-topic (titan.servicelogs) kafka topic for logs
config-file (internal/app/packagemanager/config.yaml) Configuration file

The default configuration file contains the following items:

Name Type Doc (default value) Constraints
database string URL of the Database (127.0.0.1:27017)
user-manager string URL of the User Service (http://127.0.0.1:9000)
allowed-origins list List of allowed origins for CORS request [not null]
ignore-package-content list List ignored brick package folder content *1 [not null]
package-folder string Local folder where brick packages are stored (./brickPackages)
python string Absolute path to the installation of python3.7 (/usr/bin/python3.7)
service-ids list of string list of ids of services allowed to access the PackageManager

*1 this list is added to a default list of ignored content which contains: .git, .gitignore, .markdownlintrc.yml, .gitlab-ci.yml, README.md, doc

Generally, all settings listed above can be done also via environment variables, whereby the variables are composed of a prefix (TITAN_PM) and the argument using snake case:

TITAN_PM_ARGUMENT, e.g. TITAN_PM_LOG_LEVEL

Usage

Get available bricks

API function:

endpoint: /packagemanager/bricks/ Type: GET

Request data: optional list of packageIDs

Response data: List of Available Bricks in json format

Get meta data of packages

API function:

endpoint: /packagemanager/packages/ Type: GET

Request data: optional list of packageIDs

Response data: List of Package Metadata in json format

Uploading a brick package

API function:

endpoint: /packagemanager/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.

Installing a brick package

API function:

endpoint: /packagemanager/packages/<packageId string> Type: POST

Request data: No data

Response data: List of Available Bricks in json format

Get a packages bricks

API function:

endpoint: /packagemanager/packages/<packageId string>/bricks Type: GET

Request data: No data

Response data: List of Available Bricks in json format Only available to titan services

Delete Package

API function:

endpoint: /packagemanager/packages/<packageId string> Type: DELETE

Only available to titan services.

Get brick code

API function:

endpoint: /packagemanager/source/<string:BrickId>>.zip Type: GET

Request data: No data needs to be send

Response data: content of the compressed brick code

Get time when brick code was last modified

API function:

endpoint: /packagemanager/bricks/<string:BrickId>>/lastmodified Type: GET

Request data: No data needs to be send

Response data: Time when brick code was last modified in unix format

A brick package

Brick packages can be send in the form of zip, tar, tar.gz archives.

Installation of new Bricks to the Titan platform

Register a ControlPeer

API function:

/packagemanager/controlpeers/ Type: POST

Request data: ControlPeer Address string.

Response data: No data is returned.

Deregister a ControlPeer

API function:

/packagemanager/controlpeers/ Type: DELETE

Request data: ControlPeer Address string.

Response data: No data is returned.