Skip to content

Transforming JavaScript

piveau-consus-transforming-js

Transforming JavaScript APIs#

The transforming js component just have the pipe endpoint to receive pipe descriptions /pipe. The API description of this endpoint, as html rendered documentation, is accessible through the root context. The OpenAPI itself can be downloaded via

http://piveau-consus-transforming-js:8080/openapi.yaml

The REST API also provides a health endpoint for cluster deployments to support liveness and startup probes:

http://piveau-consus-transforming-js:8080/health

The transforming js component needs to communicate with other consus components.

Note

In case of a container deployment there is not need to route the endpoints to the outside as long as the rest is also running inside the same cluster.

Docker Image#

Run docker image:

$ docker run -it -p 8080:8080 https://registry.gitlab.com/piveau/consus/piveau-consus-transforming-js:latest

Helm Chart#

Note

There is also a consus helm chart available.

It is important to verify the JVM heap size in javaOpts and to set the CPU/Memory resources to something suitable for your cluster.

$ helm repo add paca https://paca.fokus.fraunhofer.de/repository/helm-charts
$ helm install <release-name> paca/piveau-consus-exporting-hub

You can adjust your release by using the --set parameter=value parameter:

$ helm install --set monitoring=true <release-name> paca/piveau-consus-exporting-hub 

Or by passing a value file, e.g.:

$ helm install -f my-values.yaml <release-name> paca/piveau-consus-exporting-hub

Container Mounting Points#

Scripts#

You can mount additional scripts via

/usr/verticles/scripts

Configuration#

The following environment variables can be used to configure the transforming js component.

Variable Description Default Value
PIVEAU_PIPE_ENDPOINT_PORT The service port to use. 8080
PIVEAU_FAVICON_PATH Path to favicon, used in OpenAPI rendering. webroot/images/favicon.png
PIVEAU_LOGO_PATH Path to logo, used in OpenAPI rendering. webroot/images/logo.png

Logging:

Variable Description Default Value
PIVEAU_PIPE_LOG_APPENDER Configures the log appender for the pipe context STDOUT
LOGSTASH_HOST The host of the logstash service logstash
LOGSTASH_PORT The port the logstash service is running 5044
PIVEAU_PIPE_LOG_PATH Path to the file for the file appender logs/piveau-pipe.%d{yyyy-MM-dd}.log
PIVEAU_PIPE_LOG_LEVEL The log level for the pipe context INFO
PIVEAU_LOG_LEVEL The log level for the service console. INFO