Giter VIP home page Giter VIP logo

Comments (11)

scottdware avatar scottdware commented on July 30, 2024

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.

MaxBear avatar MaxBear commented on July 30, 2024

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.

MaxBear avatar MaxBear commented on July 30, 2024

I find you can do:

name

from go-junos.

MaxBear avatar MaxBear commented on July 30, 2024
<get-interface-information><interface-name>...</interface-name></get-interface-information>

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

I will see about adding this feature/option. Should have something ready after the weekend :)

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

I will see about adding this feature/option. Should have something ready after the weekend :)

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

@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.

MaxBear avatar MaxBear commented on July 30, 2024

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.

scottdware avatar scottdware commented on July 30, 2024

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.

MaxBear avatar MaxBear commented on July 30, 2024

If you can fix it, that will be great, thanks !

from go-junos.

scottdware avatar scottdware commented on July 30, 2024

Sure thing!

Sent with GitHawk

from go-junos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.