Hi All,
I want to display configured values in the show command and if anything is not configured then I want to call show command with some default value.
My show command syntax is “show policy access-list [name] stats”
My acl yang is below
grouping policy-config-grouping {
list access-list {
tailf:info "configure ACLs";
tailf:cli-compact-syntax;
key "name";
leaf name {
tailf:info "name of access list";
type string;
}
list sequence {
tailf:info "list of sequences";
key "seq-value";
leaf seq-value {
}
leaf protocol {
}
leaf source-ip {
}
leaf destination-ip {
}
leaf source-port {
}
leaf destination-port {
}
leaf action {
}
}
leaf default-action {
}
}
}
container policy {
tailf:info "policy information";
tailf:cli-add-mode;
uses policy-config-grouping;
}
}
I want the following points:
- If the access list is configured then in the “show policy access-list [name] stats” command, I would like to see the configured access-lists if user type ? after access-list keyword.
- Also I would also like to see one more keyword name as
all
along with the configured access-lists. It is because if any user want to dump the stats of all the access-list then he can pass theall
keyword instead of the configure access-list
so finally the command what I want looks like something below
show policy access-list [all | acl-1 | acl-2 | acl-n ] stats
I tried to implement the same thing but I am facing below problem
- not able to display the extra keyword
all
along with the configured access-lists - If no access-lists are configured then show command does not move after “show policy access-list”. After this it shows “No entries present”
Can someone please help me