-
Notifications
You must be signed in to change notification settings - Fork 211
Addition of YANG compliance TypedValue enum variants #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Support for a means to describe nodes (containers) that contain the YANG `presence` statement in Updates - Support for a means to describe nodes of type empty (leafs) in Updates
|
Reviewed in OC Community meeting on April 3rd 2025. We would like the community to provide more feedback. Some initial feedback is these new fields should probably be part of a gnmi extension, and not the base proto. In Google's use case, we utilize JSON IETF format which explicitly encodes null/empty values. In addition, OC YANG models do not define leaves that have use the YANG empty value. (A common use case for empty is instead met using boolean). For these reasons I don't have a strong opinion on the topic beyond using gnmi extension for this change. |
I don't think this is fully correct. Telemetry updates which must be
This is correct.
Can you explain how a gNMI extension can be used here? The |
This is actually touching on another subject that is likely in need of further documentation/guidance which comes down to encoding uses in correspondance to gNMI operations (I'll leave most of that for another time) For Now for For a But for an For reference, Presence container Type empty
An extension cannot be used here. We need a means to map appropriate |
|
From a Cisco perspective we use GNMI with both openconfig models and our vendor models for set and for subscribe oprations and we have both presence containers and empty leaves in our native models. We support these new changes as proposed and would add implementation support. |
|
i am supportive of adding new values to typed value to support these leaf types. i also believe that this cannot be (sanely) achieved through an extension. for the telemetry use case, there needs to be some thought about how presence is handled, imho. since sending something like
this will not be compatible with existing gnmi collectors. thus, i think an alternate approach (strawperson proposal: a particular metadata leaf -- e.g., |
|
Thx @robshakir
What TypedValue would you think we'd want to encode that in? an existing or new? If existing a schema unaware collector cannot decipher this potentially from a leaf node that carries type=string that just so happens to encode If we created a new type (can still be of string) then we are at least signaling that this is rather a piece of metadata on the key (e.g. For |
or.... are you suggesting that we only define a ruleset (spec update) here for encoding keys and use existing e.g.
False would never be set. Clients must adapt to accomodate that if the Path describes a YANG modeled path that any PathElem name that starts with The method I mention prior does not change the path encodings but rather relies off distinct types for the value where we have a protocol of what is encoded as metadata... |
|
brainstorming:
WDYT? |
Apologies for taking so long to revert @robshakir Agreed re: For So we just need to pick another invalid YANG char to use here and one that doesn't conflict w/ How about e.g. Any other opinions? @ncorran @rgwilton @jsterne @jgcumming |
|
I think the empty handling is OK. to replace 'leaf' with 'data node' rather than literally a yang leaf (so it can cover leaf, p-container, or list-entry as needed). Doesnt that then make it easier to handle? Internally we have a flag on a container to say whether it is presence or not and another flag to say whether it exists or not (if it is a presence container). It feels like we should be able to attach the same 'empty leaf' solution to the presence container and encode it with a true-only bool. But if the only option is a fake leaf then we can certainly handle it. |
|
I Think complite this argumens in Soul Out. |
YANG
presencestatement in gNMI UpdatesDescription:
As of today, gNMI is meant to be a protocol to access and interact with data on
an endpoint somewhat agnostic of the data content and how the content is
described/modeled. There is however a contract of sorts from an
originperspective that at least describes how to interact with data modeled in YANG
specific to the OpenConfig model set for the origin =
openconfig.As part of the OpenConfig modeling guidelines, only a subset of the YANG
language is recommended with some being more or less forbidden. One such case
is YANG
presencecontainers describedhere.
While other undefined origins can define separate rules to abide by, there is
still a common contract and API defintion that must be shared thus we currently
have gaps for the marrying of YANG modeled data to how such content can be
fully described and properly typed within gNMI message structs.
This PR covers 2 such gaps for YANG statements:
presence "...";type empty;Example usage for YANG modeled
presencecontainer:And subsequent deletion (non issue for this PR)
Example usage for YANG modeled type
emptyAnd subsequent deletion (non issue for this PR)