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
17 files changed
tree: a8236091c1c5929758b05e6dad029416f11c9988
  1. .clang-format
  2. .gitmodules
  3. .zuul.yaml
  4. CMakeLists.txt
  5. Doxyfile.in
  6. LICENSE
  7. LICENSE.md
  8. README.md
  9. ci/
  10. cmake/
  11. docs/
  12. src/
  13. submodules/
  14. tests/
README.md

Console interface to NETCONF servers

This program provides an interactive console for working with YANG data. It can connect to NETCONF servers, and also talk to sysrepo locally.

Installation

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.

Bug Reporting

Issue reporting and feature requests are welcome via Taiga.io.

Development

We are using Gerrit for patch submission, code review and Continuous Integration (CI). Development roadmap and planning happens over Taiga.io.

Credits

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.