Re: [netmod] definition of "fully expanded YANG"

2019-07-17 Thread Michael Rehder
Yes, that is interesting and is exactly from my experience.

I'm sure that each translator will either not support much "replacement" (maybe 
none at all) or will re-create full-expansion again.

Mik
> -Original Message-
> From: Carsten Bormann [mailto:c...@tzi.org]
> Sent: Wednesday, July 17, 2019 9:37 AM
> To: Michael Rehder 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] definition of "fully expanded YANG"
> 
> On Jul 17, 2019, at 15:18, Michael Rehder 
> wrote:
> >
> > - translating to another schema language
> 
> Hi Michael,
> 
> If that is interesting to you:
> We will spend the weekend on translating between data modeling languages
> during the IETF105 hackathon as part of the WISHI activity inside T2TRG (sorry
> for the abbrev overload).  YANG will be among the languages we are looking
> at.  This is all in the context of the data model convergence activities 
> going on
> in IoT space, but of course the resulting model translation engines will be 
> useful
> beyond that.
> 
> More info:
> 
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwishi.spac
> e%2F&data=02%7C01%7CMichael.Rehder%40Amdocs.com%7C15271d0a7
> 3d348c798a308d70abbe4ae%7Cc8eca3ca127646d59d9da0f2a028920f%7C0%7
> C0%7C636989674421882779&sdata=RpTY8zuzTfa1nOa8sAyBwsZgYpivjvIO
> VKxIRg2CCJM%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
> m%2Ft2trg%2Fwishi%2Fwiki%2FPreparation%3A-Hackathon-
> Planning%23planned-hacking-
> topics&data=02%7C01%7CMichael.Rehder%40Amdocs.com%7C15271d0a
> 73d348c798a308d70abbe4ae%7Cc8eca3ca127646d59d9da0f2a028920f%7C0%
> 7C0%7C636989674421892775&sdata=oIJx%2FpX%2B9n5kwB7%2BU5F%2F
> H%2FIrQPj9vCsVDUEQ4IJCDE0%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
> m%2Ft2trg%2Fwishi%2Fwiki%2FIETF-105-
> Hackathon&data=02%7C01%7CMichael.Rehder%40Amdocs.com%7C1527
> 1d0a73d348c798a308d70abbe4ae%7Cc8eca3ca127646d59d9da0f2a028920f%7
> C0%7C0%7C636989674421892775&sdata=bBuZzX9gnlEwsw5PbMZt7puGQ
> GflOEkJiiLtzpnyNag%3D&reserved=0
> 
> Discussion is on the T2TRG mailing list,
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.
> org%2Fmailman%2Flistinfo%2Ft2trg&data=02%7C01%7CMichael.Rehder%
> 40Amdocs.com%7C15271d0a73d348c798a308d70abbe4ae%7Cc8eca3ca127646
> d59d9da0f2a028920f%7C0%7C0%7C636989674421892775&sdata=GsnU%
> 2BiTgIdVzbKXcXjRhWJO0nWfjBSakknw4tLL7qRY%3D&reserved=0
> 
> Grüße, Carsten

This email and the information contained herein is proprietary and confidential 
and subject to the Amdocs Email Terms of Service, which you may review at 
https://www.amdocs.com/about/email-terms-of-service 
<https://www.amdocs.com/about/email-terms-of-service>
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] definition of "fully expanded YANG"

2019-07-17 Thread Michael Rehder
Yes, inlining of everything, including augments. What you'd see in the tree 
representation.
For example augments makes it particularly impossible for a consumer of the 
YANG schema to process the schema since the final result.

Some use cases:
- translating to another schema language
- translating to a UI dialog for data entry
- an accurate diff on versions

Model-driven-design means using the "computable specification" for all sorts of 
things, increasing the ROI of the schema definition.

The diff is a significant issue. As a schema author, I must reliably document 
all changes.
Without a full expansion, it's easy to not notice that a particular module has 
changes in its final form.
I don't see how you could verify a semantic version number in a package without 
this.

> -Original Message-
> From: Juergen Schoenwaelder [mailto:j.schoenwael...@jacobs-university.de]
> Sent: Wednesday, July 17, 2019 9:11 AM
> To: Michael Rehder 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] definition of "fully expanded YANG"
> 
> On Wed, Jul 17, 2019 at 01:03:03PM +, Michael Rehder wrote:
> 
> > Has there ever been discussion about defining “fully expanded YANG”,
> > that is a YANG module with all internal and external imports resolved?
> 
> I wonder what "all internal and external imports resolved" means here
> - you mean included inline? I doubt this will be tremendously useful nor do I
> know what that will work with augments and the fact that definitions live in
> different namespaces and that for example must and when expressions are
> namespace qualified.
> 
> I believe there are tools that do semantic diffs based on comparing schema
> trees internal to a compiler and that sounds to me more robust than producing
> "fully expanded YANG".
> 
> /js
> 
> --
> Juergen Schoenwaelder   Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103
> <https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.jac
> obs-
> university.de%2F&data=02%7C01%7CMichael.Rehder%40Amdocs.com%7
> Ce64f1bc5d532478ded2808d70ab844b5%7Cc8eca3ca127646d59d9da0f2a0289
> 20f%7C0%7C0%7C636989658871253899&sdata=US1sJn0ZqC77kiIlqdyzLEtz
> BZdfoo0MCLtG8jqw5w0%3D&reserved=0>
This email and the information contained herein is proprietary and confidential 
and subject to the Amdocs Email Terms of Service, which you may review at 
https://www.amdocs.com/about/email-terms-of-service 
<https://www.amdocs.com/about/email-terms-of-service>
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


[netmod] definition of "fully expanded YANG"

2019-07-17 Thread Michael Rehder
Has there ever been discussion about defining “fully expanded YANG”, that is a 
YANG module with all internal and external imports resolved?
This has several uses:
- Base for workable DIFF between versions so one can see all impacts of changes
   I see this as a pretty important part of semantic version management – if 
you can’t see the net result of changes in a properly modular YANG package, how 
can you be sure of the version meaning?
- Base for translation/processing of the schema
  There are all sorts other materials one can generate from a YANG (or a fully 
expanded YIN). If not expanded then this processing is very difficult.

Thanks
Mike
This email and the information contained herein is proprietary and confidential 
and subject to the Amdocs Email Terms of Service, which you may review at 
https://www.amdocs.com/about/email-terms-of-service 

___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] 6991bis: address-with-prefix-length

2019-04-01 Thread Michael Rehder
Yes, correct, my misremembering (I'm working also with JSONSchema which doesn't 
have that).

