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:
api endpoint name
mongo collection name
jsonschema to validate against
list of C, R, U, D supported (not all service want, say, delete)
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.
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.