Esempio n. 1
0
def vdc_layer_2():
    """Gets layer two information from the device"""

    global vdc

    if vdc == None:
        vdc = request.form.get("vdc")
        GetInfo.switch_vdc(netmiko_session, vdc=request.form.get("vdc"))
    else:
        GetInfo.switch_vdc_back(netmiko_session)

    GetInfo.switch_vdc(netmiko_session, vdc=request.form.get("vdc"))
    vlans = GetInfo.get_vlans(netmiko_session)
    trunks = GetInfo.get_trunks(netmiko_session)
    port_channels = GetInfo.get_port_channels(netmiko_session)
    interfaces = GetInfo.get_interface_names(netmiko_session)
    arp = GetInfo.get_arp(netmiko_session)
    current_vdc = GetInfo.get_vdcs(netmiko_session)
    vpcs = GetInfo.get_vpcs(netmiko_session)

    return render_template('get_layer_two.html',
                           vlans=vlans,
                           trunks=trunks,
                           port_channels=port_channels,
                           interfaces=interfaces,
                           arp=arp,
                           vdcs=vdcs[0],
                           current_vdc=current_vdc[1],
                           vpc=vpcs)
Esempio n. 2
0
def layer_2():
    """Gets layer two information from the device"""

    global vdcs

    vlans = GetInfo.get_vlans(netmiko_session)
    trunks = GetInfo.get_trunks(netmiko_session)
    port_channels = GetInfo.get_port_channels(netmiko_session)
    interfaces = GetInfo.get_interface_names(netmiko_session)
    arp = GetInfo.get_arp(netmiko_session)
    vdcs = GetInfo.get_vdcs(netmiko_session)
    vpcs = GetInfo.get_vpcs(netmiko_session)

    return render_template('get_layer_two.html',
                           vlans=vlans,
                           trunks=trunks,
                           port_channels=port_channels,
                           interfaces=interfaces,
                           arp=arp,
                           vdcs=vdcs[0],
                           current_vdc=vdcs[1],
                           vpcs=vpcs)