Return ygot strcut from app module processGet() functions#72
Merged
tomek-US merged 4 commits intosonic-net:masterfrom May 18, 2023
Merged
Return ygot strcut from app module processGet() functions#72tomek-US merged 4 commits intosonic-net:masterfrom
tomek-US merged 4 commits intosonic-net:masterfrom
Conversation
* Updated the appInterface method processGet() to accept a TranslibFmtType argument indicating whether the response data should be returned as IETF json bytes or a ygot.GoStruct object. Translib subscription infra will use TranslibFmtType=ygot. The translib.Get() API will continue to use TranslibFmtType=ietf_json. * Modified processGet() method signature in all existing app modules. All of them will call the common generateGetResponse() utility func which builds the response data as per TranslibFmtType input. Removed all direct dumpIetfJson() calls from app modules. * GetResponse struct contains both []byte and ygot.GoStruct fields. One of them will be populated based on the TranslibFmtType input. * Added TranslibFmtType field to GetRequest also. This can be used in future to support protocol specific response encodings like protobuf encoding. Signed-off-by: Sachin Holla <sachin.holla@broadcom.com>
tomek-US
reviewed
May 17, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the appInterface method processGet() to accept a TranslibFmtType argument indicating whether the response data should be returned as IETF json bytes or a ygot.GoStruct object. Translib subscription infra will use TranslibFmtType=ygot. The translib.Get() API will continue to use TranslibFmtType=ietf_json.
Modified processGet() method signature in all existing app modules. All of them will call the common generateGetResponse() utility func which builds the response data as per TranslibFmtType input. Removed all direct dumpIetfJson() calls from app modules.
GetResponse struct contains both []byte and ygot.GoStruct fields. One of them will be populated based on the TranslibFmtType input.
Added TranslibFmtType field to GetRequest also. This can be used in future to support protocol specific response encodings like protobuf encoding.
Required for the subscription enhancements as described in HLD sonic-net/SONiC#1287