Hi Team,
I have below yang model ,
container vrf {
description
"VRF commands";
// vrf definition *
list definition {
description
"VRF definition mode";
tailf:cli-mode-name "config-vrf";
key "name";
leaf name {
description
"WORD;;VRF name";
tailf:cli-suppress-range;
type string;
}
list voice-vrf {
description
"voice vrf id";
tailf:cli-mode-name "cfg-media-addr-vrf";
key vrfname;
leaf vrfname {
description
"WORD;;VRF name";
tailf:cli-suppress-range;
must "/ios:native/ios:vrf/ios:definition[ios:name=current()] {
error-message "VRF must be created 1st, deleted last";
}
type string;
}
Now , I want the following things ,
- During creation of voice-vrf it should check if vrf definition exists (which is achieved through must statement)
- During delete of vrf definition , it should delete references of all dependent nodes also. (how to achieve this??)
Currently ,When I am trying to delete “vrf definition vrf1” , it is not allowing me as voice-vrf vrf1 exist .
ubuntu-xenial(config)# no vrf definition vrf1
ubuntu-xenial(config)# commit
Aborted: ‘voice-vrf’ (value “vrf1”): VRF must be created 1st, deleted last