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

gNMI and ordered lists/leaf-lists #200

Closed hellt closed 8 months ago

hellt commented 9 months ago

Hi all, Does gNMI have mechanisms to

  1. update "ordered-by user" lists/leaf-lists within a Set Request using a specific user-provided order?
  2. stream notifications when the change of order is made for an user-ordered list/leaf-list?

/cc @robshakir @dplore

robshakir commented 8 months ago

Hi Roman,

Today, for setting an ordered-by user list -- then if one sets the entire list, the order supplied is assumed to be the order that is intended by the user. This rule is defined in (RFC7951 section 5.4)[https://datatracker.ietf.org/doc/html/rfc7951#section-5.4]. I believe that this was also the logic for encoding a list as a JSON array not a map, since this allowed order to be preserved.

For streaming notifications -- when ordered-by user is set, then the only way that the order can be preserved is to have a list become an atomic item in telemetry, since <timestamp, path, value> streaming has no defined order between elements.

Cheers, r.

hellt commented 8 months ago

Thanks @robshakir