use case is - I want to generate a csv file with header as leaf names and value in corresponding column.
suppose my container is -
container {
list values {
key “a b”
leaf a
leaf b
leaf c
}
}
Now in CDB i have
a b c
3 4 5
4 4 5
4 5 6
Now I want to generate CSV in same format as above by reading data from CDB.
So to generate file header leaf name should be know to application.
cohult
June 15, 2017, 10:38am
2
See for example the print_modifications examples here:
It is quite easy to just call the cdb_get_modifications() function after reception of a subscription notification to retrieve all the changes that caused the subscription notification.
To implement such a solution, all that has to be done to the intro/1-2-3-start-query-model example is to add the get modifications call and some printout helpers. The result would be something like this:
Quick demo:
Terminal 1:
$ pwd
/Users/demo/tailf/confd-6.0/examples.confd/intro/1-2-3-start-query-model…
and here:
It is a small task to convert a tag value array to XML. Below is a quick implementation and demo where we extend the existing ConfD intro/1-2-3-start-query-model example by first getting the subscription configuration updates using a confd_get_modifications() call and then print the tag value array result in in pretty XML format.
Example code:
Let’s first do a diff to see what we added to the 1-2-3 intro example:
$ pwd
/Users/conny/tailf/confd-5.4.2/examples.confd/intro/1-2-3-start-query-m…
Can you please give the samples. I dont have.
cohult
June 16, 2017, 11:36am
4
I believe all the example code you need are in the postings I pointed to when used together with the 1-2-3 intro example that comes with the ConfD example set.