Skip to content
Snippets Groups Projects

Data Storage and Retrieval Component

Microservice for inserting and retrieving data from the databases.

Table of Contents

  1. Clone
  2. Push
  3. Build
  4. Docker
  5. Configuration
    1. Environment
  6. API Reference
  7. License

Clone

This project has a git submodule called 'shared'. Because of this, it is necessary to download the code including submodules.

$ git clone --recurse-submodules <repo>

Once downloaded:

$ cd shared
$ mvn install 

Push

Note that if you update the library 'shared', another project makes use of it, so you should update the commit of the other api project called 'open-data-retrieval'.

Build

Requirements:

  • Docker

Docker

Build docker image:

$ docker build -t urbanite/datastorage .

Run docker image:

$ docker run -it -p 80:80 urbanite/datastorage

Configuration

Environment

Variable Description Default Value
MONGO_HOST The IP of the host where MongoDB is installed. mongodb
MONGO_PORT The port where MongoDB is listening. 27017
MONGO_DBNAME The name of the MongoDB Database to insert/retrive data. urbanite

e.g.

$ docker run -it -p 80:80 -e MONGO_HOST=172.26.41.138 -e MONGO_PORT=27018 urbanite/datastorage

API Reference

When the component is deployed, the API reference is accessible from http://\<server>/data/swagger-ui/index.html?configUrl=/data/v3/api-docs/swagger-config

License

Apache License, Version 2.0