Skip to content

edwindj/cspa_rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Designing a REST interface for CSPA command line services

This repo contains two services for the common statistical processing architecture.

  • Linear Rule Checking (LRC), for checking records for validity
  • Linear Error Localization (LEL), for finding erronuous values in records, given a set of restrictions.

Both services can be run as command-line tools (CLI) or via a Web API- REST interface.

A generic REST interface for CSPA services is described in proposal_rest_interface.pdf. Both services implement the proposed interface.

To install

There are (at least) three options for installing the services:

  • By running a prebuild docker image (edwindj/cspa-rest).
  • By downloading the repo and installing software on Windows or Linux
  • By using Vagrant, which will create an Ubuntu virtualbox VM.

Docker

$ sudo docker run -d -p8080:8080 edwindj/cspa-rest

This will start a docker container with both services running that exposes port 8080 to the OS. The docker image is automatically build from the vagrant/Dockerfile.

Complete install

(for ubuntu 14.04 you can also use vagrant/bootstrap.sh to do the install)

  • Install R and run
R -e "install.packages('docopt','editrules', 'jsonlite','rspa')"

This will install R packages on which the services depend. The command-line interface should work after this installation.

For the REST interface:

$ npm install

This will install nodejs dependencies for cspa_rest. (The dependencies are given in file "./packages.json")

  • Run the server:
$ npm start

or (on Ubuntu)

$ nodejs server.js

Vagrant

Alternatively you can install a VM image that contains all the software and a running CSPA service that can be tested on localhost:8080.

To install you will need to install vagrant and virtualbox.

$ cd vagrant
$ vagrant up

To test the service run:

$ ./LRC/example/post.sh

Testing the service

About

Designing a REST interface for CSPA command line services

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published