openconfig / gnmi

gRPC Network Management Interface
Apache License 2.0
473 stars 196 forks source link

Need gnmi_cli set request example #13

Closed kboyapa1 closed 6 years ago

kboyapa1 commented 7 years ago

I am getting following error when used "-set" to trigger SetRequest from gnmi_cli. What would be the SetRequest syntax for gnmi_cli?

./gnmi_cli -address myServer:5000 -ca_crt /data/users/server.crt -set "/eqpt/shelf/1/admin-status" -update "down" -timeout 10s E1026 23:43:21.831747 37571 gnmi_cli.go:141] Set failed: Query() must be called before any operations on client

awly commented 7 years ago

Well that's embarrassing. We never executed the set command and didn't catch this. The client library code is very Subscribe-centric and doesn't account for Set implementation. I'll try to reorganize it.

And usage also isn't explained well for flags. Your command should be something like: ./gnmi_cli -address myServer:5000 -ca_crt /data/users/server.crt -set -update "/eqpt/shelf/1/admin-status=down"

kboyapa1 commented 7 years ago

Thank you awly for your quick response. I am still getting the same error message with the setRequest syntax you proposed. Please update when the gnmi_cli is reorganized for Set implementation.

./gnmi_cli -address myServer:5000 -ca_crt /data/users/server.crt -set -update "/eqpt/shelf/1/admin-status=down" E1030 01:29:04.194032 30334 gnmi_cli.go:141] Set failed: Query() must be called before any operations on client

awly commented 6 years ago

I believe https://github.com/openconfig/gnmi/commit/4597a86e73c01a17c72e45a19d8621d23c4afbbf fixes this. Please reopen if it still fails.