Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »





python 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'] 









  • No labels