GitHub user kaspersorensen opened a pull request:
https://github.com/apache/metamodel/pull/110
Rest api - MetaModel-as-a-Service - draft application
Hi all,
This is my attempt at building a 'MetaModel-as-a-Service' webapp. Although
it is not yet as great as I imagine it should be before we release it, I do
think there's a considerable amount of work here to go with, and that might
trigger others who want to help with the finishing touches.
This webapp allows the user to define data sources in a number of groups
(in the code I used the word 'tenant' because I imagine usually each group
would be a tenant of the application). The data source can then be explored,
queried and updated using RESTful endpoints. For example:
* `PUT /t1` would register a new data source with name 't1'.
* `PUT /t1/ds` would register a new data source with name 'ds'.
* `GET /t1/ds` would show information about 'ds', including it's schema
names.
* `GET /t1/ds/s/public` would show information about the schema 'public'.
* `GET /t1/ds/s/public/t/customers` would show information about the table
'customers' in schema 'public'.
* `POST /t1/ds/s/public/t/customers` would insert data into the
'customers' table.
* `GET /t1/ds/q?sql=SELECT+name+FROM+customers` would fire the given query
to the data source.
(see the controllers package for all endpoints).
Here's what is missing (as far as I can think of) before I think it is
_really_ releasable:
- No formal interface documentation yet (I think we should add a swagger
file).
- No persistence of tenant or datasource information (I imagine we can
have many ways of implementing this - the simplest would simply be a
folder/file based persistence of tenant folders and data source folders / JSON
files).
- So far only a simple datasource definition reader for POJO data (but
others should be very easy to add - I suggest adopting the `MetaModel-spring`
module's approach to this).
Would love a review and discussion, and would invite anyone else to further
contribute to making this releasable.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kaspersorensen/metamodel feature/5.x/rest-api
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metamodel/pull/110.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #110
----
commit c9f56aa753334b571ab868912c47d0e629e351ed
Author: Kasper Sørensen <[email protected]>
Date: 2016-05-24T04:36:33Z
Added scaffolding for 'metamodel-as-a-service' module
commit 8e2ff7167eeae456a1e307426407e262dd7297f8
Author: Kasper Sørensen <[email protected]>
Date: 2016-05-24T06:05:21Z
Made a very simple tenant controller
commit fabd1b9784a7ec6512bf716fe8e6fa39e8cbf15b
Author: Kasper Sørensen <[email protected]>
Date: 2016-05-24T06:11:43Z
Added Docker capabilities: A Dockerfile and README.md
commit 972ea4b1549db94ab595956a043e86fa80dfceed
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-06T06:00:03Z
Added DataContextController. Removed half-baked error handling for now.
commit 6f6f776b1372f7dc6a24e427ced1c6046d696004
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-07T03:14:03Z
Fixed cosmetic review remarks (EOLs and Docker EXPOSE redundancy)
commit 8722c196673713501edbc232ffe5ed3a213fbc5a
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-07T03:55:15Z
Built out an extensive unittest to document a full usage scenario.
commit 8d4d03519d56ce482139ea42fb178504e288c892
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-08T09:35:20Z
Added ability to query data and to specify POJO table defs.
commit 76091fe80fc9a525df19a183a5a9047d13677510
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-08T09:58:41Z
Added a rudimentary table data controller
commit 704790b16ae8754c693251149127ef12b530df7a
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-13T04:33:17Z
Added error handling component
commit 79af7dded8df48e829a70b1d8c2defdd7076cb60
Author: Kasper Sørensen <[email protected]>
Date: 2016-06-13T05:11:06Z
Improved throwing of exceptions from controllers.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---