netmod-wg / yang-next

Feature requests for future versions of YANG
6 stars 0 forks source link

introduce if-module #57

Open mbj4668 opened 6 years ago

mbj4668 commented 6 years ago

it would be useful to have a statement "if-module" that can be used like if-feature:

leaf my-interface {
  if-module ietf-interfaces;
  type if:interface-ref;
}
rgwilton commented 5 years ago

This seems useful to me. Presumably it would be allowed wherever if-feature is allowed.

kwatsen commented 5 years ago

Kent: could use if-feature statement, but this is simpler Lada: could use 'when' statements, but would require live configuration

Andy: would this support 'not'? Martin: ...and boolean expressions?

Robert: perhaps have implicit features? Andy: but then YANG library would have to report them

llhotka commented 5 years ago

The new YANG library (7895bis) makes this more complicated because a module may be present only in a subset of datastores. I still think that it would be better and more flexible to permit somehow XPath expressions querying YANG library in config=true data.

mbj4668 commented 5 years ago

I don't think it is more complicated than if-feature, which also can vary across module-sets.

I prefer explicit statements b/c otherwise we couple the module definition to the exact layout of the YANG library.

kwatsen commented 2 months ago

Andy: what if there are deviations. James: would like a use case. Importance dependent on the use-case. Juergen: how different than using if-feature statements (workaround). Juergen: one benefit is that it doesn't rely on the server to have to enable a feature, it happens automatically.

jgcumming commented 2 months ago

Should clarify in this issue whether this is

  1. Feature exists
  2. Feature 'implemented'
  3. Feature 'import-only'