Yang suggestion

We have a requirement to define model for a specific AP. For which below is my sample YANG file. choice type {
mandatory true;
container MODEL_2_RADIO {
uses ap-model-2-radio-g;
}
container MODEL_4_RADIO {
uses ap-model-4-radio-g;
}
container MODEL_2_RADIO_2 {
uses ap-model-2-radio-2-g;
}
}

But once we have set the model as say for example MODEL_2_RADIO, we should not change it to something else. Currently, I am subscribing for any deletion( once we change, the earlier model get deleted) and then not setting the parameters in the application. Is there a way to apply this restriction in the schema itself?

Is the model type tied to the AP model?

If yes, why not use a combination of “factory” configuration specified in an init file and AAA to control this type?

If it’s something that is user specified and can be anything, one way of achieving this is by using the hook mechanism and modifying AAA rules within the transaction that added the model type so that no other user can modify it later.

The last option is to validate this in the validation callback.

There is no way in YANG that operations can be validated, YANG semantic validation targets “Candidate” data (Data to be committed) and not operations (including data to be removed).

Thanks for the reply!