How can different views onto same data model be defined?

RFC6020 contains the following statement “A NETCONF server may implement a number of modules, allowing multiple views of the same data” (my emphasis). I want to do exactly that, so that my NETCONF server can expose different parts of my device’s overall data model to different clients. In some cases, the views exposed to different clients might overlap.

The question is, how does YANG support this? One might think that in one module you could include a container that is defined in another module, but as far as I know that is not supported in YANG. I know that you can use “augment” to add data items to an existing item that is defined in an imported module, but I just want to reuse a container from another module ‘as is’.

I would be grateful for any suggestions as to how to achieve this.

You can review the use of Transforms as described in Chapter 10 of the ConfD User Guide to see if that meets the requirements of your use case. Transforms allow you to create different YANG models to expose the same underlying data in different views.