Comments (4)
Please see the explanation in the gNMI spec: https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#222-paths
The key map is used to express a path element that requires one or more index values, such as a list in YANG:
/interfaces/interface[name=eth0]/state/oper-status
The second path element requires use of the key. There are examples of the encoding at the link above.
from gnmi.
Thank you for your reply . I think what you mean is like below, is it right?
For example, "/interfaces/interface[name=eth0]"
string name = 1; -----------> name = "/interfaces/interface"
map<string, string> key = 2; -----------> key = "name", value = "eth0"
Why not use the full xpath string directly, just like "/interfaces/interface[name=eth0]"? I want to ask another question. If the path is "/interfaces/interface[name=eth0]/state/oper-status", the name
field is
"/interfaces/interface/state/oper-status"
or "/interfaces/interface[name=eth0]/state/oper-status"
? and the key
is null?
from gnmi.
We've iterated on the path specification a number of times -- the motivation for this format is that it is significantly simpler to work with than having string parsing throughout the code. The full proposal and discussion that Marcus, Carl, Anees and I put together is in this issue. You can see the discussion there.
The name
field is a repeated -- so your example isn't correct, again please see the examples. This would be encoded using multiple PathElem
messages, i.e.:
elem: <
name: "interfaces"
>
elem: <
name: "interface"
key: <
key: "name"
value: "eth0"
>
>
The second example just appends more elem
entries onto the end of the repeated:
elem: <
name: "interfaces"
>
elem: <
name: "interface"
key: <
key: "name"
value: "eth0"
>
>
elem: <
name: "state"
>
elem: <
name: "oper-status"
>
(Using standard Go textproto encoding format)
In the case that there are no keys (i.e., an element is not a YANG list, if using YANG) then the key map is null.
from gnmi.
Thanks @robshakir. I overlooked that the name
field is a repeated, I think I have already understood.
from gnmi.
Related Issues (20)
- Publishing releases for the different gnmi versions HOT 2
- gnmi client does not build HOT 5
- Alternative to SubscribeResponse_Error HOT 2
- in layer2.proto file simple string could be fine instead of types.Path . It is to clear lldp interface adjacency and not for config or streaming anything out side.
- Proto includes failing and compile_protos.sh script errors out. HOT 3
- SubscribeResponse.GetUpdate().Updates length varies in large telemetry updates HOT 2
- Tunnel server not sending client's "certificate request" TLS message with "skip-verify=false" HOT 2
- 3.5.2.3 Sending Telemetry Update and the delete field HOT 2
- Tunnel client socket stays in ESATBLISHED state on removing/deleting target
- Question: Spec Get vs Spec Subscribe ONCE HOT 4
- Cannot send requests to Cisco IOS XR device HOT 4
- Subscribe() requires a target while the spec says it shouldn't HOT 6
- Clarification needed for adding namespace in path HOT 8
- gnmic with tls-ca : context deadline exceeded HOT 1
- Can we get a new release? HOT 2
- Remove ellipsis (...) wildcarding HOT 3
- Question regarding Alias field HOT 2
- gnmi_cli hangs on to the host machine if the underlying putty session experience a network disconnection HOT 2
- compile_protos.sh uses bash syntax HOT 2
- juniper_gnmi.service: Main process exited, code=exited, status=2/INVALIDARGUMENT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnmi.