Skip to content

Return ygot strcut from app module processGet() functions#72

Merged
tomek-US merged 4 commits intosonic-net:masterfrom
sachinholla:return_ygot
May 18, 2023
Merged

Return ygot strcut from app module processGet() functions#72
tomek-US merged 4 commits intosonic-net:masterfrom
sachinholla:return_ygot

Conversation

@sachinholla
Copy link
Contributor

  • 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

* 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>
Copy link

@tomek-US tomek-US left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomek-US tomek-US merged commit 72e2cec into sonic-net:master May 18, 2023
@sachinholla sachinholla deleted the return_ygot branch June 18, 2023 03:41
@sachinholla sachinholla restored the return_ygot branch June 18, 2023 03:48
@sachinholla sachinholla deleted the return_ygot branch July 19, 2023 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants