Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TranslClient: Use new translib subscription APIs (#122)
* Allow data clients to send full gnmipb.Notification Added gnmipb.Notification as a member of the Value messgae object defined by sonic_internal.proto. Data clients now can fill a complete Notification object instead of timestamp, path, TypedValue separately. * Use origin to identify translib yang paths Use TranslClient to handle the subscribe requests when origin is "openconfig". Fallback to the existing target based identification logic if origin is not given. * Use new translib subscribe APIs in TranslClient StreamRun() enhancements: - Create a new SubscribeSession in the beginning and pass it to all further translib API calls - Call translib.IsSubscribeSupported() to reasolve preferences of the requested paths. This also splits the target_defined request into on_change and sample paths. - Use one translib.Subscribe() call passing all on_change enabled paths, if there are any. This will handle initial updates and subsequent on_change notifications. - Use one translib.Stream() call for each sample subscribe path, if present. This will be called in a loop at every sample interval. - Maintain the ygot objects received for each translib.Stream() call in a cache. Diff the current set of objects with the objects from the previous iteration to resolve deleted paths and modified values (when suppress_redundant is enabled). PollRun() and OnceRun() enhancements: - Call translib.Stream() with each subscribed path to generate notification data. - In poll mode, this is repeated when a poll message is received * Increase gnmi_server gotest timeout to 20m
- Loading branch information