Comments (3)
Hello @fperrin ,
sorry, was extremely busy past 3 weeks and really didn't have time to look into that earlier. What you say is an interesting point. So we build the origin as we build in accordance to gNMI specification: https://github.com/openconfig/reference/blob/master/rpc/gnmi/mixed-schema.md
I'm a little bit uneasy about adding extra arguments, as the idea to keep pygnmi
as simple and as close the gNMI specification as possible. Moreover, I've read the mentioned RFC 7951 (https://datatracker.ietf.org/doc/html/rfc7951), and I don't see there any mentioning about origin at all.
having said that, is there a problem to use pygnmi
with Cisco IOS as it requires the module name to be the top level key? If yes, would it mean that in all the path for Cisco IOS we need to include the module? If that is the case, probably, we can thing to add a variable to gNMIclient
, which could be rfc7951
and which then alters the gnmi_path_genetator
, as you explained in the second case.
Best,
Anton
from pygnmi.
Hi @akarneliuk ,
Point taken about adding extra arguments, I'll not use that approach.
I'm using pygnmi
with a device (that's not released yet) that expects paths of the form described there (ie. I'm quoting that Cisco document because the device I'm using has paths of the same format, not because I'm using a Cisco device) :
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1610/b_1610_programmability_cg/gnmi_protocol.html#id_84819
An RFC 7951-specified namespace prefixing also uses the YANG module name. For example, the openconfig path to a loopback interface will be/openconfig-interfaces:interfaces/interface[name=Loopback111]/
The following example shows a gNMI path with RFC7951 namespacing:
path {
origin: "rfc7951"
elem {
name: "openconfig-interface:interfaces"
}
elem {
name: "interface"
key {
key: "name"
value: "Loopback111"
}
}
}
The important points are that there is a non-default origin, and some of the path elements still have :
in the name. In fact, elements besides the first one can have :
in the name.
The more I think about it, the more I think this all means we can get away with a very simple change: only treat :
specially in the first element to set the origin, and ignore it otherwise. I'll give that a go and update #41 accordingly.
That'd mean you can generate the path above from the string rfc7951:openconfig-interfaces:interfaces/interface[name=Loopback111]
.
I'm not sure about the extra variable to gNMIclient
, because then it means all requests will have to use the same origin, and the document you linked hints at devices that have different parts of their tree addressed differently (I do not know of devices that require that, I certainly don't have devices that require that, but it's a possibility).
from pygnmi.
Thanks for the merge of #41 , @akarneliuk.
For my purpose, it is enough, and allows to specify the paths I need, including the examples in tests/
I included.
from pygnmi.
Related Issues (20)
- How to send set request with proto encoding? HOT 2
- FR: Add ability to set the auth scheme for targets HOT 3
- timeout or gnmi-timeout doesn't seem to work HOT 1
- subscribe not working to Juniper device HOT 6
- nornir example for subscribe stream mode HOT 1
- Missing minimum grpcio version in requirements HOT 1
- Invalid Path error HOT 4
- Release new version HOT 2
- Issue with pygnmi not returning value for get on leaf level for presence container HOT 2
- Feature: Distribute the whl file when publishing to pypi HOT 1
- Issue with Thread Termination in gNMI Client Subscription HOT 2
- Proper certificate usage with pygnmi HOT 3
- gNMI Master Arbitration Extension HOT 2
- pygnmi/pygnmic no longer working with Cisco IOS-XR 7.10.2 unified-model HOT 4
- PYGNMI commit replace is not replacing the running config . HOT 6
- Didn't find any infrastructure support to do master arbitration for performing Set operation HOT 1
- Support for "origin" field
- Create a new release HOT 1
- Support for tls-min-version and tls-max-version
- Help needed with forming the set path HOT 2
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 pygnmi.