Yang validation : String manipulation

Hi,

We have ietf interface yang model, We need to validate if the interface for a subinterface exists

container interfaces
{

}

I don’t know if part of your entry disappeared, but if you could describe or show how you model subinterfaces, then someone can answer

Some possibilities would be to augment the interfaces model by adding the subinterfaces as part of the interface entry, then you know the interface has to exist.

Another possibility is to use a leaf-ref in the subinterface information that points to the interface it belongs to, which will then be enforced by ConfD

A final possibility that I can think of right now, would be to add a must-statement that checks that the interface for the sub-interface exists in the list of interfaces, but the must-statement itself would depend on the structure of your model