Пример #1
0
def main():
    connection = pyeapi.client.connect(
        transport="https", host="localhost", username="******", password="******", port=12443
    )
    connection = replicants.patch_node(connection, "eos", "play")

    node = pyeapi.client.Node(connection)
    vlans = node.api("vlans")

    print vlans.getall()
    print node.run_commands(["show vlan"])
Пример #2
0
def main():
    connection = pyeapi.client.connect(transport='https',
                                       host='localhost',
                                       username='******',
                                       password='******',
                                       port=12443)
    connection = replicants.patch_node(connection, 'eos', 'play')

    node = pyeapi.client.Node(connection)
    vlans = node.api('vlans')

    print vlans.getall()
    print node.run_commands(['show vlan'])
def main():
    connection = pyeapi.client.connect(
        transport='https',
        host='localhost',
        username='******',
        password='******',
        port=12443
    )
    connection = replicants.patch_node(connection, 'eos', 'record')
    node = pyeapi.client.Node(connection)
    vlans = node.api('vlans')

    print vlans.getall()
    print node.run_commands(['show vlan'])
Пример #4
0
def main():
    connection = pyeapi.client.connect(
        transport='https',
        host='localhost',
        username='******',
        password='******',
        port=12443
    )
    connection = replicants.patch_node(connection, 'eos', 'play')
    node = pyeapi.client.Node(connection)

    try:
        print node.run_commands(['show ip route', 'show ip bgp neighbors', 'show lldp neighbors'], encoding='json')
    except pyeapi.eapilib.CommandError as e:
        print e.get_trace()
Пример #5
0
def main():
    connection = pyeapi.client.connect(transport='https',
                                       host='localhost',
                                       username='******',
                                       password='******',
                                       port=12443)
    connection = replicants.patch_node(connection, 'eos', 'record')
    node = pyeapi.client.Node(connection)

    try:
        print node.run_commands(
            ['show ip route', 'show ip bgp neighbors', 'show lldp neighbors'],
            encoding='json')
    except pyeapi.eapilib.CommandError as e:
        print e.get_trace()