Skip to content
Snippets Groups Projects

Resolve "Add an option to send gNMI Subscribe requests via SBI"

1 file
+ 4
11
Compare changes
  • Side-by-side
  • Inline
@@ -655,30 +655,23 @@ func (p PndServer) DeleteOnd(ctx context.Context, request *ppb.DeleteOndRequest)
// SubscribePath subscribes to specifc paths of an ond
func (p PndServer) SubscribePath(request *ppb.SubscribePathRequest, stream ppb.PndService_SubscribePathServer) error {
labels := prometheus.Labels{"service": "pnd", "rpc": "subscribe path"}
start := metrics.StartHook(labels, grpcRequestsTotal)
defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds)
pid, err := uuid.Parse(request.Pid)
if err != nil {
return handleRPCError(labels, err)
return err
}
pnd, err := p.pndStore.Get(store.Query{ID: pid})
if err != nil {
log.Error(err)
return handleRPCError(labels, err)
return err
}
did, err := uuid.Parse(request.Did)
if err != nil {
log.Error(err)
return handleRPCError(labels, err)
return err
}
if err := pnd.SubscribePath(did, request.Sublist); err != nil {
log.Error(err)
return handleRPCError(labels, err)
return err
}
return nil
Loading