Closed pythonhacker closed 1 year ago
This can be done by writing a RESTFul HTTP API layer on top of the existing APIs supported for entities. I also think we should avoid the _e
prefix in the RESTFul APIs. @vmatv8 - Pls comment on this and I will implement it.
@pythonhacker I think we can have the RESTful model as the default, there is no need for a wrapper. Business dataflows can be exposed via the POST /_e/event
endpoint, just as we have right now. @fractlrao What do you think?
Supporting a RESTful interface directly, instead of as an additional layer, would be helpful.
Thanks for the comments @fractlrao @vmatv8 - A variation from the URL scheme I suggested /Namespace.Component/Entity
is /Namespace/Component/Entity
. Let me know your thoughts about it. And kindly assign this to me @vmatv8 .
I kept the /_e/
prefix to identify endpoints that directly evaluate events, i.e non-REST APIs. This is just a suggestion, I am fine with other naming schemes.
Will be tracked under https://github.com/fractl-io/fractl/issues/815
Currently the default CRUD operations for entities don't follow a RESTful model.
/_e/Namespace.Component/Lookup_Entity
-d'{"Namespace.Component/Lookup_Entity": {"Id": "<id>"}}
'/Namespace.Component/Entity/<id>
/_e/Namespace.Component/Upsert_Entity
-d'{"Namespace.Compnent/Upsert_Entity": {"Instance": {field1: val1, field2: val2, field3: val3 ...}}}
'/Namespace.Component/Entity
-d'{field1: va1, field2: val2, field3: val3 ...}
'/Namespace.Component/Entity/<id>
-d'{field1: updated_val1, fieldm: updated_valm ... }
'/_e/Namespace.Component/Delete_Entity
-d'{"Namespace.Component/Delete_Entity": {"Id": "<id>"}}
'/Namespace.Component/Entity/delete/<id>
OR DELETE/Namespace.Component/Entity/<id>