commit | ab612e9dbdab84ab4afe11486cab927d39b398f2 | [log] [tgz] |
---|---|---|
author | Václav Kubernát <kubernat@cesnet.cz> | Tue Nov 26 19:51:31 2019 +0100 |
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | Sat Feb 01 01:56:24 2020 +0100 |
tree | a8236091c1c5929758b05e6dad029416f11c9988 | |
parent | 1acf4f10e58a65c43660591c9a7c9dea949f203c [diff] |
Implement DataQuery For now, the DataQuery class includes the listKeys method, which will be used in the parser for tab-completion of values of keys. The listKeys method uses similar arguments as many methods from the Schema interface do. This is due to how parsing works: when I parse lists I won't get the full list instance until all keys are typed. That's why I can't get the full path to the list: it can't be a full data path until all keys are known. I tried many different return types of the method. The first iteration used just a string to string map. That didn't work well, because discarding type info meant that I needed to quote strings in THIS method. And that didn't go well when trying to integrate this to the parser, because I couldn't compare quoted strings with unquoted strings. The next return type I tried - a set of string to leaf_data_ maps - was better. It doesn't discard type info and that makes it possible to compare in the parser. However, I didn't really make use of an ordered container, so I changed the type to a vector. The various implementations of this method were pretty straightforward. They usually just retrieved all the instances from the datastore with DatastoreAccess::getItems and then used some sort of an algorithm to transform the instances into the desired return type. However, there was a problem with this approach: it is difficult to get ONLY the instances, and no other data. This means that it is unsuitable to use getItems for this, because: a) it always works recursively b) even if it didn't Netconf would still give me more data than I wanted. It is possible to create an XML filter, so that no data has to be discarded, but it's only possible in Netconf and not sysrepo. This difference is going to be (hopefully) removed with sysrepo2. I decided to implement a datastore-specific method, where both sysrepo and netconf use their own best implementation. Change-Id: I2c978762d3a78286b4f7fb97e16118772ddeb7bc
This program provides an interactive console for working with YANG data. It can connect to NETCONF servers, and also talk to sysrepo locally.
For building, one needs:
Use an exact commit of any dependencies as specified in submodules/dependencies/*
.
The build process uses CMake. A quick-and-dirty build with no fancy options can be as simple as mkdir build && cd build && cmake .. && make && make install
.
Issue reporting and feature requests are welcome via Taiga.io.
We are using Gerrit for patch submission, code review and Continuous Integration (CI). Development roadmap and planning happens over Taiga.io.
Copyright © CESNET, https://www.cesnet.cz/ . Portions copyright © Faculty of Information Technology, Czech Technical University in Prague, https://fit.cvut.cz/ . Most of the code was written by Václav Kubernát (CESNET, formerly FIT ČVUT) and Jan Kundrát (CESNET). The project is distributed under the terms of the Apache 2.0 license.