Subject: [netmod] undecided Y22 support constraints on unions

From: Juergen Schoenwaelder <[email-masked]>
Date: Mon, 2 Jun 2014 10:19:15 +0200

We need to decide whether this is in scope of YANG 1.1 or not.

It remains somewhat unclear what exactly the problem is that this
is supposed to solve.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

---

From: Andy Bierman <[email-masked]>
Date: Mon, 2 Jun 2014 09:01:18 -0700

> It remains somewhat unclear what exactly the problem is that this
It seems to suggest that individual type-stmts within a union type-stmt
should be conditional, based on an XPath expression.

  It may be useful to support constraints for union type.  For
  example, a server can be defined as union of
  domain-name/ip-addresss.  However, domain-name should only be
  allowed when a dns-server exists.

   #+BEGIN_EXAMPLE
    leaf foo {
      type union {
        type uint32;
        type union {
          type enumeration {
            enum bar;
          }
          type string;
        }
      }
    }
    #+END_EXAMPLE

   If foo has value "hi mom", base-type(foo) returns "string".

   Unfortunately, this won't work for the example use case, since both
   domain-name and ip-address are strings.

The example is about 'foo' so I don't understand the reference to the other
leafs.
I understand that the tool implementation needs to know the type-stmt that
actually matched in a union, but that is just an internal
implementation detail.  Not sure what "base-type(foo) returns string" means
or why this would need to be exposed in the language.

The type-stmts within a union need to be static, not changing based
on some boolean expression. This issue should be rejected.

/js
Andy

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
>

---

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 03 Jun 2014 14:47:31 +0200

> on some boolean expression. This issue should be rejected.

I agree.

Maybe it would be useful to define an attribute allowing the sender to specify which of the union alternatives is actually used, i.e.

<host type="inet:ipv4-address">1.2.3.4</host>

Lada

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Tue, 10 Jun 2014 21:20:36 +0200

> It remains somewhat unclear what exactly the problem is that this

Interim proposal:

  Proposal: Reject the issue and add a new issue that a clarification
  is needed about the nature of unions and that they primarily are
  needed for validation.

If you disagree, please speak up by June 18th.

/js