server

REST interface and Akka HTTP specific code

License

License

GroupId

GroupId

com.ubirch.avatar
ArtifactId

ArtifactId

server_2.11
Last Version

Last Version

0.4.2
Release Date

Release Date

Type

Type

jar
Description

Description

server
REST interface and Akka HTTP specific code
Project URL

Project URL

http://ubirch.com
Project Organization

Project Organization

com.ubirch.avatar
Source Code Management

Source Code Management

https://github.com/ubirch/ubirch-avatar-service

Download server_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.ubirch.avatar/server_2.11/ -->
<dependency>
    <groupId>com.ubirch.avatar</groupId>
    <artifactId>server_2.11</artifactId>
    <version>0.4.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.ubirch.avatar/server_2.11/
implementation 'com.ubirch.avatar:server_2.11:0.4.2'
// https://jarcasting.com/artifacts/com.ubirch.avatar/server_2.11/
implementation ("com.ubirch.avatar:server_2.11:0.4.2")
'com.ubirch.avatar:server_2.11:jar:0.4.2'
<dependency org="com.ubirch.avatar" name="server_2.11" rev="0.4.2">
  <artifact name="server_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ubirch.avatar', module='server_2.11', version='0.4.2')
)
libraryDependencies += "com.ubirch.avatar" % "server_2.11" % "0.4.2"
[com.ubirch.avatar/server_2.11 "0.4.2"]

Dependencies

compile (30)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.8
com.ubirch.avatar : util_2.11 jar 0.4.2
com.ubirch.avatar : core_2.11 jar 0.4.2
com.ubirch.avatar : config_2.11 jar 0.4.2
com.typesafe.akka : akka-actor_2.11 jar 2.5.11
com.typesafe.akka : akka-slf4j_2.11 jar 2.5.11
com.typesafe.akka : akka-http_2.11 jar 10.1.0
com.typesafe.akka : akka-camel_2.11 jar 2.5.11
com.typesafe.akka : akka-cluster_2.11 jar 2.5.11
com.ubirch.util : json_2.11 jar 0.4.3
com.ubirch.util : rest-akka-http_2.11 jar 0.3.8
com.ubirch.util : response-util_2.11 jar 0.2.4
com.ubirch.util : oidc-utils_2.11 jar 0.5.3
io.prometheus : simpleclient jar 0.3.0
io.prometheus : simpleclient_hotspot jar 0.3.0
io.prometheus : simpleclient_httpserver jar 0.3.0
io.prometheus : simpleclient_pushgateway jar 0.3.0
com.workday : prometheus-akka_2.11 jar 0.8.5
org.aspectj : aspectjweaver jar 1.8.10
de.heikoseeberger : constructr_2.11 jar 0.18.0
de.heikoseeberger : constructr-coordination-etcd_2.11 jar 0.18.0
org.slf4j : slf4j-api jar 1.7.25
org.slf4j : log4j-over-slf4j jar 1.7.25
org.slf4j : jul-to-slf4j jar 1.7.25
org.apache.logging.log4j : log4j-to-slf4j jar 2.11.0
ch.qos.logback : logback-core jar 1.2.3
ch.qos.logback : logback-classic jar 1.2.3
net.logstash.logback : logstash-logback-encoder jar 5.0
com.typesafe.scala-logging : scala-logging-slf4j_2.11 jar 2.1.2
com.typesafe.scala-logging : scala-logging_2.11 jar 3.7.2

test (3)

Group / Artifact Type Version
com.ubirch.avatar : test-base_2.11 jar 0.4.2
com.ubirch.avatar : test-tools_2.11 jar 0.4.2
org.scalatest : scalatest_2.11 jar 3.0.1

Project Modules

There are no modules declared in this project.

ubirch-avatar-service

ubirch device-configuration and -dataflow service

Run the service

by executing:

sbt server/run

you can also enter the sbt shell and enter:

clean
compile
project server
run

General Information

ubirch Avatar Service is responsible for:

  • offering ubirch IoT devices an endpoint to sync their state
  • processing incoming raw data from ubirch IoT devices ** validating signatures ** transforming raw data
  • offering CRUD API to manage ubirch IoT Devices
  • managing device states using Amazon AWS IoT
  • publishing processed data for further processing (AWS SQS)

Release History

this content has been moved to a separate file: docs/release-history.md

SBT Dependency Graphs

To browse the dependency graph, this project uses the plugin sbt-dependency-graph (https://github.com/jrudolph/sbt-dependency-graph)

To browse e.g. the dependencyGraph for each module use the command 'dependencyBrowseTree' in the sbt shell.

Scala Dependencies

this content has been moved to a separate file: docs/release-history.md

REST Methods

this content has been moved to a separate file: docs/rest-methods.md

Configuration

The ubirch avatar service has several external dependencies:

  • AWS SQS
  • ElasticSearch

Those are configured via environment variables.

AWS SQS

In order to talk to AWS SQS the service needs two SQS targets:

SQS_UBIRCH_TRANSFORMER_INBOX=<string>
SQS_UBIRCH_TRANSFORMER_OUTBOX=<string>

Those queues need authentication with AWS credentials. These are passed via

AWS_ACCESS_KEY_ID=<string>
AWS_SECRET_ACCESS_KEY=<string>

ElasticSearch

Avatar service is using ElasticSearch for logging and device management. It needs a specific ES version and access to Port 9200 (HTTP) and Port 93000 (TCP)

	ES_HOST=elasticsearch
	ES_PORT_HTTP=9200
	ES_PORT_TCP=9300

Debug Output

Since ubirch avatar service is using ElastiSearch for logging it can be hard to figure out what's not working if the connection to ES can't be established. If you set

	DEBUG=true

as environment variable then the logging is send to STDOUT.

AWS

AWS Console Account

Login on https://console.aws.amazon.com/console/home with your AWS account. Without an account or not having logged AWS connections might not work.

AWS CLI

On MacOS you can install the aws-cli tool through brew:

brew install awscli

To configure it then run:

aws configure

The default region should be us-east-1 while the output format can remain None since it's not relevant yet.

AWS Configuration

The AvatarService opens a connection to AWS which depends on the following environment variables:

export AWS_ACCESS_KEY_ID=foo
export AWS_SECRET_ACCESS_KEY=bar

Deployment Notes

Elasticsearch

The service requires the mappings defined in ElasticsearchMappings. They are automatically created during server boot if they don't exist.

Automated Tests

TODO

Import Trackle Data

  1. Prepare User

    The test data generation includes the generation of test data and a device. This means we still need a user which you'll have to create/register manually by logging in on the AdminUI of the remote environment. Please remember the token resulting from the registration or login.

  2. Prepare Data Import

    # user token from registration or login
    export AVATAR_USER_TOKEN=token-12345678
    # (optional) base url of the remote environment's avatar-service (defaults to http://localhost:8080)
    export AVATAR_BASE_URL=https://avatar.myserver.com:8080
  3. Run Data Import

You can also run dev-scripts/importTrackle.sh $AVATAR_USER_TOKEN.

```bash
./sbt "cmdtools/runMain com.ubirch.avatar.cmd.ImportTrackle"
```
com.ubirch.avatar

ubirch GmbH

Versions

Version
0.4.2
0.4.1
0.4.0
0.3.30
0.3.29
0.3.27
0.3.26
0.3.25
0.3.24
0.3.23
0.3.22
0.3.21
0.3.20
0.3.19
0.3.18
0.3.17
0.3.16
0.3.15
0.3.14
0.3.13
0.3.12
0.3.11
0.3.10
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.0
0.1.0