Same name for two containers, one config, one operational

Can I have the same container name in the same module?

I want to achieve the following:

in config mode:

set system time

in operational mode:

show system time

I have different containers for config and operational. they are under the same module. What to do in such cases?

Defining two containers in the same YANG module with the same name will fail confdc (the YANG compiler). If you are looking for this behavior only for the CLI northbound, then you can define the operational container with a different name in the YANG module and use tailf:alt-name to specify the same name as the configurable container.

Thanks, That worked !!