-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add endpoints for just updating specific portions of entityInfo #235
Comments
@bserdar @jewzaam Would you be opposed to something like this? I'd be willing to work on a pull request this week if you don't see any issues. It wouldn't be comprehensive for all of entityInfo, but would set a pattern for other bits of entityInfo to follow. Specifically I would like to implement something like In the future, you could imagine additions like PUT ../entityInfo/indexes or defaultVersion, etc. It could be implemented purely in lightblue-rest as sugar for getEntityInfo -> updateEntityInfo where only relevant bit is replaced. Or, we could add additional API's to Metadata in core, implement them in mongo, and expose them in rest. This is more complicated, but could make the operations atomic, so that an update to >1 piece of entity info at the same time wouldn't risk losing one or more updates to unrelated pieces. That being said, I don't think that would be all that hard given the relative simplicity of metadata operations. What do you guys think? |
+1 for implementing this in lightblue rest. Adding functionality to core On Sat, Jun 11, 2016 at 8:24 AM, Alec Henninger [email protected]
|
Naively, couldn't we add abstract methods such as I guess core would have to be able to parse the hook configuration, but I think it can do this? I'm mostly curious, I don't have an issue with implementing it only in lightblue-rest. |
It will be defined in core, but won't be used there. It will be like Using the same logic., it doesn't make sense to have createMetadata, On Mon, Jun 13, 2016 at 6:23 AM, Alec Henninger [email protected]
|
But putting that in core decouples you from the backend right? I guess I Again, just exploring this with you :). I'd like to understand the bits and On Mon, Jun 13, 2016, 8:52 AM Burak Serdar [email protected] wrote:
|
I don't think putting that in core decouples front-end and back-end. I core is at the bottom of the stack, and has a very limited view of the So ideally, all metadata management operations should be done in mongo, and On Wed, Jun 15, 2016 at 5:23 AM, Alec Henninger [email protected]
|
Interesting, makes more sense now, thank you. Do you think in the future there would be a good place other than mongo and core to add an interface to abstract working with metadata? (That is, capability we would expect of any metadata implementation, some of which may not be relevant to core) |
Can't say. It is possible to write a completely separate webapp that deals On Wed, Jun 15, 2016 at 8:29 AM, Alec Henninger [email protected]
|
Here's a proposal: Entity info has these components:
For the arrays, we can add a an add api that gets a json document: A remove api, something like And a modify api that gets the same json doc as add function. For datasource, we'd only have a modify api. |
So the full entityInfo is in the request but use query param to indicate which subset to operate against? |
No, only the relevant part is in the request. Maybe something like a PATCH request containing an object with pieces of entityInfo, and it'll be patched to the stored entityInfo. |
That makes sense. Could we have a quick spec on what is expected? Sample metadata and how to make a request to operate against an index, assuming it's the same for hooks and enums. How to delete, add, and update. |
Here's a first attempt: PATCH rest/metadata/entityName { If a PATCHed object exists in entityInfo any field included in the patch indexes/enums/hooks are matched by name. If an array element is not in the Deleting: Two options:
On Thu, Jun 23, 2016 at 11:40 AM, Naveen Malik [email protected]
|
It's a bit stressful updating entityInfo because if anything is messed up it can be fatal, and often you just want to update one small thing, like hook configuration.
It'd be great if you could just hit an endpoint like PUT /metadata/user/hooks/notificationHook/ with notification hook configuration JSON.
The text was updated successfully, but these errors were encountered: