Comments (11)
So, without doing any code modifications, you could just grab all the interfaces with the function like it currently does, and then when iterating over them, look for a particular interface, e.g.:
for _, int := range ifaces.Entries {
if strings.Contains(int.Name, "ge-0/0/1") {
// Do stuff
}
}
Would this suffice, or is there a need to only grab a single one without using the above example?
from go-junos.
I can certainly do this. But it is not efficient. I find you can do:
...
but it will only match physical interface. for logical interface attached to physical interface, it will not work. Is there a way to fix this ?
from go-junos.
I find you can do:
name
from go-junos.
<get-interface-information><interface-name>...</interface-name></get-interface-information>
from go-junos.
I will see about adding this feature/option. Should have something ready after the weekend :)
from go-junos.
I will see about adding this feature/option. Should have something ready after the weekend :)
from go-junos.
@MaxBear I just updated this repo with your suggested changes. You can now optionally specify a physical interface, and it will include only that interface, as well as all logical ones tied to it, e.g.:
View("interface", "ge-0/0/0")
from go-junos.
Thanks for making the change, Scott. Do you know why when run cli
show interface <logical interface> | display xml
will display one logical interface output. But this will not work for RPC calls ?
from go-junos.
Most likely because I have it tied to just a physical interface. I should probably change that so that any interface will work, even logical ones (if you don't need to see the physical). I'll work at fixing that.
from go-junos.
If you can fix it, that will be great, thanks !
from go-junos.
Sure thing!
Sent with GitHawk
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
- RPC error "expecting </configuration>" returned on use of GetConfig HOT 10
- 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
- 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.