Subject: [netmod] object-identifier data type

From: Andy Bierman <[email-masked]>
Date: Fri, 05 Sep 2008 08:47:29 -0700

Hi,

I think YANG needs one more built-in type, called object-identifier.
It is just like instance-identifier, except no predicates ([key='value'])
can be present.

Sometimes you really want the leaf the indicate an
object node in the conceptual tree (e.g. ACM),
and not any particular instance.  There is no easy
way to auto-validate object-identifier, like there is for
instance-identifier. The compiler does not
automatically know the string is an absolute XPath
expression, which must match some real path in the
internal configuration database target.
Just change 'string' to 'object-identifier', and
that problem goes away.

I also prefer not to overload instance-identifier.
It should always refer to 1 particular instance
of an object.  That way, the compiler can check
that the instance is specified correctly.

A 3rd category, the XPath <get*> filter expression,
may need its own data type as well.

Andy

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

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 08 Sep 2008 09:38:15 +0200 (CEST)

> It is just like instance-identifier, except no predicates ([key='value'])

I think the name "object-identifier" can be confusing, since people
might think we mean "OBJECT IDENTIFIER" or maybe think that
"object-identifier" is YANG's version of "OBJECT IDENTIFIER".

In the current spec we call this "schema node identifier".

> object node in the conceptual tree (e.g. ACM),

Can you provide a use case for this?

/martin

---

From: Andy Bierman <[email-masked]>
Date: Mon, 08 Sep 2008 07:50:56 -0700

> "object-identifier" is YANG's version of "OBJECT IDENTIFIER".

How about 'node-identifier'?

> Can you provide a use case for this?

This is all the text there is in the draft:

    The instance-identifier built-in type is used to uniquely identify a
    particular instance node in the data tree.

    The syntax for an instance-identifier is a subset of the XPath
    syntax, which is used to uniquely identify a node in the data tree.
    It is an absolute XPath location path in abbreviated syntax, where
    axes are not permitted, and predicates are used only for specifying
    the values for the key nodes for list entries, or a value of a leaf-
    list.  Each predicate consists of one equality test per key.  Each
    key MUST have a corresponding predicate.

An instance-identifier can represent exactly 1 instance.
It is very constrained.  There is no data type that
can be used to represent any instance or N instances, of a an object.

An example might be an object within an access control table
that is used to limit access to all or some instances of a particular
object.

Another example would be a 'safe' implementation of the partial
lock draft.  Currently, the 'select' element is just a string,
and can represent any arbitrary XPath expression.   IMO,
it would be much better to restrict the partial lock
select statement to a node-identifier
(0 to N partial or full instance identifiers).

There is also no indication to the compiler that 'select' has some
structure beyond 'string'.  YANG has 10 different forms of
numbers, yet no help whatsoever for this rather complex
aspect of YANG data modeling.  If a user enters -17 wrong,
the YANG compiler is all over it, but when it comes
to complex XPath expressions, 'string' is good enough.
No help needed here.  Seems rather inconsistent to me.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 08 Sep 2008 17:00:09 +0200 (CEST)

> can be used to represent any instance or N instances, of a an object.

So maybe I don't understand how your 'node-identifier' would work.

>> object node in the conceptual tree (e.g. ACM),

When you say "conceptual tree" do tou mean the "data tree" or "schema
tree", as defined in the YANG draft?

> (0 to N partial or full instance identifiers).

But you also said that the node-identifier would have no predicates.
Here I think you're talking about an instance-identifier with
"wildcards". 

> No help needed here.  Seems rather inconsistent to me.

I agree.  I just don't understand your proposal.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Mon, 08 Sep 2008 08:05:22 -0700

> I agree.  I just don't understand your proposal.

I think YANG needs an unconstrained instance-identifier data type.
That means it is just like instance-identifier, but with 1 word changed.

Last sentence: instance-identifier:

    Each key MUST have a corresponding predicate.

Last sentence: node-identifier:

   Each key MAY have a corresponding predicate.

Andy

---

From: Balazs Lengyel <[email-masked]>
Date: Tue, 09 Sep 2008 11:54:25 +0200

Hello,
Do you want to point out a node in the schema-tree or do you want a kind of wildcard that 
points out all elements of a list in the data-tree (or a leaf in all list elements etc.)?
Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
TSP System Manager
ECN: 831 7320                        Fax: +36 1 4377792
Tel: +36-1-437-7320     email: [email-masked]
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Andy Bierman <[email-masked]>
Date: Tue, 09 Sep 2008 08:02:38 -0700

Balazs Lengyel wrote:
> Hello,
> Do you want to point out a node in the schema-tree or do you want a kind 
> of wildcard that points out all elements of a list in the data-tree (or 
> a leaf in all list elements etc.)?

I think the latter.  The entire usage of XPath within YANG
needs more thought.  Maybe a generic 'xpath-string' for
'select' type of nodes is more useful and simpler.

I am looking at the keyref data type and its path statement
again.  I still cannot understand why the example shown in 8.8.4
is of any relevance to real data models.  Is the 'mgmt-interface'
object supposed to be more config?  Are there any real-world
data models that use this sort of construct?

The examples that actually make sense to me are well-documented:
   - foreign key  (no usage example)
   - notification by-reference content (4.2.10 example needs work)

It seems to me that 'keyref' is YANG's version of the SMIv2 Counter64.
Instead of the useful, robust, complete approach -- i.e., define
Unsigned64 and Signed64 data types -- SMIv2 defined only an esoteric,
derived data type (Counter64) instead.  As a result,
64 bit numbers have been a nightmare in SNMP ever since.

I do not understand why the keyref and instance-identifier
data types (specialized derived data types) are present in
YANG, but not a generic data node pointer (ala OBJECT IDENTIFIER
in SMIv2).

BTW, the ABNF for 'path-key-expr' still lists 'this-variable-keyword'.
It should be changed to 'current-function-invocation' or something
like that.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 09 Sep 2008 23:31:16 +0200 (CEST)

> data models that use this sort of construct?

Do you mean keyref in general?  For an example of how keyrefs are
used, see
http://www.yang-central.org/twiki/bin/view/Main/YangExamplesExecdNtp.

>    - notification by-reference content (4.2.10 example needs work)

Ok.  In 4.2.10, do you mean remove the if-index and send e.g. the
if-admin-status?

> YANG, but not a generic data node pointer (ala OBJECT IDENTIFIER

instance-identifier *is* a generic data node pointer.  It can point to
any node in the data tree:

  /interfaces/interafce[name="eth0"]/mtu
  /interfaces/interafce[name="eth0"]
  /interfaces

are all valid instance-identifiers.  What do think is missing?

> It should be changed to 'current-function-invocation' or something

Fixed, thanks.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Tue, 09 Sep 2008 18:13:59 -0700

> http://www.yang-central.org/twiki/bin/view/Main/YangExamplesExecdNtp.

not sure what I'm supposed to notice there

> Ok.  In 4.2.10, do you mean remove the if-index and send e.g. the

both should be external reference, but YANG does
not have a leafref, so the if-index is a cut-and-paste clone.
The example says to me "Why bother with keyref, if cut-and-paste
is supposedly good enough for non-key leafs".

> are all valid instance-identifiers.  What do think is missing?

object identifier:  /interfaces/interface/mtu

Andy