You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have been learning clixon for last few days and it is an impressive project. I am following the readme, and I got to the Datastore section. I am probably missing something, but my current mental model on how datastore_client should work is as follows:
I modify data in any datastore using the datastore_client app
Changes are reflected in cli
At this point it seems that the above assumption is not valid:
I created a basic configuration using cli: root@lebox> show configuration interfaces { interface { name eth1; type ex:loopback; enabled true; } }
I can retrieve that configuration using datastore_client: sudo ./datastore_client -d running -b /usr/local/var/example/ -p /home/victor/clixon/datastore/text/text.so -y /usr/local/share/example/yang/ -m example get / <config><interfaces><interface><name>eth1</name><type>ex:loopback</type><enabled>true</enabled></interface></interfaces></config>
I can add an item to the configuration: victor@lebox:~/clixon/datastore$ sudo ./datastore_client -d running -b /usr/local/var/example/ -p /home/victor/clixon/datastore/text/text.so -y /usr/local/share/example/yang/ -m ietf-ip put merge '<config><interfaces><interface><name>eth2</name><type>ex:loopback</type><enabled>true</enabled></interface></interfaces></config>' victor@lebox:~/clixon/datastore$ sudo ./datastore_client -d running -b /usr/local/var/example/ -p /home/victor/clixon/datastore/text/text.so -y /usr/local/share/example/yang/ -m example get / <config><interfaces><interface><name>eth1</name><type>ex:loopback</type><enabled>true</enabled></interface><interface><name>eth2</name><type>ex:loopback</type><enabled>true</enabled></interface></interfaces></config>
The configuration change made in step 3 is not reflected in cli.
Please advise what did I miss in that workflow, or is my understanding on how datastore_client should work flawed.
Regards
Jan
The text was updated successfully, but these errors were encountered:
Jan,
The datastore client is a direct low-level interface to the datastore. It is intended as a debug tool. However, if used without caching it should work as you describe (I haven't verified your example in detail though).
But the datastore client has a per-process write-through cache CLICON_XMLDB_CACHE which is true by default.
This means that if you write in the datastore with the low-level datastore client, the cache in the backend/cli will not be invalidated and the cli will read stale data.
At least this is what I guess is happening. I could look at it in more detail at a later time.
I am curious on your use-case. Usually, the datastore client is not used except for debugging. Editing directly in the files are also possible.
The usual usecase is that you access the datastore via the backend and the cli/restconf/netconf clients.
There may also be some older documentation that gives another view on this, if so, please point me to it , and I can update it.
Thanks for using clixon!
Olof,
I want to use clixon to configure a system that I am trying to build. The main datastore is going to be a relational database, and was considering how to synchronise the backend and the database. As it usually happens, after I sent the email to you I got the idea to use netconf/restconf as an interface between those two data sources. Which makes a perfect sense and keeps everything coherent. And now you validated that assumption, thanks for that.
Again, I really appreciate the effort you put in this project, it is a great stuff
Hi,
I have been learning clixon for last few days and it is an impressive project. I am following the readme, and I got to the Datastore section. I am probably missing something, but my current mental model on how datastore_client should work is as follows:
At this point it seems that the above assumption is not valid:
root@lebox> show configuration interfaces { interface { name eth1; type ex:loopback; enabled true; } }
sudo ./datastore_client -d running -b /usr/local/var/example/ -p /home/victor/clixon/datastore/text/text.so -y /usr/local/share/example/yang/ -m example get /
<config><interfaces><interface><name>eth1</name><type>ex:loopback</type><enabled>true</enabled></interface></interfaces></config>
victor@lebox:~/clixon/datastore$ sudo ./datastore_client -d running -b /usr/local/var/example/ -p /home/victor/clixon/datastore/text/text.so -y /usr/local/share/example/yang/ -m ietf-ip put merge '<config><interfaces><interface><name>eth2</name><type>ex:loopback</type><enabled>true</enabled></interface></interfaces></config>' victor@lebox:~/clixon/datastore$ sudo ./datastore_client -d running -b /usr/local/var/example/ -p /home/victor/clixon/datastore/text/text.so -y /usr/local/share/example/yang/ -m example get / <config><interfaces><interface><name>eth1</name><type>ex:loopback</type><enabled>true</enabled></interface><interface><name>eth2</name><type>ex:loopback</type><enabled>true</enabled></interface></interfaces></config>
Please advise what did I miss in that workflow, or is my understanding on how datastore_client should work flawed.
Regards
Jan
The text was updated successfully, but these errors were encountered: