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', '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'])
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()
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()