ConfD User Community

Show status Statement in CLI



Does CLI support the status Statement as described here:

If I have a yang file where a parameter is obsolete or deprecated will I be able to get this info from CLI?




The status statement is considered information to the reader of the YANG model. Nodes are put as “status current” by default as RFC 6020 / 7950 specifies, and ConfD make no difference between “current”, “deprecated” and “obsolete” nodes. The information is not shown in the CLI.

One way to show this information in the CLI would ge to make use of the tailf:info statement. See ConfD UG 6.5 3.8.1. Custom Help Texts.

If you want to prevent obsoleted and/or deprecated nodes from being shown or exported to a file when the configuration is saved could be to use a hide group, one for deprecated and one for obsolete and hide one or both of them before saving the config.

  leaf autumn {
    type string;
    description "DEPRECATED: a pretty autumn leaf";
    tailf:info "DEPRECATED: a pretty autumn leaf";
    status deprecated;
    tailf:hidden deprecated;

Note that if a hide group is visible then those nodes are accepted, but if it is not visible then the nodes are not accepted with for example the load command.

It is possible to create a validation callback which uses the CONFD_VALIDATION_WARN or CONFD_ERR results and then give back a warning or error to the user if a deprecated/obsoleted node is being configured, perhaps in combination with the tailf:meta-data and tailf:meta-value statements.



Does ConfD expose the status statement information, described in RFC 6020, via any of the APIs?
e.g. using confd_load_schemas() and confd_cs_node_info struct.



The status statement is not included in the schema information.
But as I mentioned in the reply you can add it using tailf:meta-data and tailf:meta-value statements.

See these topics for inspiration: