Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.




interface field





Code Block
titlepython script
def clear_bgp(ngbr_ips,table_name,group_name,prefix_for,**kwargs):
    #headers = { 'Accept' : 'application/json', 'Content-Type' : 'application/json' }
    r = requests.get('http://api_server:9000/api/v1/device/%s/' % kwargs['device_id'], verify=False)
    print ("Connected to API server")
    print(r.status_code, file=sys.stderr)
    if r.status_code != 200:
        return False
    device_info = r.json()

    junos_host = device_info['host']
    junos_user = device_info['authentication']['password']['username']
    junos_password = device_info['authentication']['password']['password'] 








...