Skip to content
/ ignite Public

Used Apache Ignite as DB. Web Service by Play Framework to allow CRUD operations.

Notifications You must be signed in to change notification settings

itfobos/ignite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ignite-WS

Used Apache Ignite as DB Web Service(Play Framework) to allow CRUD operations.

SBT tool is used for the project building.

What is the project about: Mobile phone users communicate with network stations.

It should be possibility to add user profile, add existing user to cell, request users in particular cell.

How to start the project:

Prerequisites:

  1. Docker Compose should be installed.
  2. The project is tested with Docker Compose version 1.15.0. How to install the right veriosn, check here

Start (Prod mode)

  1. In the root project directory cd docker
  2. docker-compose up

Two images will be downloaded from github and launched:

  • turukin/ignite-ws
  • apacheignite/ignite

Starting dev mode

  1. In the root project directory cd docker
  2. docker-compose -f docker-compose-dev.yml up
  3. cd ../ignite-ws
  4. sbt run

In this case, apacheignite/ignite container is started with option network_mode: host. WS is started locally, without docker container.

WS API:

After starting the WS binds at port 9500

For POST operations Content-Type header param should be defined as application/json

API Methods

/cellUsers

Returns all users inside the specified cell

  • Request method: GET

  • Signature: /cellUsers/:cellId

  • Example:

    • localhost:9500/cellUsers/123qwe
    • localhost:9500/cellUsers/anotherCellId

/addUserToCell

Connets a specified user with a specified cell

  • Request method: POST

  • Signature: /addUserToCell

  • Example:
    localhost:9500/addUserToCell

    Request body:

{
  "ctn" : " 79521112233",
  "cellId" : "reallyNewCellID"
}

/addUserProfile

Adds new user profile

  • Request method: POST

  • Signature: /addUserProfile

  • Example:
    localhost:9500/addUserProfile

    Request body:

{
  "ctn" : " 79521112299",
  "name" : "new one user",
  "email" : "[email protected]"
}

/populateTestData

Adds mock data.

For 123qwe cellId:

  {
    "ctn": " 79231112233",
    "name": "John",
    "email": "[email protected]",
    "activationDate": "2017-09-01 12:39:34"
   },
   {
    "ctn": " 79234445588",
    "name": "Alice",
    "email": "[email protected]",
    "activationDate": "2017-09-01 12:39:34"
    }

For anotherCellId :

  {
    "ctn": " 79521112233",
    "name": "Mark",
    "email": "[email protected]",
    "activationDate": "2017-09-01 12:39:34"
  },
  {
    "ctn": " 79524445588",
    "name": "Jane",
    "email": "[email protected]",
    "activationDate": "2017-09-01 12:39:34"
  }
  • Request method: POST

  • Signature: /populateTestData

  • Example:
    localhost:9500/populateTestData

About

Used Apache Ignite as DB. Web Service by Play Framework to allow CRUD operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published