> -Original Message-
> From: Martin Bjorklund [mailto:m...@tail-f.com]
> Sent: Monday, April 1, 2019 2:04 PM
> To: Michael Rehder 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] 6991bis: address-with-prefix-length
> 
> Hi,
> 
> Michael Rehder  wrote:
> 
> [...]
> 
> > Note also that the ietf pattern regexp are not anchored so "
> > junk192.168.1.1"
> > and
> > "192.168.1.1   "
> > Are accepted.
> 
> No, this is not correct.  YANG uses the XSD "dialect" of regular expressions. 
>  In
> this dialect, all patterns are implicitly anchored.
> 
> 
> /martin
> 
> > I don't know why they are unanchored. This makes them unusable in my
> > view.
> >
> > As a result I've written my own regxp and a somewhat elaborate MUST
> > clause for canonical format check but a specific type would be better.
> > Another perspective is to ensure there is some way to avoid using MUST
> > to simply constrain type.
> > Has that ever been discussed?
> >
> > Thanks
> > Mike
> >
> > > -Original Message-
> > > 
> > > --
> > >
> > > Message: 1
> > > Date: Mon, 1 Apr 2019 16:38:34 +0200
> > > From: Kristian Larsson 
> > > To: netmod@ietf.org
> > > Subject: [netmod] 6991bis: address-with-prefix-length
> > > Message-ID: <10d3413c-df96-6e7d-df82-5542bb023...@spritelink.net>
> > > Content-Type: text/plain; charset=utf-8; format=flowed
> > >
> > > Hello,
> > >
> > > seeing that 6991 is up for a refresh I wonder if this would be the
> > > time to suggest the addition of a type for
> > > address-and-prefix-length, for example like 192.0.2.1/24?
> > >
> > > I find that it's the most natural way express the address and
> > > prefix-length to configure on an interface or for some other use. We
> > > currently have an ip-prefix type which allows CIDR style prefixes
> > > but since all bits to the right of the mask is to be 0 it is only
> > > possible to use for describing the IP prefix / network address
> > > itself - not the address of a host in that network.
> > >
> > > I actually wish the interface-ip modules would have used a combined
> > > leaf for these settings rather than the dual-leaf approach it
> > > currently has, but I suppose that ship has sailed :/
> > >
> > > Regardless, can we add such a type? Is this the document and time to
> > > do it? :)
> > >
> > > Kind regard,
> > > Kristian.
> > >
> > >
> > >
> > > --
> > >
> > > Message: 2
> > > Date: Mon, 1 Apr 2019 18:13:21 +0200
> > > From: Juergen Schoenwaelder 
> > > To: Kristian Larsson 
> > > Cc: 
> > > Subject: Re: [netmod] 6991bis: address-with-prefix-length
> > > Message-ID:
> > >   <20190401161321.seiodlfsmjjvj...@anna.jacobs.jacobs-university.de>
> > > Content-Type: text/plain; charset="us-ascii"
> > >
> > > This is the right time for this and I would call these
> > > ip-address-prefix, ipv4- address-prefix and ipv6-address prefix.
> > >
> > > /js
> > >
> > > On Mon, Apr 01, 2019 at 04:38:34PM +0200, Kristian Larsson wrote:
> > > > Hello,
> > > >
> > > > seeing that 6991 is up for a refresh I wonder if this would be the
> > > > time to suggest the addition of a type for
> > > > address-and-prefix-length, for example like 192.0.2.1/24?
> > > >
> > > > I find that it's the most natural way express the address and
> > > > prefix-length to configure on an interface or for some other use.
> > > > We currently have an ip-prefix type which allows CIDR style
> > > > prefixes but since all bits to the right of the mask is to be 0 it
> > > > is only possible to use for describing the IP prefix / network
> > > > address itself - not the address of a host in that network.
> > > >
> > > > I actually wish the interface-ip modules would have used a
> > > > combined leaf for these settings rather than the dual-leaf
> > > > approach it currently has, but I suppose that ship has sailed :/
> > > >
> > > > Regardless, can we add such a type?

Re: [netmod] 6991bis: address-with-prefix-length

2019-04-01 Thread Michael Rehder
Some systems require a "canonical" prefix, in that there cannot be bits past 
the mask length.
Like
  192.168.1.1/24
is not legal due to the ".1" for the last octet, which should be ".0".

The ietf-inet-types definition says this but does not enforce it.
Such enforcement exceeds regexp capability (as far as I know).
Note also that the ietf pattern regexp are not anchored so
" junk192.168.1.1"
and
"192.168.1.1   "
Are accepted. I don't know why they are unanchored. This makes them unusable in 
my view.

As a result I've written my own regxp and a somewhat elaborate MUST clause for 
canonical format check but a specific type would be better.
Another perspective is to ensure there is some way to avoid using MUST to 
simply constrain type.
Has that ever been discussed?

Thanks
Mike

> -Original Message-
> --
> 
> Message: 1
> Date: Mon, 1 Apr 2019 16:38:34 +0200
> From: Kristian Larsson 
> To: netmod@ietf.org
> Subject: [netmod] 6991bis: address-with-prefix-length
> Message-ID: <10d3413c-df96-6e7d-df82-5542bb023...@spritelink.net>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Hello,
> 
> seeing that 6991 is up for a refresh I wonder if this would be the time to
> suggest the addition of a type for address-and-prefix-length, for example like
> 192.0.2.1/24?
> 
> I find that it's the most natural way express the address and prefix-length to
> configure on an interface or for some other use. We currently have an 
> ip-prefix
> type which allows CIDR style prefixes but since all bits to the right of the 
> mask
> is to be 0 it is only possible to use for describing the IP prefix / network 
> address
> itself - not the address of a host in that network.
> 
> I actually wish the interface-ip modules would have used a combined leaf for
> these settings rather than the dual-leaf approach it currently has, but I 
> suppose
> that ship has sailed :/
> 
> Regardless, can we add such a type? Is this the document and time to do it? :)
> 
> Kind regard,
> Kristian.
> 
> 
> 
> --
> 
> Message: 2
> Date: Mon, 1 Apr 2019 18:13:21 +0200
> From: Juergen Schoenwaelder 
> To: Kristian Larsson 
> Cc: 
> Subject: Re: [netmod] 6991bis: address-with-prefix-length
> Message-ID:
>   <20190401161321.seiodlfsmjjvj...@anna.jacobs.jacobs-university.de>
> Content-Type: text/plain; charset="us-ascii"
> 
> This is the right time for this and I would call these ip-address-prefix, 
> ipv4-
> address-prefix and ipv6-address prefix.
> 
> /js
> 
> On Mon, Apr 01, 2019 at 04:38:34PM +0200, Kristian Larsson wrote:
> > Hello,
> >
> > seeing that 6991 is up for a refresh I wonder if this would be the
> > time to suggest the addition of a type for address-and-prefix-length,
> > for example like 192.0.2.1/24?
> >
> > I find that it's the most natural way express the address and
> > prefix-length to configure on an interface or for some other use. We
> > currently have an ip-prefix type which allows CIDR style prefixes but
> > since all bits to the right of the mask is to be 0 it is only possible
> > to use for describing the IP prefix / network address itself - not the
> > address of a host in that network.
> >
> > I actually wish the interface-ip modules would have used a combined
> > leaf for these settings rather than the dual-leaf approach it
> > currently has, but I suppose that ship has sailed :/
> >
> > Regardless, can we add such a type? Is this the document and time to do it?
> > :)
> >
> > Kind regard,
> >Kristian.
> >
> > ___
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> --
> Juergen Schoenwaelder   Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103 
> 
> 
> 
> --
> 
> Message: 3
> Date: Mon, 1 Apr 2019 16:31:12 +
> From: "Acee Lindem (acee)" 
> To: Juergen Schoenwaelder ,
>   "Kristian Larsson" 
> Cc: "netmod@ietf.org" 
> Subject: Re: [netmod] 6991bis: address-with-prefix-length
> Message-ID: 
> Content-Type: text/plain; charset="utf-8"
> 
> I believe the "address-" could be omitted from the type identifiers. At least
> within the routing area, "ipv4-prefix" is unambiguous.
> Thanks,
> Acee
> 
> ?On 4/1/19, 12:14 PM, "netmod on behalf of Juergen Schoenwaelder"
>  university.de> wrote:
> 
> This is the right time for this and I would call these
> ip-address-prefix, ipv4-address-prefix and ipv6-address
> prefix.
> 
> /js
> 
> On Mon, Apr 01, 2019 at 04:38:34PM +0200, Kristian Larsson wrote:
> > Hello,
> >
> > seeing that 6991 is up for a refresh I wonder if this would be the time 
> to
> > suggest the addition of a type for address-and-prefix-length, for 
> example
> > like 192.0.2.1/24?
> >
> > I find that

Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-17 Thread Michael Rehder
That's exactly my point - I think that the wording is unclear in the RFC, that 
"conditional" doesn't necessarily mean the mandatory status is ignored.

