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.
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.
- install docker
This will start a docker container with both services running that exposes port 8080 to the OS.
$ sudo docker run -d -p8080:8080 edwindj/cspa-rest
The docker image is automatically build from the
(for ubuntu 14.04 you can also use vagrant/bootstrap.sh to do the install)
- Install R and run
This will install R packages on which the services depend.
R -e "install.packages('docopt','editrules', 'jsonlite','rspa')"
The command-line interface should work after this installation.
For the REST interface:
- install node.js and npm, see (http://nodejs.org)
- download this repo
- Then goto the "cspa_rest/" directory and run
$ 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
Alternatively you can install a VM image that contains all the software and a running CSPA service that can be tested on
$ cd vagrant $ vagrant up
To test the service run: