Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. import netmiko
  2. import json
  3. import getpass2
  4.  
  5. class credentials:
  6. def __init__(self):
  7. self.ip = raw_input("Enter IP:")
  8. self.username = raw_input("Enter Username:")
  9. self.password = raw_input("Enter Password:")
  10. self.secret = raw_input("Enter Enable Secret:")
  11. self.port = raw_input("Enter Port Number:")
  12.  
  13.  
  14.  
  15.  
  16. connection = credentials()
  17. connection_IP = connection.ip
  18. connection_USER = connection.username
  19. connection_PSW = connection.password
  20.  
  21.  
  22. net_connect = ConnectHandler(**cisco_881)
  23.  
  24. print("1.cisco_ios, 2.cisco_xe, 3.cisco_asa, 4.cisco_nxos, 5.cisco_xr, 6.cisco_wlc_ssh, \n"
  25. "7.arista_eos, 8.hp_procurve, 9.hp_comware, 10.huawei, 11.f5_ltm, 12.juniper, 13.brocade_vdx.")
  26.  
  27. device_type = raw_input("What type of device: ")
  28. int.device_type
  29.  
  30. if device_type == {1 : cisco_ios,2 : cisco_xe,3 : cisco_asa,4 : cisco_nxos,5 : cisco_xr,6 : cisco_wlc_ssh,7 :
  31. arista_eos,8 :hp_procurve,9 : hp_comware,10 : huawei,11 : f5_ltm,12 : juniper,13 : brocade_vdx.}:
  32.  
  33. device_profile = {
  34. 'device_type': 'cisco_nxos',
  35. 'ip': connection_IP,
  36. 'username': connection_USER,
  37. 'password': connection_PSW,
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement