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).
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 |
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) | |
package-description | string | File name of a packge description (package.yaml) | |
brick-description | string | File name of a brick description (description.yaml) | |
python | string | Absolute path to the installation of python3.7 (/usr/bin/python3.7) |
*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 all available bricks
API function:
endpoint: /packagemanager/bricks/
Type: GET
Request data: No data needs to be send
Response data: List of Available Bricks in json format
Get meta data of all packages
API function:
endpoint: /packagemanager/packages/
Type: GET
Request data: No data needs to be send
Response data: List of Package Metadata in json format
Installing 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 admin rights can post
Note, If you provide the same package again, bricks with names that are identical to the names in the previous version get updated. New bricks will be appended, old bricks will not be deleted.
Delete Package(s)
API function:
endpoint: /packagemanager/packages?name=<Name1>&name=<Name2>
Type: DELETE
Users with admin rights can delete
Response data: Count of deleted Bricks inside each package
Get brick code
API function:
endpoint: /packagemanager/bricks/<string:BrickId>>
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.