lib/junos-ez/lag_ports.rb
# LAG ports sit at the toplevel interface

LAG ports sit at the toplevel interface
LAG ports sit at the toplevel interface
def xml_change_links( xml )
    update_ifd_should()  
    @should[:links] = @should[:links].to_set if @should[:links].kind_of? Array
    has = @has[:links] || Set.new
    should = @should[:links] || Set.new
    set_cookie_links( xml )
    del = has - should
    add = should - has
    par = xml.instance_variable_get(:@parent)
    dot_ifd = par.at_xpath('ancestor::interfaces')
    add.each{ |new_ifd| Nokogiri::XML::Builder.with( dot_ifd ) {|dot|
      dot.interface { dot.name new_ifd
        dot.send(@ifd_ether_options.to_sym) {
          dot.send(:'ieee-802.3ad') {
            dot.bundle @name
          }
        }
    }}}
    del.each{ |new_ifd| Nokogiri::XML::Builder.with( dot_ifd ) {|dot|
      dot.interface { dot.name new_ifd
        dot.send(@ifd_ether_options) {
          dot.send( :'ieee-802.3ad', Netconf::JunosConfig::DELETE )
        }
    }}} 
  end
def xml_change_links ( xml ) update_ifd_should ( ) @should [ :links ] = @should [ :links ] . to_set if @should [ :links ] . kind_of? Array has = @has [ :links ] || Set . new should = @should [ :links ] || Set . new set_cookie_links ( xml ) del = has - should add = should - has par = xml . instance_variable_get ( :@parent ) dot_ifd = par . at_xpath ( 'ancestor::interfaces' ) add . each { | new_ifd | Nokogiri :: XML :: Builder . with ( dot_ifd ) { | dot | dot . interface { dot . name new_ifd dot . send ( @ifd_ether_options . to_sym ) { dot . send ( :' ieee-802.3ad ' ) { dot . bundle @name } } } } } del . each { | new_ifd | Nokogiri :: XML :: Builder . with ( dot_ifd ) { | dot | dot . interface { dot . name new_ifd dot . send ( @ifd_ether_options ) { dot . send ( :' ieee-802.3ad ' , Netconf :: JunosConfig :: DELETE ) } } } } end
LAG ports sit at the toplevel interface
LAG ports sit at the toplevel interface
xml
<not_specific>