Comments (10)
It might be a bug. Thanks for catching this and I'll take a look at it!
from go-junos.
Actually, I see the problem. You have the parameters backwards. The "section" is supposed to be the second (optional) parameter. If you just specify the following:
config, err := jnpr.GetConfig("text")
Then you will get the entire config, vs something like:
config, err := jnpr.GetConfig("text", "interfaces")
I will have to work on the MX parsing, as it's not coming through as it should. Everything else should work ok - I tested it on a QFX, EX, and SRX.
from go-junos.
OK, I think I know what might have happened. I stumbled upon your library from this blog entry. One of the examples on the page is the following:
routing, _ := jnpr.GetConfig("routing-instances", "text")
fmt.Println(routing)
I just used that example as a start for my program and didn't double check with the GoDoc documentation. The RPC error returned wasn't obviously clear (to me), so it didn't dawn on me to double-check the docs to make sure I was using the function correctly.
Switching the argument order in my function call made it work, as you explained. Thanks for looking into it!
Do you need me to test anything with an MX?
Thanks,
-Martin
from go-junos.
Ah...forgot to update my blog when I changed the function parameters around :) Thanks a lot!
Yeah, if you wouldn't mind testing, that would be great. I spent just a couple minutes diving into it yesterday, and apparently the XML response on the "get-software-information" RPC call is different than that of the other platforms.
from go-junos.
I tested using routing, err := jnpr.GetConfig("text")
on an MX960 running 14.1R4.10 and was able to retrieve the config without any error. XML format retrieval also worked fine.
from go-junos.
Do you have dual routing engines?
from go-junos.
Yes.
from go-junos.
I'm running 14.2R5.8 on our MX104's and get an error. Must be tied to the model. I'll dig into it more. Thanks for the continued effort!
from go-junos.
My pleasure!
from go-junos.
@scottdware if you can provide me with the sanitized XML output of the equivalent SSH command, and the error you get from go-junos, I can try to fix it. I don't have access to any dual-RE MX gear, though.
from go-junos.
Related Issues (20)
- Functions to create basic configuration items
- Query job status
- Create/utilize queues for better async usage
- Add filtering to certain API calls
- Allow user to specify RPC calls
- Add SRX policy builder HOT 1
- ConfigDiff() doesn't work on candidate configurations
- using SSH keys HOT 10
- Examples on updating HOT 1
- Upstream changes have broken Logger calls to netconf HOT 3
- Error on commit HOT 7
- jnpr.Views("...") or jnpr.View("...") HOT 2
- Filter for one particular interface HOT 11
- Bug for CommitAt HOT 6
- bring your own SSH session/options HOT 2
- Possible to configure from string text HOT 2
- is there a way to support show intefaces descriptions in Views HOT 1
- Rollback without commit HOT 1
- Client config could be nil if no password/keys are available. Triggers a nil reference. 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 go-junos.