BTW a Schematron rule is emitted to ensure a "mandatory true" CHOICE has at 
least one CASE present, so there already is an "existential" check built.

I'll suggest a YANG enhancement on "yang-next" for the ability to respect 
mandatory status or not by a when statement.

Thanks
mike
> -Original Message-
> From: Ladislav Lhotka [mailto:lho...@nic.cz]
> Sent: Wednesday, October 17, 2018 4:43 AM
> To: Michael Rehder ; Juergen Schoenwaelder
> 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
> 
> Michael Rehder  writes:
> 
> > I've read rfc6110 and I didn't see any mention of "WHEN" on the
> > mandatory status (section 9.1.1 Optional and Mandatory Nodes doesn't
> > list it which seems a bit odd to me).
> 
> RFC 6110 was being prepared along with RFC 6020, and section 9.1.1 is closely
> related to sec. 3.1 in 6020.
> 
> > The section on "WHEN" just mentions the xpath mapping, not anything
> > about changing the mandatory status of the enclosing node.
> 
> If you take into account the DSDL validation procedure (Figure 2 in RFC
> 6110) then everything is IMO clear:
> 
> - Mandatory nodes (as defined in sec. 9.1.1) are not wrapped in
>and thus are required during RELAX NG schema
>   validation, no matter what any "when" expression says.
> 
> - Section 12.17 explains how when expressions are mapped to Schematron
>   asserts. This means that if an instance node exists in the data and a
>   when expression attached to the corresponding data node in YANG
>   evaluates to false, Schematron will report a failed assert.
> 
> - Note that Schematron cannot by definition report absence of an
>   instance based on the when expression attached to its data
>   node: Schematron rules are only fired for elements that are present in
>   the instance document.
> 
> >
> > I still think that the YANG RFC wording of "conditional" needs to indicate 
> > if the
> node is mandatory status is affected or not.
> > Note that rfc6060 "3.1 Mandatory Nodes" doesn't mention "WHEN" (it
> > does mention presence).
> 
> Perhaps this thread is just about misunderstanding of what "when" really
> means, which is: Instances for which the "when" expression evaluates to false
> must not be present.
> 
> It does NOT mean that instances for which the "when" expression evaluates to
> true must be present.
> 
> Lada
> 
> >
> > Thanks
> > Mike
> >> -Original Message-
> >> From: Juergen Schoenwaelder
> >> [mailto:j.schoenwael...@jacobs-university.de]
> >> Sent: Saturday, October 13, 2018 5:20 PM
> >> To: Michael Rehder 
> >> Cc: netmod@ietf.org
> >> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> >> ensure presence of the mandatory object
> >>
> >> On Fri, Oct 12, 2018 at 04:08:48PM +, Michael Rehder wrote:
> >>
> >> > The mandatory statement in that case is ignored (I’ve pointed out
> >> > the RNG and Schematron lack of enforcement).  WHEN trumps the
> >> > mandatory status (via explicit mandatory or implicit mandatory via
> >> > min-elements
> >> > 1)
> >>
> >> Has the RNG and Schematron been obtained following RFC 6110? If so,
> >> this may be a problem with RFC 6110 but not with YANG itself. There
> >> are validators that do not use RNG or Schematron.
> >>
> >> /js
> >>
> >> --
> >> Juergen Schoenwaelder   Jacobs University Bremen gGmbH
> >> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> >> Fax:   +49 421 200 3103 <https://www.jacobs-university.de/>
> > “Amdocs’ email platform is based on a third-party, worldwide, cloud-based
> system. Any emails sent to Amdocs will be processed and stored using such
> system and are accessible by third party providers of such system on a limited
> basis. Your sending of emails to Amdocs evidences your consent to the use of
> such system and such processing, storing and access”.
> > ___
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> --
> Ladislav Lhotka
> Head, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67
“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-16 Thread Michael Rehder
Ok, so it is there in the RFC, just somewhat separated (in my view) from the 
definition of “when”.

I still am somewhat surprised by this implementation.
Far more often the I see a need to enforce the presence of a variant.

Thanks
Mike

From: Robert Wilton [mailto:rwil...@cisco.com]
Sent: Tuesday, October 16, 2018 9:42 AM
To: Michael Rehder ; Juergen Schoenwaelder 

Cc: netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object


Hi Mike,

On 16/10/2018 14:26, Michael Rehder wrote:

I've read rfc6110 and I didn't see any mention of "WHEN" on the mandatory 
status (section 9.1.1 Optional and Mandatory Nodes doesn't list it which seems 
a bit odd to me).

The section on "WHEN" just mentions the xpath mapping, not anything about 
changing the mandatory status of the enclosing node.



I still think that the YANG RFC wording of "conditional" needs to indicate if 
the node is mandatory status is affected or not.

Note that rfc6060 "3.1 Mandatory Nodes" doesn't mention "WHEN" (it does mention 
presence).
By YANG RFC do you mean RFC 6020/7950?

Section 8.1 of RFC 7950 states the following constraints apply on valid data 
trees:

   o  There MUST be no nodes tagged with "when" present if the "when"

  condition evaluates to "false" in the data tree.



   o  The "mandatory" constraint is enforced for leafs and choices,

  unless the node or any of its ancestors has a "when" condition or

  "if-feature" expression that evaluates to "false".



   o  The "min-elements" and "max-elements" constraints are enforced for

  lists and leaf-lists, unless the node or any of its ancestors has

  a "when" condition or "if-feature" expression that evaluates to

  "false".



