Why "show running-config interface ont-etherent 836/g1" iterate through all entries of the list?

When I run show running-config interface ont-etherent 836/g1, I found Confd does invoke get_next() to iterate through all entries of the list.
But when I run show interface ont-etherent 836/g1, Confd does directly invoke get_elem() to retrieve the 836/g1 leaf config data.

I hope confd show running-config interface ont-etherent 836/g1 also only invoke get_elem() to retrieve the 836/g1 leaf config data and not invoke get_next.

How can I implement it ? thanks.

the yang like following:

augment /exa:config/exa:interface {    
    list ont-ethernet{
        key port;
        tailf:callpoint cli_if_config_cp;
        leaf port {
             type string;
        }
    }
}

==

augment /exa:status/exa:interface {
    list ont-ethernet {
        tailf:callpoint cli_if_status_cp;
        key port;
        leaf port {
             type string;
        }
    }
}

Jessica,
The get_next() callbacks are being invoked most likely for the CLI to get ready to do key completion. There is an annotation tailf:cli-no-key-completion to prevent the CLI from getting all the keys as possible comipletions. If you never want key completion to be available, then you can try this annotation but it will disable key completion in all cases, including config mode.

Thanks @greg, I used “tailf:cli-no-key-completion” , which only disable key completion in config mode including config ** and show running-config **, and did still trigger get_next() to iterate all list nodes.

Hello,

few questions, to clarify

  1. the config and status elements (containers ?) are not part of the show commands, e.g.:

Config:
show running-config interface ont-etherent 836/g1
vs
show running-config config interface ont-etherent 836/g1

Status:
show interface ont-etherent 836/g1
vs
show status interface ont-etherent 836/g1

Is it because config and status containers are hidden?

Elements under status container are config false and under config container are config true (default value). Is it correct?

You do not use CDB, but external database for config data. Is it correct?

Thanks @mnovak, You are right.

  1. the config and status elements are both containers and hidden .
    2)yes, Elements under status container should use “show cmd” to retrieve the data on CLI, including config data and status data(config false).
    Elements under config container are configure data by user or some default value .
    "show running-config " is to retrieve config data.
  2. yes, we use external database for all data including config data and status data.