Skip to content

Debug grpc to fetch subscribe preferences of a yang path#130

Merged
anand-kumar-subramanian merged 1 commit intosonic-net:masterfrom
sachinholla:subscribe_debug
Sep 27, 2023
Merged

Debug grpc to fetch subscribe preferences of a yang path#130
anand-kumar-subramanian merged 1 commit intosonic-net:masterfrom
sachinholla:subscribe_debug

Conversation

@sachinholla
Copy link
Contributor

@sachinholla sachinholla commented Jun 27, 2023

Why I did it

Implements the debug grpc API as described in the HLD sonic-net/SONiC#1287.

Subscription preferences & capabilities for each oc-yang path is determined by individual yang handler code. There is no standard interface for clients to discover them. Hence a custom grpc is required.

How I did it

Added a new 'GetSubscribePreferences' grpc which accepts a list of yang paths and returns following subscription preferences for each:
- OnChangeSupported (if ON_CHANGE subscription will be accepted)
- TargetDefinedMode (mode to which TARGET_DEFINED will map to)
- WildcardSupported (if wildcard keys will be accepted)
- MinSampleInterval (minimum sample_interval accepted, in nanoseconds)

How to verify it

Added new gotests to call this grpc

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@sachinholla sachinholla changed the title Debug grpc to fetch subscribe preferences of a path Debug grpc to fetch subscribe preferences of a yang path Jun 27, 2023
@sachinholla sachinholla force-pushed the subscribe_debug branch 6 times, most recently from 26bd42a to 590e3c5 Compare June 28, 2023 16:56
Added a new 'GetSubscribePreferences' grpc which accepts a list of
yang paths and returns following subscription preferences for each:
 - OnChangeSupported (if on_change subscription will be accepted)
 - TargetDefinedMode (mode to which target_defined will map to)
 - WildcardSupported (if wildcard keys will be accepted)
 - MinSampleInterval (minimum sample_interval accepted, in nanos)

Accepts only translib managed yang paths. Uses the existing translib
API IsSubscribeSupported() to learn the preferences.

This rpc is defined in a new protobuf sonic_debug.proto. It defines
only one rpc 'GetSubscribePreferences' now. More debuggability actions
can be added in future.
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.

4 participants