Subject: Re: [netmod] require-instance error-app-tag

From: Martin Bjorklund <[email-masked]>
Date: Sun, 01 Mar 2009 12:38:51 +0100 (CET)

Andy Bierman <[email-masked]> wrote:
> Martin Bjorklund wrote:
> > David Partain <[email-masked]> wrote:
> >> Hi,
> >>
> >> On Monday 09 February 2009 21.46.08 Martin Bjorklund wrote:
> >>> Andy Bierman <[email-masked]> wrote:
> >>>> Hi,
> >>>>
> >>>> There doesn't seem to be any good error codes for a
> >>>> require-instance = true violation for a leafref or instance-identifier.
> >>>> Perhaps a new error-app-tag and sub-section of 13.x should be
> >>>> added to make that stand out, especially since the default
> >>>> is true.
> >>> I agree.   'missing-instance' is already used.  How about
> >>> 'instance-required'? 
> >> Seems fine to me.
> >>
> >>> What should the error-tag be? 'operation-failed', or could 'data-missing'
> >>> be used?
> >> data-missing makes good sense.
> > Ok.  I have added:
> > ** Error Message for Data that Violates a require-instance statement:
> >     If a NETCONF operation would result in configuration data where an
> >     instance reference marked with require-instance "true" refers to a
> >     non-existing instance, the following error is returned:
> >     Tag:            data-missing
> >       Error-app-tag:  instance-required
> > 
> 
> Add:
>        Error-path: Path to the element with the require-instance statement

Ok.

> > There's also no good error code for the case when a mandatory choice
> > does not exist.   I propose the following text:
> > ** Error Message for Data that Violates a mandatory choice statement:
> >     If a NETCONF operation would result in configuration data where no
> >     nodes exists in a mandatory choice, the following error is returned:
> >     Tag:            data-missing
> >       Error-app-tag:  missing-choice
> >       Error-path:     Path to the element with the missing choice.
> >       Error-info:     <missing-choice>: Contains the name of the missing
> >                       mandatory choice.
> >     The <missing-choice> element is in the YANG
> >                       namespace ("urn:ietf:params:xml:ns:yang:1"
> >                       [XXX IANA]).
> > 
> 
> The <missing-choice> element should be a QName not an NCName because
> another module could augment the node with a choice
> with the same local name (but in a different namespace).

Ok.  But even if it was a NCName, it would be clear which choice the
error referred to, since it's only the local choice that can be
mandatory.  You cannot add a mandatory choice through augmentation.

But a QName is not wrong, and maybe it will cause less confusion.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Sun, 01 Mar 2009 07:57:14 -0800

> But a QName is not wrong, and maybe it will cause less confusion.

NCName is OK.  I forget that there can only be one of them
in this case.

> /martin

Andy