tern icon indicating copy to clipboard operation
tern copied to clipboard

Proposal: Enable web service API

Open nishakm opened this issue 7 years ago • 6 comments

There are situations where Tern may need to run as a service somewhere on the cloud and get access via an external API. For that to happen, it needs to respond to HTTP get and post requests. Some investigation of tools that can create a front facing API for the back end CLI may be required. https://github.com/proycon/clam might be a good place to start.

nishakm avatar Jun 27 '18 14:06 nishakm

@nishakm

How is the status of this proposal?

I've made a very minimal web UI that only allow specifying an image name and return a html result by using flask. Please see the commit here. If this commit makes sense and will expected to be easily merged without a big change, I will make a pull request.

mkimuram avatar Feb 11 '21 01:02 mkimuram

@nishakm

How is the status of this proposal?

I've made a very minimal web UI that only allow specifying an image name and return a html result by using flask. Please see the commit here. If this commit makes sense and will expected to be easily merged without a big change, I will make a pull request.

Thanks for doing the work on this! We haven't worked on this proposal yet, so your work is the first :). Would you be able to use swaggerto generate the web service API?

Another thing, @rnjudge, the web service bits should probably live in a new repository. So maybe create a new repo under tern-tools where @mkimuram can submit a PR to?

nishakm avatar Feb 11 '21 14:02 nishakm

@nishakm

Thank you for your comments.

Would you be able to use swaggerto generate the web service API?

I'm not familiar with swagger, but I searched it and found that flask-restx looks useful to achieve it. With a small change, I made flask-restx generate swagger-ui. Once, the repository becomes ready, I will submit a PR.

mkimuram avatar Feb 11 '21 23:02 mkimuram

@rnjudge

Could you create a new repo for this? What information do you need? Just a repo name?

@nishakm

What should the repo be named? 'tern-api' or 'tern-web-api'?

mkimuram avatar Feb 24 '21 18:02 mkimuram

@mkimuram @nishakm I can create a new repo now. Does tern-web-api work for you?

rnjudge avatar Feb 24 '21 19:02 rnjudge

@mkimuram @nishakm I can create a new repo now. Does tern-web-api work for you?

@mkimuram I created https://github.com/tern-tools/tern-api. Please upload your PR here under a new web folder. We will also host the databse api bits here under a database sub folder.

rnjudge avatar Feb 24 '21 19:02 rnjudge