These rules indicate that "when" trumps "mandatory", "min-elements" and 
"max-elements".



Thanks,

Rob









Thanks

Mike

-Original Message-

From: Juergen Schoenwaelder [mailto:j.schoenwael...@jacobs-university.de]

Sent: Saturday, October 13, 2018 5:20 PM

To: Michael Rehder <mailto:michael.reh...@amdocs.com>

Cc: netmod@ietf.org<mailto:netmod@ietf.org>

Subject: Re: [netmod] WHEN statement within mandatory objects doesn't

ensure presence of the mandatory object



On Fri, Oct 12, 2018 at 04:08:48PM +, Michael Rehder wrote:



The mandatory statement in that case is ignored (I’ve pointed out the

RNG and Schematron lack of enforcement).  WHEN trumps the mandatory

status (via explicit mandatory or implicit mandatory via min-elements

1)



Has the RNG and Schematron been obtained following RFC 6110? If so, this may

be a problem with RFC 6110 but not with YANG itself. There are validators that

do not use RNG or Schematron.



/js



--

Juergen Schoenwaelder   Jacobs University Bremen gGmbH

Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany

Fax:   +49 421 200 3103 
<https://www.jacobs-university.de/><https://www.jacobs-university.de/>

“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.

___

netmod mailing list

netmod@ietf.org<mailto:netmod@ietf.org>

https://www.ietf.org/mailman/listinfo/netmod

“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-16 Thread Michael Rehder
I've read rfc6110 and I didn't see any mention of "WHEN" on the mandatory 
status (section 9.1.1 Optional and Mandatory Nodes doesn't list it which seems 
a bit odd to me).
The section on "WHEN" just mentions the xpath mapping, not anything about 
changing the mandatory status of the enclosing node.

I still think that the YANG RFC wording of "conditional" needs to indicate if 
the node is mandatory status is affected or not.
Note that rfc6060 "3.1 Mandatory Nodes" doesn't mention "WHEN" (it does mention 
presence).

Thanks
Mike
> -Original Message-
> From: Juergen Schoenwaelder [mailto:j.schoenwael...@jacobs-university.de]
> Sent: Saturday, October 13, 2018 5:20 PM
> To: Michael Rehder 
> Cc: netmod@ietf.org
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
> 
> On Fri, Oct 12, 2018 at 04:08:48PM +, Michael Rehder wrote:
> 
> > The mandatory statement in that case is ignored (I’ve pointed out the
> > RNG and Schematron lack of enforcement).  WHEN trumps the mandatory
> > status (via explicit mandatory or implicit mandatory via min-elements
> > 1)
> 
> Has the RNG and Schematron been obtained following RFC 6110? If so, this may
> be a problem with RFC 6110 but not with YANG itself. There are validators that
> do not use RNG or Schematron.
> 
> /js
> 
> --
> Juergen Schoenwaelder   Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103 <https://www.jacobs-university.de/>
“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-12 Thread Michael Rehder
I provided an example.
Requiring something to be present when a condition is to me a useful capability.
How else would you enforce in an optimal way that something is present under 
only certain conditions (define it on the controlled section, not use a zillion 
if-feature)?

Thanks
Mike

From: Robert Wilton [mailto:rwil...@cisco.com]
Sent: Friday, October 12, 2018 12:30 PM
To: Michael Rehder 
Cc: Andy Bierman ; Walker, Jason 
(jason_walk...@comcast.com) ; netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object


On 12/10/2018 17:08, Michael Rehder wrote:
The mandatory statement in that case is ignored (I’ve pointed out the RNG and 
Schematron lack of enforcement).
OK, I'm not familiar with RNG and Schematron.


WHEN trumps the mandatory status (via explicit mandatory or implicit mandatory 
via min-elements 1)
So I think that you are asking for mandatory to trump a when condition.  Can 
you provide a concrete example where this is required, or even useful?

A solution here, that doesn't require any changes in the YANG language, would 
be to just move the when condition, down to each of the child nodes that are 
not marked as mandatory.

But, sorry, at the moment I'm still at a loss to see how where this would 
actually be useful.

Thanks,
Rob



Thanks
Mike

From: Robert Wilton [mailto:rwil...@cisco.com]
Sent: Friday, October 12, 2018 12:06 PM
To: Michael Rehder <mailto:michael.reh...@amdocs.com>
Cc: Andy Bierman <mailto:a...@yumaworks.com>; Walker, Jason 
(jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>) 
<mailto:jason_walk...@comcast.com>; 
netmod@ietf.org<mailto:netmod@ietf.org>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object


Hi Mike,

On 11/10/2018 19:05, Andy Bierman wrote:


On Thu, Oct 11, 2018 at 11:00 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
I think the wording is relevant - something can be conditional but still 
required.
Yes, but I think that this is already expressed by a node that has both a when 
condition and mandatory statement.




container a {

  container x {

when "some condition";

leaf foo {

  mandatory true;

}

leaf bar {

  ...

}

  }

  container y {

leaf baz {

  mandatory true;

}

leaf tee {

  ...

}

  }

}



a/x/foo is conditional (due to when) but required (if the when condition is 
met).

a/x/bar is conditional (due to when) but optional (if the when condition is 
met).

a/y/baz is unconditional but required.

a/y/tee is unconditional but optional.




It should be clarified that elements become implicitly “mandatory false” when a 
“when” statement is used.
But they don't.




I would like to see an enhancement to YANG to control this behavior, to allow 
the mandatory status to be enforced.
That is, support also “conditionally required” instead of only the current 
“conditionally optional”.
I'm trying to understand what this would even mean.

Taking your original example, but with "enforce-mandatory-status":

 leaf AssignmentMechanism {

type enumeration {

  enum "DHCP";

  enum "Static";

}

mandatory true;

description "The address assignment mechanism.";

  }

  list IPAddresses {

when "../AssignmentMechanism = 'Static'" {

  enforce-mandatory-status;

}  key Address;

min-elements 1;



leaf Address {

  type capit:IPv4Address;

  description "An ipv4 address.";

}

   }

So this means that list IPaddresses must have at least one element regardless 
of whether the when condition holds.  I.e. no matter whether the assignment is 
DHCP or Static there must always be at least one 1 address configured.  But I 
don't understand what this actually means - it seems like a contradiction.  
What am I missing?  Please can you give a concrete example (in YANG) of what 
behaviour you are looking for.

Thanks,
Rob

“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.

“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-12 Thread Michael Rehder
The mandatory statement in that case is ignored (I’ve pointed out the RNG and 
Schematron lack of enforcement).
WHEN trumps the mandatory status (via explicit mandatory or implicit mandatory 
via min-elements 1)

Thanks
Mike

