openconfig / reference

This repository contains reference implementations, specifications and tooling related to OpenConfig-based network management.
Apache License 2.0
155 stars 88 forks source link

Path Element: What if a key's value is an identityref or instance-identifier? #108

Open andaru opened 5 years ago

andaru commented 5 years ago

The YANG types identityref and instance-identifier are represented differently in the IETF JSON (RFC7951) and XML (RFC6020) encodings.

Values of these types can also be the value in a constraint, e.g., using the RFC7951 JSON encoding, I believe you would have something like (as an XPath expression):

/bgp/global/afi-safis/afi-safi[afi-safi-name="openconfig-bgp-types:IPV4_UNICAST"]

Does the gNMI Path specification cover how these values should be encoded in a gRPC path (element)? I could not find that.

So, should identity values ever be used in qualified form in a gNMI path expression?

RFC7951 (https://tools.ietf.org/html/rfc7951#section-6.8) says:

   If the identity is defined in a module other than the leaf
   node containing the identityref value, the namespace-qualified form
   (Section 4) MUST be used.  Otherwise, both the simple and namespace-
   qualified forms are permitted.