Giter VIP home page Giter VIP logo

rest-proxy-service's Introduction

REST Proxy Service

This proxy service can receive long-term running jobs via its REST endpoint and forward to internal services. Submitted jobs progresses can be retrieved via an API endpoint to check whether they complete.

REST APIs are protected by user/password authentication and access tokens

Build

Run in debug mode

mvn spring-boot:run

Build distribution

mvn package

Run the distribution

java -jar target/integration-service-0.0.1-SNAPSHOT.jar

APIs

GET /accesstoken

Create access token by login using basic authentication

  • Request
curl -u user:password http://localhost:8080/accesstoken

The bootstrapped account name is 'user' with password is 'password'.

  • Response:
{"accessToken":"vmghl0cd17dpdliknujks3s8al","userName":"user"}

Access tokens will expire after 10 minutes.

POST /submit?access_token=$token

Submit a binary file for processing

  • Request
curl --form file=@./my-cv.doc http://localhost:8080/submit?access_token=vmghl0cd17dpdliknujks3s8al
  • Response
{"processId":"b7f2bb75-e8ac-4fec-831b-0d092f9b2b16"}

GET /retrieve/$processId?access_token=$token

Query a processing task

  • Request
curl localhost:8080/retrieve/b7f2bb75-e8ac-4fec-831b-0d092f9b2b16?access_token=vmghl0cd17dpdliknujks3s8al
  • Response
{"id":"b7f2bb75-e8ac-4fec-831b-0d092f9b2b16","state":"COMPLETED","fileName":"my-cv.doc","result":"dummy result"}

rest-proxy-service's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.