From: Robert Wilton [mailto:rwil...@cisco.com]
Sent: Friday, October 12, 2018 12:06 PM
To: Michael Rehder 
Cc: Andy Bierman ; Walker, Jason 
(jason_walk...@comcast.com) ; netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object


Hi Mike,

On 11/10/2018 19:05, Andy Bierman wrote:


On Thu, Oct 11, 2018 at 11:00 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
I think the wording is relevant - something can be conditional but still 
required.
Yes, but I think that this is already expressed by a node that has both a when 
condition and mandatory statement.



container a {

  container x {

when "some condition";

leaf foo {

  mandatory true;

}

leaf bar {

  ...

}

  }

  container y {

leaf baz {

  mandatory true;

}

leaf tee {

  ...

}

  }

}



a/x/foo is conditional (due to when) but required (if the when condition is 
met).

a/x/bar is conditional (due to when) but optional (if the when condition is 
met).

a/y/baz is unconditional but required.

a/y/tee is unconditional but optional.




It should be clarified that elements become implicitly “mandatory false” when a 
“when” statement is used.
But they don't.



I would like to see an enhancement to YANG to control this behavior, to allow 
the mandatory status to be enforced.
That is, support also “conditionally required” instead of only the current 
“conditionally optional”.
I'm trying to understand what this would even mean.

Taking your original example, but with "enforce-mandatory-status":

 leaf AssignmentMechanism {

type enumeration {

  enum "DHCP";

  enum "Static";

}

mandatory true;

description "The address assignment mechanism.";

  }

  list IPAddresses {

when "../AssignmentMechanism = 'Static'" {

  enforce-mandatory-status;

}  key Address;

min-elements 1;



leaf Address {

  type capit:IPv4Address;

  description "An ipv4 address.";

}

   }

So this means that list IPaddresses must have at least one element regardless 
of whether the when condition holds.  I.e. no matter whether the assignment is 
DHCP or Static there must always be at least one 1 address configured.  But I 
don't understand what this actually means - it seems like a contradiction.  
What am I missing?  Please can you give a concrete example (in YANG) of what 
behaviour you are looking for.

Thanks,
Rob
“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-12 Thread Michael Rehder
It depends what’s meant by “Conditional”. I think the term is distinct from 
“Optional”.

I don’t think the implementation can be changed (unless you meant that I change 
my own local implementation).

That’s why I think there should be a YANG language addition to control this 
behavior, since there are valid use cases for it.
Adding options to the WHEN statement seems a reasonable way to do this.

Thanks
Mike

From: Andy Bierman [mailto:a...@yumaworks.com]
Sent: Thursday, October 11, 2018 2:48 PM
To: Michael Rehder 
Cc: Juergen Schoenwaelder ; Walker, Jason 
(jason_walk...@comcast.com) ; netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object



On Thu, Oct 11, 2018 at 11:14 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
There is no specific text - the text just says it is “conditional”.
However the implementation forces it optional:

-  The RNG file makes it optional (I’m not actually running this for 
various reasons so I’m just interpreting the file generated – maybe I 
misunderstand RNG)

-  Schematron doesn’t check for its existence (like it does for a 
mandatory choice case)


So change the implementation so it conforms to the spec.


Thanks
Mike

Andy


From: Andy Bierman [mailto:a...@yumaworks.com<mailto:a...@yumaworks.com>]
Sent: Thursday, October 11, 2018 2:06 PM
To: Michael Rehder mailto:michael.reh...@amdocs.com>>
Cc: Juergen Schoenwaelder 
mailto:j.schoenwael...@jacobs-university.de>>;
 Walker, Jason (jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>) 
mailto:jason_walk...@comcast.com>>; 
netmod@ietf.org<mailto:netmod@ietf.org>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object



On Thu, Oct 11, 2018 at 11:00 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
I think the wording is relevant - something can be conditional but still 
required.
It should be clarified that elements become implicitly “mandatory false” when a 
“when” statement is used.

I would like to see an enhancement to YANG to control this behavior, to allow 
the mandatory status to be enforced.
That is, support also “conditionally required” instead of only the current 
“conditionally optional”.



  leaf foo {
 when "../some-other-node = 5";
 type int32;
 mandatory true;
 }


This leaf is mandatory if the when-expr is true.
Where is the text in 7950 that says this mandatory true is ignored if when-stmt 
is present?



Thanks
Mike

Andy



From: Andy Bierman [mailto:a...@yumaworks.com<mailto:a...@yumaworks.com>]
Sent: Wednesday, October 10, 2018 2:52 PM
To: Michael Rehder mailto:michael.reh...@amdocs.com>>
Cc: Juergen Schoenwaelder 
mailto:j.schoenwael...@jacobs-university.de>>;
 Walker, Jason (jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>) 
mailto:jason_walk...@comcast.com>>; 
netmod@ietf.org<mailto:netmod@ietf.org>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object



On Wed, Oct 10, 2018 at 11:44 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
Sure.

I think the RFC is unclear since it seems that the semantics are consistent in 
the back-end checks.
One can read the RFC and not notice by its absence that the when clause doesn't 
require anything to be present.

 The "when" statement makes its parent data definition statement 
conditional.
Should be
The "when" statement makes its parent data definition statement conditional 
and optional.

This is not correct.

Step 1) if-feature makes the schema node conditional

Step 2) when-stmt makes instances of the schema-node conditional

Step 3) YANG validation applies to instances of data nodes (or the YANG default 
value if applicable)

Step 2 is only relevant if Step 1 is true or non-existent
Step 3 is only relevant if Step 2 is true or non-existent

Andy


I think there should be a more definite statement about this overriding any 
mandatory status of the parent data definition statement.
Like
 "Any mandatory status of the parent data definition statement (mandatory 
statement, min-element statement etc.) is overridden by this statement and made 
non-mandatory."

That would have made the side-effect of "when" on other declarations clearer.

