Hi,
I am using klish 3.0 and developping Cisco like CLI nevigation for my NOS. Below is the sample xml file to achieve my intention of :
1. Mode within in mode. config to configure interface and enter config-if-eth0 mode, dynamic view prompt. can we use ifname into other tags?
2. configure interface attributes in the interface mode.
3. call the open config schema to update in sysrepo.
4. when interface view is exit, move back to config view.
However it is not wokrijg;
how do we transfer the ifname to call sysrepo update as well as used for building dynamic prompt such as config-if-eth0?
We will be of great help to provide the documentation on how to build command xml for configuration and update sysrepo dB which hosts openconfig yang.
<KLISH>
<VIEW name="config">
<COMMAND
name="interface"
help="Enter interface config mode">
<PARAM
name="ifname"
ptype="IFNAME"
help="Interface name (e.g. eth0, lo, bond0, GigabitEthernet0/0)">
<ACTION sym="nav@klish">replace config-if ${ifname} />
<ACTION sym="set@klish">/openconfig-interfaces:interfaces/interface[name='${ifname}'] />
</PARAM>
</COMMAND>
<VIEW name="config-if">
<PROMPT>
<ACTION "sym@script">printf 'config-if-%s#' "${__viewid}"</ACTION>
</PROMPT>
</VIEW>
</VIEW>
</KLISH>
Regards,
Prabhu