Interaction with vManage API

5.3.a i Python requests library and Postman

General information on “vManage Python requests library or Postman”:

Basic vManage authentication + GET via Python w/ requests library (example):

## MODULE IMPORT
import requests
import json


## AUTHENTICATION @ VMANAGE
def vmanage_authentication(session):
    sdwan_authentication_url = 'https://sandboxsdwan.cisco.com:8443/j_security_check'
    sdwan_authentication_cred = {'j_username':'devnetuser', 'j_password':'Cisco123!'}
        
    sdwan_authentication = session.post(url = sdwan_authentication_url,
                                        data = sdwan_authentication_cred,
                                        verify=False)

    return sdwan_authentication


## GET DEVICES @ VMANAGE
def vmanage_get_devices(session):
    sdwan_get_devices_url = 'https://sandboxsdwan.cisco.com:8443/dataservice/device'
        
    sdwan_get_devices_raw = session.get(url = sdwan_get_devices_url,
                                        verify=False)

    sdwan_get_devices = json.dumps(json.loads(sdwan_get_devices_raw.content), indent=4)

    return sdwan_get_devices


## MAIN PROGRAM
## INSTANTIATE VMANAGE SESSION
vmanage_session_instance = requests.session()

## AUTHENTICATION @ VMANAGE via FUNCTION
vmanage_authentication = vmanage_authentication(vmanage_session_instance)

## GET DEVICES @ VMANAGE via FUNCTION
vmanage_get_devices = vmanage_get_devices(vmanage_session_instance)

## PRINTING RESULT of GET DEVICES
for device in vmanage_get_devices['data']:
    print(device['host-name'], device['local-system-ip'], device['uuid'])

5.3.a ii Monitoring endpoints

General information on “vManage Monitoring endpoints”:

5.3.a iii Configuration endpoints

General information on “vManage Configuration endpoints”: