onosproject / onos-config

Configuration subsystem for ONOS (µONOS Architecture)
45 stars 57 forks source link

Expose OpStateCache through gRPC #599

Closed Andrea-Campanella closed 5 years ago

Andrea-Campanella commented 5 years ago

Is your feature request related to a problem? Please describe. Currently the OpStateCahce can't be inspected through and admin/diags interface.

Describe the solution you'd like Admin or Diags should include a new method to expose the OpStateCahce status in detail.

SeanCondon commented 5 years ago

It is available through gNMI at present but it would also be very useful to access it through the diags interface (just like changes and configs are available).

This would also be useful for the onos-gui as it's easier than having to parse JSON trees.

It would need to have a "subscribe for changes" method too that allowed the GUI (or any other client) to subscribe for all changes on a device through one simple action.

SeanCondon commented 5 years ago

This can be implemented in 6 parts 1) Update github.com/onosproject/onos-config/pkg/northbound/proto/diags.proto with a new rpc (in a new OpState service) - GetOpState

2) Update github.com/onosproject/onos-config/pkg/northbound/diags/diags.go with this new Service and a new method. It should retrieve values from manager.OperationalStateCache

3) Update the CLI client at github.com/onosproject/onos-config/pkg/cli/command with a new file opstatecache.go (copy changes.go to get started) and access the gRPC command from 1)

4) Extend diags.go again with a Subscribe method

5) Extend diags.go again for Subscribe

6) Extend CLI again with subscribe