Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnmi_cli still does not support PathElem field of message Path from gnmi.proto v4 #11

Closed
dparameswarappa opened this issue Oct 17, 2017 · 4 comments

Comments

@dparameswarappa
Copy link

In this gnmi_cli i was thinking it supports TypedValue val i.e. added in new gnmi.proto 0.4.0 but when i used this client i see this
o/p:
./gnmi_cli -a 10.33.101.170:6702 -qt s -dt p -pi 10s -q /hello/system/logical-core-percent[cpu-id=5] -client_types gnmi
subscribe:<subscription:<path:<element:"hello" element:"system" element:"logical-core-percent[cpu-id=5]" > > >
update: <
timestamp: 1508251414
prefix: <
element: "hello"
element: "system"
element: "logical-core-percent[cpu-id=5]"
origin: "Hello"

update: <
path: <
element: "cpu-idle"
origin: "Hello"
>
value: <
value: "100"
>

Am i missing something here? or not using the client in the right way?

@awly
Copy link
Contributor

awly commented Oct 17, 2017

You are seeing exactly the proto messages that your server (10.33.101.170:6702) is sending.
If it's not setting TypedValue fields, the CLI won't show them. It's not doing any auto-conversion with -dt p

@awly awly closed this as completed Oct 17, 2017
@dparameswarappa
Copy link
Author

When i used the same gnmi_cli with the different server that is using new proto(0.4.0) i dont receive any reply.
o/p:
./gnmi_cli -a 10.33.81.100:6702 -qt s -dt p -pi 10s -q /hello/system/logical-core-percent[cpu-id=5] -client_types gnmi
subscribe:<subscription:<path:<element:"hello" element:"system" element:"logical-core-percent[cpu-id=5]" > > >

It just sits here and waits.

To verify we used a home grown tool with same server we received this below reply.

$ ./gnmic
Server address: 10.33.81.100
Server port: 6702
Enter sensor names...
system logical-core-percent[cpu-id=5]
subscribe { prefix { origin: "caxv-gmathur-01" elem { name: "hello" } } subscription { path { origin: "OriginHello" elem { name: "system" } elem { name: "logical-core-percent" key { key: "cpu-id" value: "5" } } } mode: SAMPLE sample_interval: 2000 heartbeat_interval: 10000 } }

update {
timestamp: 1508267372968000000
prefix {
origin: "Hello"
elem { name: "hello" }
elem { name: "system" }
elem { name: "logical-core-percent" key { key: "cpu-id" value: "5" } } }
update {
path {
origin: "Hello"
elem { name: "cpu-idle" }
}
val { float_val: 100 }
}
}

@awly
Copy link
Contributor

awly commented Oct 17, 2017

So, the problem is not TypedValue or anything about the response.
The problem is SubscribeRequest, specifically https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto#L123

Your client handles the new PathElem field. gnmi_cli only uses the old deprecated field element.
The server likely only looks at the new path structure, which is why nothing is returned.

@awly awly reopened this Oct 17, 2017
@awly awly changed the title gnmi_cli still does not support Typed value with new gnmi.proto gnmi_cli still does not support PathElem field of message Path from gnmi.proto v4 Oct 17, 2017
@awly awly closed this as completed in 05907f8 Dec 5, 2017
@awly
Copy link
Contributor

awly commented Dec 5, 2017

The change finally landed, sorry for the long wait.
All gnmi_cli RPCs now include both path formats and handle both formats for responses.
Let me know if you find any issues.

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

No branches or pull requests

2 participants