Thanks
mike
> -Original Message-
> From: Juergen Schoenwaelder 
> [mailto:j.schoenwael...@jacobs-university.de<mailto:j.schoenwael...@jacobs-university.de>]
> Sent: Wednesday, October 10, 2018 2:25 PM
> To: Michael Rehder 
> mailto:michael.reh...@amdocs.com>>
> Cc: Robert Wilton mailto:rwil...@cisco.com>>; Ladislav 
> Lhotka mailto:lho...@nic.cz>>;
> netmod@ietf.org<mailto:netmod@ietf.org>; Walker, Jason 
> (jason_walk...

Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-11 Thread Michael Rehder
There is no specific text - the text just says it is “conditional”.
However the implementation forces it optional:

-  The RNG file makes it optional (I’m not actually running this for 
various reasons so I’m just interpreting the file generated – maybe I 
misunderstand RNG)

-  Schematron doesn’t check for its existence (like it does for a 
mandatory choice case)

Thanks
Mike

From: Andy Bierman [mailto:a...@yumaworks.com]
Sent: Thursday, October 11, 2018 2:06 PM
To: Michael Rehder 
Cc: Juergen Schoenwaelder ; Walker, Jason 
(jason_walk...@comcast.com) ; netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object



On Thu, Oct 11, 2018 at 11:00 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
I think the wording is relevant - something can be conditional but still 
required.
It should be clarified that elements become implicitly “mandatory false” when a 
“when” statement is used.

I would like to see an enhancement to YANG to control this behavior, to allow 
the mandatory status to be enforced.
That is, support also “conditionally required” instead of only the current 
“conditionally optional”.



  leaf foo {
 when "../some-other-node = 5";
 type int32;
 mandatory true;
 }


This leaf is mandatory if the when-expr is true.
Where is the text in 7950 that says this mandatory true is ignored if when-stmt 
is present?



Thanks
Mike

Andy



From: Andy Bierman [mailto:a...@yumaworks.com<mailto:a...@yumaworks.com>]
Sent: Wednesday, October 10, 2018 2:52 PM
To: Michael Rehder mailto:michael.reh...@amdocs.com>>
Cc: Juergen Schoenwaelder 
mailto:j.schoenwael...@jacobs-university.de>>;
 Walker, Jason (jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>) 
mailto:jason_walk...@comcast.com>>; 
netmod@ietf.org<mailto:netmod@ietf.org>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object



On Wed, Oct 10, 2018 at 11:44 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
Sure.

I think the RFC is unclear since it seems that the semantics are consistent in 
the back-end checks.
One can read the RFC and not notice by its absence that the when clause doesn't 
require anything to be present.

 The "when" statement makes its parent data definition statement 
conditional.
Should be
The "when" statement makes its parent data definition statement conditional 
and optional.

This is not correct.

Step 1) if-feature makes the schema node conditional

Step 2) when-stmt makes instances of the schema-node conditional

Step 3) YANG validation applies to instances of data nodes (or the YANG default 
value if applicable)

Step 2 is only relevant if Step 1 is true or non-existent
Step 3 is only relevant if Step 2 is true or non-existent

Andy


I think there should be a more definite statement about this overriding any 
mandatory status of the parent data definition statement.
Like
 "Any mandatory status of the parent data definition statement (mandatory 
statement, min-element statement etc.) is overridden by this statement and made 
non-mandatory."

That would have made the side-effect of "when" on other declarations clearer.

Thanks
mike
> -Original Message-
> From: Juergen Schoenwaelder 
> [mailto:j.schoenwael...@jacobs-university.de<mailto:j.schoenwael...@jacobs-university.de>]
> Sent: Wednesday, October 10, 2018 2:25 PM
> To: Michael Rehder 
> mailto:michael.reh...@amdocs.com>>
> Cc: Robert Wilton mailto:rwil...@cisco.com>>; Ladislav 
> Lhotka mailto:lho...@nic.cz>>;
> netmod@ietf.org<mailto:netmod@ietf.org>; Walker, Jason 
> (jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>)
> mailto:jason_walk...@comcast.com>>
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
>
> Michael,
>
> what matters here is what the YANG specification (RFC 7950) says. Is there a
> reason to believe the IPAddresses list in your example can be absent or have 
> no
> elements based on what RFC 7950 says? Or do we talk about a shortcoming of
> RFC 6110?
>
> /js
>
> On Wed, Oct 10, 2018 at 06:17:26PM +, Michael Rehder wrote:
> > If the list has a "when" clause the RNG file actually produces a "OneOrMore"
> which has a choice of  or the list so it actually doesn't enforce the
> presence at least one row of the list (unless I'm mistaken in my reading).
> >   
> > 
> >   
> >   
> > 
> >   
> > 
> > 
> >   

Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-11 Thread Michael Rehder
I think the wording is relevant - something can be conditional but still 
required.
It should be clarified that elements become implicitly “mandatory false” when a 
“when” statement is used.

I would like to see an enhancement to YANG to control this behavior, to allow 
the mandatory status to be enforced.
That is, support also “conditionally required” instead of only the current 
“conditionally optional”.

Thanks
Mike

From: Andy Bierman [mailto:a...@yumaworks.com]
Sent: Wednesday, October 10, 2018 2:52 PM
To: Michael Rehder 
Cc: Juergen Schoenwaelder ; Walker, Jason 
(jason_walk...@comcast.com) ; netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure 
presence of the mandatory object



On Wed, Oct 10, 2018 at 11:44 AM, Michael Rehder 
mailto:michael.reh...@amdocs.com>> wrote:
Sure.

I think the RFC is unclear since it seems that the semantics are consistent in 
the back-end checks.
One can read the RFC and not notice by its absence that the when clause doesn't 
require anything to be present.

 The "when" statement makes its parent data definition statement 
conditional.
Should be
The "when" statement makes its parent data definition statement conditional 
and optional.

This is not correct.

Step 1) if-feature makes the schema node conditional

Step 2) when-stmt makes instances of the schema-node conditional

Step 3) YANG validation applies to instances of data nodes (or the YANG default 
value if applicable)

Step 2 is only relevant if Step 1 is true or non-existent
Step 3 is only relevant if Step 2 is true or non-existent

Andy


I think there should be a more definite statement about this overriding any 
mandatory status of the parent data definition statement.
Like
 "Any mandatory status of the parent data definition statement (mandatory 
statement, min-element statement etc.) is overridden by this statement and made 
non-mandatory."

That would have made the side-effect of "when" on other declarations clearer.

