Hi Team,
I am writing model for one CLI which looks like below,
Router(conf-voi-serv)#media-address range 1.1.1.1 2.2.2.2 port-range ?
<8000-48198> minimum port number
Router(conf-voi-serv)#media-address range 1.1.1.1 2.2.2.2 port-range 8000 ?
<8000-48198> maximum port number
Router(conf-voi-serv)#$ss range 1.1.1.1 2.2.2.2 port-range 8000 8002 ?
Router(conf-voi-serv)#$ss range 1.1.1.1 2.2.2.2 port-range 8000 8002
Router(cfg-media-addr-range)#?
Media Address Range configuration commands:
default Set a command to its defaults
exit Exit from media address range configuration mode
no Negate a command or set its defaults
port-range media address port range
Router(cfg-media-addr-range)#po
Router(cfg-media-addr-range)#port-range ?
<5500-65498> Start media address extended port
Router(cfg-media-addr-range)#port-range 5500 ?
<5500-65498> Stop media address extended port
Router(cfg-media-addr-range)#port-range 5500 5600 ?
Router(cfg-media-addr-range)#port-range 5500 5600
Router(cfg-media-addr-range)#do show run | s media-address
media-address range 1.1.1.1 2.2.2.2 port-range 8000 8002
port-range 5500 5600
Now I have written yang model for above as,
container media-address {
description
“Voice Media IP Address Range”;
when “…/type = ‘voip’”;
tailf:cli-incomplete-no;
container range {
description
“Address range”;
tailf:cli-incomplete-command;
list ipv4 {
tailf:cli-drop-node-name;
tailf:cli-mode-name “cfg-media-addr-range”;
key “startipv4address endipv4address”;
leaf startipv4address {
description
“Enter start ip address”;
tailf:cli-suppress-range;
type inet:ipv4-address;
}
leaf endipv4address {
description
“Enter end ip address”;
tailf:cli-suppress-range;
type inet:ipv4-address;
}
}
uses config-port-range-grouping;
uses config-extended-port-range-grouping;
}
grouping config-port-range-grouping{
container port-range {
description
“Port range”;
tailf:cli-flatten-container;
tailf:cli-hide-in-submode;
leaf minport{
description
“minimum port number”;
tailf:cli-drop-node-name;
must “. mod 2 = 0” {
error-message “min_port value must be even”;
}
type uint16 {
range “8000…48198”;
}
}
}
grouping config-extended-port-range-grouping{
container port-range-extended {
description
“media address port range”;
tailf:alt-name “port-range”;
tailf:cli-sequence-commands;
tailf:cli-compact-syntax;
presence true;
leaf minport{
description
“Start media address extended port”;
tailf:cli-drop-node-name;
must “. mod 2 = 0” {
error-message “min_port value must be even”;
}
type uint16 {
range “5500…65498”;
}
}
}
But on confd I am unable to see port-range (8800…) one as both containers have same name .Can u please help on this ?
ubuntu-xenial(config)# voice service voip
ubuntu-xenial(conf-voi-serv)# media-address ?
Possible completions:
range voice-vrf
ubuntu-xenial(conf-voi-serv)# media-address range ?
Possible completions:
<startipv4address:IPv4 address> <startipv6address:IPv6 address>
ubuntu-xenial(conf-voi-serv)# media-address range 6.6.6.6 7.7.7.7 ?
Possible completions:
port-range
ubuntu-xenial(conf-voi-serv)# media-address range 6.6.6.6 7.7.7.7 port-range ?
Possible completions:
<unsignedShort, 5500 … 65498>
ubuntu-xenial(conf-voi-serv)# media-address range 6.6.6.6 7.7.7.7 port-range
Here 5500 port is visible not 8000 one .
Can someone pls reply at the earliest.