QuestionQ25
Controller-Based Network AutomationAn engineer must prepare SD-WAN Day 0 by exporting a WAN-edge bootstrap configuration from vManage. The engineer must authenticate to vManage, obtain the XSRF token, and GET the bootstrap file for a specified device ID. Drag the code snippets into the boxes to construct the artifact. Not all options are used.
Drag & Drop
import requests requests.packages.urllib3.disable_warnings() base = "https://203.0.113.40:8443" username = "netops" password = "Cisco12345" device_id = "C8K-EDGE-001" # Authenticate and get XSRF token login = requests.post( f"{base}/j_security_check", headers={"Content-Type": "application/x-www-form-urlencoded"}, data=f"j_username={username}&j_password={password}", verify=False, ) login.raise_for_status() xsr f = requests.get( f"{base}/dataservice/client/token", headers={"Cookie": login.headers.get("Set-Cookie", "")}, verify=False, ) xsrf.raise_for_status() hdrs = { "Cookie": login.headers.get("Set-Cookie", ""), "X-XSRF-TOKEN": xsrf.text, "Accept": "application/json", } url = f"{base}/dataservice/?={device_id}" r = requests.(url, =hdrs, verify=False) r.raise_for_status() with open("bootstrap.cfg", "w") as f: f.write(r.text) print("Bootstrap downloaded.")
Community Discussion