Multiple models for gnmi target
In the current implementation of gnmi target, a single model is initialized and used for implementing of the server. I would like to know how we can run multiple models using a single gnmi agent? Does it make sense to do that?
The current server with a single model was created as a simple reference implementation. Adding support to use multiple models would be a nice to have.
@samribeiro I would like to hear your ideas if you want to implement it yourself. What is the best way to tackle this problem? Do you think Can we have one single tree which can support multiple model schemes?
@adibrastegarnia I think the best path forward is to have a binary that dynamically supports the models that it gets loaded with. As oposed to have a static model at compile time.
@samribeiro Thanks for your response. Yeah we are almost doing the same thing in a project but my question mostly is about the tree data structure which holds information about config tree. It looks like a tree per model will be needed to be created in the memory correct?
@adibrastegarnia it depends on what you are aiming for. For this specific case where the intent is to mock model hierarchies and their leaf values, then having data in memory is paramount.
@samribeiro I see. We are implementing a gnmi agent for configuration of an application. Technically, modeling an app as a device entity which can be configured via gnmi. I am trying to see if a model driven approach should be used or should we use a map[string]interface which holds paths/values independent of the scheme. The requests that are coming to the agent will be verified by onos-config which validates the requests based on the model.
In that scenario, potentially an application can use multiple models for its configuration which have different trees.
There should always be the same root of the tree. You may have different roots if you use the origin field.