Hi Folks,
I have a CLI command, which changes the mode in the order-
(config)#
<< which indicate configuration mode.
(config)#my_command 1
(config-my-cmd)#probe A
(config-my-cmd-probe-A)#
So when I type in the command “my_command 1” it takes me to the new mode “config-my-cmd”. Under this sub-mode, it supports different types of probe types, and for our example, I would like to configure with “probe A”. Which makes the system to enter into a new mode “config-my-cmd-probe-A”.
And i will exit out multiple levels to come to (config)# mode
========================================================================
Now since the command “my_command 1” is already configured on the device. Now if I type in the command “my_command 1” and press enter, my CLI is designed to directly enter into the mode “config-my-cmd-probe-A” by skipping “config-my-cmd”. Reason being, for a given ID (my_command 1), we are not allowed to change the probe type.
So CLI transition looks like-
(config)#
<< which indicate configuration mode.
(config)#my_command 1
(config-my-cmd-probe-A)#
How can i model this kind of behavior using yang?
My existing implementation looks like -
container my_command {
tailf:cli-incomplete-no;
list entry {
tailf:cli-drop-node-name;
tailf:cli-suppress-list-no;
tailf:cli-full-no;
tailf:cli-full-command;
tailf:cli-mode-name "config-my-cmd";
key "number";
leaf number {
type uint32;
}
choice params {
case param-A-case {
container param-A {
tailf:cli-add-mode;
tailf:cli-mode-name "config-my-cmd-probe-A";
tailf:cli-sequence-commands;
tailf:cli-incomplete-command;
leaf a {
type uint8;
}
leaf b {
type uint8;
}
.
.
.
So with this model, i am able to achieve the first order of CLI mode changes. However, I wont be able to achieve the second order of CLI mode changes (ie the scenario of when the command is already configured).