vrancurel / dcss

Decentralized Secure Storage with the Ethereum Blockchain
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Expose a REST API for the simulator #51

Open slaperche-scality opened 6 years ago

slaperche-scality commented 6 years ago

Currently, you can control the simulator by executing command on its prompt. It's good for interactive use, but not that much for playing "demo scenario" or "test script".

Ideally, the simulatior should be totally controllable through a REST API (exposing all the command that exists in the shell, plus some other such as "add node", "remove node", …).

The goal of this issue is to design and implement a REST API for the simulator (TBC: it will probably rely on Swagger).

This issue is a prerequisite for #36.

slaperche-scality commented 6 years ago

After some digging around, things are not so bright. I didn't find a good REST framework for us to use:

So, we will probably have to build something ourselves on top of libmicrohttpd (will create a dedicated issue for that).

As for Swagger, seems like we won't be able to benefit from the code generation from the YAML specs, because the code generator for server relies on restbed for C++. That being said, I still think it's worth to have a Swagger spec (it will allows people to auto-generates REST clients for our API in others languages), we will have to write it by hand though (maybe with the help of https://editor.swagger.io/).