napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.24k stars 552 forks source link

Proposed New Getter: `get_lag_interfaces` #2027

Open aj-cruz opened 8 months ago

aj-cruz commented 8 months ago

On a couple projects now I've had to get port-channel information from devices including a list of port-channel interfaces, their members, and the status of the member ports.

It appears none of the existing getters provide this so I've had to resort to using the Genie parser (they were all Cisco devices).

It looks like this can easily be done with NXOS, IOS, & EOS and get pretty standardized data, but I don't have a JUNOS device yet to check capabilities with.
My thoughts are output something like this:

'<lag_interface>': {
    'status': '<up/down>',
    'protocol': '<lag_protocol>',
    'members': {
        '<member_interface>': {
            'status': '<up/down>',
            'flags': [<all_interface_flags>]
        }
    }
}

Worth it or am I crazy?
I'd be happy to work on the project myself if I can figure out how to get this vJunos-switch going...

mirceaulinic commented 6 months ago

@aj-cruz this sounds good to me and indeed a pretty simple win. If you implement this on NXOS, IOS, & EOS, I may be able to implement on Junos (and maybe on XR too) to have a decent coverage.

Any thoughts agsinst doing this @ktbyers @bewing?

bewing commented 2 months ago

Usual caveats: Is MLAG supported, what does the openconfig model for port-channels look like, etc