Thanks
mike
> -Original Message-
> From: Juergen Schoenwaelder 
> [mailto:j.schoenwael...@jacobs-university.de<mailto:j.schoenwael...@jacobs-university.de>]
> Sent: Wednesday, October 10, 2018 2:25 PM
> To: Michael Rehder 
> mailto:michael.reh...@amdocs.com>>
> Cc: Robert Wilton mailto:rwil...@cisco.com>>; Ladislav 
> Lhotka mailto:lho...@nic.cz>>;
> netmod@ietf.org<mailto:netmod@ietf.org>; Walker, Jason 
> (jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>)
> mailto:jason_walk...@comcast.com>>
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
>
> Michael,
>
> what matters here is what the YANG specification (RFC 7950) says. Is there a
> reason to believe the IPAddresses list in your example can be absent or have 
> no
> elements based on what RFC 7950 says? Or do we talk about a shortcoming of
> RFC 6110?
>
> /js
>
> On Wed, Oct 10, 2018 at 06:17:26PM +, Michael Rehder wrote:
> > If the list has a "when" clause the RNG file actually produces a "OneOrMore"
> which has a choice of  or the list so it actually doesn't enforce the
> presence at least one row of the list (unless I'm mistaken in my reading).
> >   
> > 
> >   
> >   
> > 
> >   
> > 
> > 
> >   
> > 
> >   
> >
> > A leaf/container would be a simpler example but would result in the same
> lack of enforcement of the mandatory status of an element with a "when"
> clause.
> >
> > This RNG seems consistent with the Schematron rules that "when" makes
> something optional.
> >
> >
> > I think a workaround would be choice with mandatory true and a when clause
> on the cases. This would ensure that at least one case is present since the
> mandatory clause implements a Schematron existence constraint.
> >
> > Thanks
> > Mike
> > > -Original Message-
> > > From: Robert Wilton [mailto:rwil...@cisco.com<mailto:rwil...@cisco.com>]
> > > Sent: Wednesday, October 10, 2018 11:33 AM
> > > To: Michael Rehder 
> > > mailto:michael.reh...@amdocs.com>>; Ladislav 
> > > Lhotka
> > > mailto:lho...@nic.cz>>; 
> > > netmod@ietf.org<mailto:netmod@ietf.org>
> > > Cc: Walker, Jason 
> > > (jason_walk...@comcast.com<mailto:jason_walk...@comcast.com>)
> > > mailto:jason_walk...@comcast.com>>
> > > Subject: Re: [netmod

Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-10 Thread Michael Rehder
Sure.

I think the RFC is unclear since it seems that the semantics are consistent in 
the back-end checks.
One can read the RFC and not notice by its absence that the when clause doesn't 
require anything to be present.

 The "when" statement makes its parent data definition statement 
conditional.
Should be
The "when" statement makes its parent data definition statement conditional 
and optional.

I think there should be a more definite statement about this overriding any 
mandatory status of the parent data definition statement.
Like
 "Any mandatory status of the parent data definition statement (mandatory 
statement, min-element statement etc.) is overridden by this statement and made 
non-mandatory."

That would have made the side-effect of "when" on other declarations clearer.

Thanks
mike
> -Original Message-
> From: Juergen Schoenwaelder [mailto:j.schoenwael...@jacobs-university.de]
> Sent: Wednesday, October 10, 2018 2:25 PM
> To: Michael Rehder 
> Cc: Robert Wilton ; Ladislav Lhotka ;
> netmod@ietf.org; Walker, Jason (jason_walk...@comcast.com)
> 
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
> 
> Michael,
> 
> what matters here is what the YANG specification (RFC 7950) says. Is there a
> reason to believe the IPAddresses list in your example can be absent or have 
> no
> elements based on what RFC 7950 says? Or do we talk about a shortcoming of
> RFC 6110?
> 
> /js
> 
> On Wed, Oct 10, 2018 at 06:17:26PM +, Michael Rehder wrote:
> > If the list has a "when" clause the RNG file actually produces a "OneOrMore"
> which has a choice of  or the list so it actually doesn't enforce the
> presence at least one row of the list (unless I'm mistaken in my reading).
> >   
> > 
> >   
> >   
> > 
> >   
> > 
> > 
> >   
> > 
> >   
> >
> > A leaf/container would be a simpler example but would result in the same
> lack of enforcement of the mandatory status of an element with a "when"
> clause.
> >
> > This RNG seems consistent with the Schematron rules that "when" makes
> something optional.
> >
> >
> > I think a workaround would be choice with mandatory true and a when clause
> on the cases. This would ensure that at least one case is present since the
> mandatory clause implements a Schematron existence constraint.
> >
> > Thanks
> > Mike
> > > -Original Message-
> > > From: Robert Wilton [mailto:rwil...@cisco.com]
> > > Sent: Wednesday, October 10, 2018 11:33 AM
> > > To: Michael Rehder ; Ladislav Lhotka
> > > ; netmod@ietf.org
> > > Cc: Walker, Jason (jason_walk...@comcast.com)
> > > 
> > > Subject: Re: [netmod] WHEN statement within mandatory objects
> > > doesn't ensure presence of the mandatory object
> > >
> > > Hi Mike,
> > >
> > > I think that the YANG below already enforces what you want, or
> > > otherwise I don't follow your issue.
> > >
> > > The YANG below is valid in two cases:
> > >
> > > (1) AssignmentMechanism = DHCP, and IPAddresses is not present in
> > > the config (due to the when statement).
> > > (2) AssignmentMechanism = Static, IPAddresses exists and has at
> > > least one element (due to min-elements 1).
> > >
> > > Thanks,
> > > Rob
> > >
> > >
> > > On 10/10/2018 16:23, Michael Rehder wrote:
> > > > Container "foo" would be mandatory if not for the "when" child element.
> > > > With the "when" child element, the logic becomes "inverted" and
> > > > the
> > > constraint is a negative one of "disallowed under certain condition".
> > > >
> > > > The UC is for enforcement in REST API payloads.
> > > > For a practical example:
> > > >
> > > >   leaf AssignmentMechanism {
> > > >  type enumeration {
> > > >enum "DHCP";
> > > >enum "Static";
> > > >  }
> > > >  mandatory true;
> > > >  description "The address assignment mechanism.";
> > > >}
> > > >lis

Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-10 Thread Michael Rehder
If the list has a "when" clause the RNG file actually produces a "OneOrMore" 
which has a choice of  or the list so it actually doesn't enforce the 
presence at least one row of the list (unless I'm mistaken in my reading).
  

  
  

  


  

  

A leaf/container would be a simpler example but would result in the same lack 
of enforcement of the mandatory status of an element with a "when" clause.

This RNG seems consistent with the Schematron rules that "when" makes something 
optional.


I think a workaround would be choice with mandatory true and a when clause on 
the cases. This would ensure that at least one case is present since the 
mandatory clause implements a Schematron existence constraint.

Thanks
Mike
> -Original Message-
> From: Robert Wilton [mailto:rwil...@cisco.com]
> Sent: Wednesday, October 10, 2018 11:33 AM
> To: Michael Rehder ; Ladislav Lhotka
> ; netmod@ietf.org
> Cc: Walker, Jason (jason_walk...@comcast.com)
> 
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
> 
> Hi Mike,
> 
> I think that the YANG below already enforces what you want, or otherwise I
> don't follow your issue.
> 
> The YANG below is valid in two cases:
> 
> (1) AssignmentMechanism = DHCP, and IPAddresses is not present in the config
> (due to the when statement).
> (2) AssignmentMechanism = Static, IPAddresses exists and has at least one
> element (due to min-elements 1).
> 
> Thanks,
> Rob
> 
> 
> On 10/10/2018 16:23, Michael Rehder wrote:
> > Container "foo" would be mandatory if not for the "when" child element.
> > With the "when" child element, the logic becomes "inverted" and the
> constraint is a negative one of "disallowed under certain condition".
> >
> > The UC is for enforcement in REST API payloads.
> > For a practical example:
> >
> >   leaf AssignmentMechanism {
> >  type enumeration {
> >enum "DHCP";
> >enum "Static";
> >  }
> >  mandatory true;
> >  description "The address assignment mechanism.";
> >}
> >list IPAddresses {
> >  when "../AssignmentMechanism = 'Static'";
> >  key Address;
> >  min-elements 1;
> >
> >  leaf Address {
> >type capit:IPv4Address;
> >description "An ipv4 address.";
> >  }
> > }
> >
> > There is no way in the IPAddresses list to enforce that there is at least 
> > one IP
> Address when the assignment method is "Static".
> > One could put a "must" on "AssignmentMechanism" to ensure at least one
> element of the IPAddresses list when "Static", but I don't see this as a good
> schema design, to have the controlling attribute check controlled attributes.
> >
> > I appreciate that this semantic can't be changed in YANG at this point.
> > Could the "when" statement have a modifying child element to state that the
> mandatory status of the element is to be enforced?
> > Like
> >  container foo {
> >when "condition" {
> >enforce-mandatory-status;
> >    }
> >
> > There is already back-end for existential checks for mandatory choice so 
> > this
> seems reasonably consistent to me.
> > I appreciate there are existing issues for "when" but I don't see why this
> would make things any worse.
> > In fact by promoting a better dependency "direction" between schema
> elements,  think it could simplify things (so I naively think :) ).
> >
> > Thanks
> > Mike
> >> -Original Message-
> >> From: Ladislav Lhotka [mailto:lho...@nic.cz]
> >> Sent: Wednesday, October 10, 2018 10:28 AM
> >> To: Michael Rehder ; netmod@ietf.org
> >> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> >> ensure presence of the mandatory object
> >>
> >> Michael Rehder  writes:
> >>
> >>> I have a question about “when” and mandatory objects.
> >>>
> >>> It seems to me that the implemented semantics of “when” are really
> >> “optional whe

Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-10 Thread Michael Rehder
Container "foo" would be mandatory if not for the "when" child element.  
With the "when" child element, the logic becomes "inverted" and the constraint 
is a negative one of "disallowed under certain condition".

The UC is for enforcement in REST API payloads. 
For a practical example:

 leaf AssignmentMechanism {
type enumeration {
  enum "DHCP";
  enum "Static";
}
mandatory true;
description "The address assignment mechanism.";
  }
  list IPAddresses {
when "../AssignmentMechanism = 'Static'";
key Address;
min-elements 1;

leaf Address {
  type capit:IPv4Address;
  description "An ipv4 address.";
}
   }

There is no way in the IPAddresses list to enforce that there is at least one 
IP Address when the assignment method is "Static".
One could put a "must" on "AssignmentMechanism" to ensure at least one element 
of the IPAddresses list when "Static", but I don't see this as a good schema 
design, to have the controlling attribute check controlled attributes.

I appreciate that this semantic can't be changed in YANG at this point.
Could the "when" statement have a modifying child element to state that the 
mandatory status of the element is to be enforced?
Like
container foo {
  when "condition" {
  enforce-mandatory-status;
  }

There is already back-end for existential checks for mandatory choice so this 
seems reasonably consistent to me.
I appreciate there are existing issues for "when" but I don't see why this 
would make things any worse.
In fact by promoting a better dependency "direction" between schema elements,  
think it could simplify things (so I naively think :) ).

Thanks
Mike
> -Original Message-
> From: Ladislav Lhotka [mailto:lho...@nic.cz]
> Sent: Wednesday, October 10, 2018 10:28 AM
> To: Michael Rehder ; netmod@ietf.org
> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
> ensure presence of the mandatory object
> 
> Michael Rehder  writes:
> 
> > I have a question about “when” and mandatory objects.
> >
> > It seems to me that the implemented semantics of “when” are really
> “optional when”, in that the enclosing object can be absent even though it is
> mandatory and the “when” clause holds true.
> > The RFC could be clearer about this.
> >
> > Example
> >
> >leaf color {
> >  enumeration  {
> > enum “blue”;
> > enum “black”;
> >  }
> >  mandatory true;
> >}
> >container foo {
> >   when ../color = ‘blue’;
> >   etc.
> >}
> >
> > “foo” is optional due to the presence of the “when” statement even
> > though the object is mandatory (same is true for mandatory leaf,
> > min-elements=1 list etc.).
> 
> Maybe you intended to have, e.g., a "mandatory true" leaf inside "container
> foo"?
> 
> > This is considered valid XML for the above
> > blue
> 
> Yes, it is, under current YANG rules, no matter what "etc." stands for. Note 
> that
> evaluation of the XPath expression in this case (with "foo" missing) requires 
> the
> peculiar procedure of sec. 7.21.5 in RFC 7950.
> 
> >
> > In my view this makes conditionally variant schemas “loose” in their
> > enforcement (some scenarios can use choice but it doesn’t cover
> > everything).
> >
> > I think that mandatory should be respected for the enclosing objects
> > of a “when” statement.  That is, a mandatory object must be present
> > when its “when” clause holds true and a Schematron statement should
> > enforce that.
> 
> In fact, this is one case where the DSDL mapping (RFC 6110) deviates from
> YANG 1.0. Nodes that mandatory aren't enclosed in the RELAX NG 
> pattern, and are then required no matter what any "when"
> statements say (because RELAX NG validation comes before Schematron).
> 
> >
> > What is the rationale behind the current YANG rules behavior, that the
> > “when” Schematron mapping doesn’t check for presence of the enclosing
> > mandatory object?
> 
> FWIW, I have been repeatedly protesting against this behaviour but without
> much luck. See for example
> 
> https://www.ietf.org/mail-archive/web/netmod/current/msg14012.html
> 
> As a result, "when" is the trickiest feature in YANG by far.
> 
> Lada
> 
> >
> > thanks
> > Mike Rehder
> 
> --
> Ladislav Lhotka
> Head, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67
“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod


[netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

2018-10-09 Thread Michael Rehder
I have a question about “when” and mandatory objects.

It seems to me that the implemented semantics of “when” are really “optional 
when”, in that the enclosing object can be absent even though it is mandatory 
and the “when” clause holds true.
The RFC could be clearer about this.

Example

   leaf color {
 enumeration  {
enum “blue”;
enum “black”;
 }
 mandatory true;
   }
   container foo {
  when ../color = ‘blue’;
  etc.
   }

“foo” is optional due to the presence of the “when” statement even though the 
object is mandatory (same is true for mandatory leaf, min-elements=1 list etc.).
This is considered valid XML for the above
blue

In my view this makes conditionally variant schemas “loose” in their 
enforcement (some scenarios can use choice but it doesn’t cover everything).

I think that mandatory should be respected for the enclosing objects of a 
“when” statement.
That is, a mandatory object must be present when its “when” clause holds true 
and a Schematron statement should enforce that.

What is the rationale behind the current YANG rules behavior, that the “when” 
Schematron mapping doesn’t check for presence of the enclosing mandatory object?

thanks
Mike Rehder

“Amdocs’ email platform is based on a third-party, worldwide, cloud-based 
system. Any emails sent to Amdocs will be processed and stored using such 
system and are accessible by third party providers of such system on a limited 
basis. Your sending of emails to Amdocs evidences your consent to the use of 
such system and such processing, storing and access”.
___
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod