openconfig / gnmi

gRPC Network Management Interface
Apache License 2.0
459 stars 196 forks source link

Remove ellipsis (...) wildcarding #163

Open ccole-juniper opened 8 months ago

ccole-juniper commented 8 months ago

Proposal: Remove ellipsis (...) wildcarding from the spec.

If there are any users of the feature I'd be interested in the use cases.

If the sense of the community is in agreement I'll make a pull request.

Context from @gcsl (1 Jun 2022):

"In our collection infrastructure we support gnmi path '*' wildcards on the client side. Generally on the device side, we subscribe to top-level models or an intermediate branch. The wildcard would be necessary if we intended to filter a given model to a specific set of leaves only. I am not aware of any '...' wildcard use anywhere. I had argued it was inefficient to implement and offered limited utility. I had proposed removing it from the spec on a few occasions and I think this would be one of the useful deletions prior to a gnmi 1.0 declaration."

abtuteja commented 8 months ago

Hi, with ellipsis I like the ability to probe multiple values/leafs which are defined at different hierarchies. For instance, to get all the different MTUs values on an interface, I can do a GET on /interfaces/interface[name=Ethernet1]/.../mtu and it can give all the MTUs defined in OpenConfig models:


interfaces/interface/state/mtu
interfaces/interface/routed-vlan/ipv4/config/mtu
interfaces/interface/routed-vlan/ipv4/state/mtu
interfaces/interface/routed-vlan/ipv6/config/mtu
interfaces/interface/routed-vlan/ipv6/state/mtu
interfaces/interface/subinterfaces/subinterface/ipv4/config/mtu
interfaces/interface/subinterfaces/subinterface/ipv4/state/mtu
interfaces/interface/subinterfaces/subinterface/ipv6/config/mtu
interfaces/interface/subinterfaces/subinterface/ipv6/state/mtu
ccole-juniper commented 8 months ago

Hi, with ellipsis I like the ability to probe multiple values/leafs which are defined at different hierarchies. For instance, to get all the different MTUs values on an interface, I can do a GET on /interfaces/interface[name=Ethernet1]/.../mtu and it can give all the MTUs defined in OpenConfig models:

interfaces/interface/state/mtu
interfaces/interface/routed-vlan/ipv4/config/mtu
interfaces/interface/routed-vlan/ipv4/state/mtu
interfaces/interface/routed-vlan/ipv6/config/mtu
interfaces/interface/routed-vlan/ipv6/state/mtu
interfaces/interface/subinterfaces/subinterface/ipv4/config/mtu
interfaces/interface/subinterfaces/subinterface/ipv4/state/mtu
interfaces/interface/subinterfaces/subinterface/ipv6/config/mtu
interfaces/interface/subinterfaces/subinterface/ipv6/state/mtu

Thanks!

That could alternatively be covered by:

interfaces/interface/state/mtu interfaces/interface/routed-vlan/*/*/mtu interfaces/interface/subinterfaces/subinterface/*/*/mtu

Hypothetically, how would you feel about that as an alternative?

abtuteja commented 7 months ago

Hi, It is doable but then the client needs info on what schema is supported by which device and then forming a request. The ellipsis gives the ability to probe whatever leaf is available/defined. There are alternatives to use it but I would argue against removing a feature just due to a lack of efficient implementation.