als-computing / splash-server

Server code for the Splash system.
Other
1 stars 4 forks source link

Method for easily creating restful/crud microservices for mongo collections #38

Open dylanmcreynolds opened 4 years ago

dylanmcreynolds commented 4 years ago

The splash-server has classes that setup CRUD services to a Mongo collection. This was setup and packages principally for the purpose of supporting the splash-client portal.

However, there are uses cases outside of the splash-client that we would like to support with this same CRUD-like functionality. For example, a datamovement tracking service is being build that persists data in mongo collections. It would be nice to be able to quickly stand up a splash REST-to-CRUD mongo service with nothing more than a configuration file.

So let's try that.

Let's define a CRUDServiceBuilder class that accepts:

Then, add a build() method. This will build member Service and Resource classes.

Then we can define a python entrypoint, let's say splash.crudbuilder. When splash starts up, it will look for instances of that entry point, instantiate them and call build(). Once done, it can then setup flask with the appropriate service and resource classes.

J-avery32 commented 3 years ago

@dylanmcreynolds Have you finished this?