QuestionQ18
Controller-Based Network AutomationAn engineer needs to onboard a new switch in Cisco Catalyst Center PnP for Day-0 provisioning. The engineer must retrieve an authentication token and POST the device serial number/PID to the PnP import intent endpoint so that it appears in the PnP queue. Not every option is used.
Drag & Drop
import requests requests.packages.urllib3.disable_warnings() base = "https://198.51.100.10" auth = ("dnac", "Cisco12345") # Get token t = requests.post(f"{base}/dna/system/api/v1/auth/token", auth=auth, verify=False) t.raise_for_status() token = t.json()["Token"] headers = {"": token, "": "application/json"} payload = [ {"serialNumber": "FGL1234ABC", "pid": "C9300-24T", "siteName": "Global/Branch1"} ] resp = requests.( f"{base}/dna//api/v1/onboarding/pnp-device/import", headers=headers, json=payload, verify=False, ) resp.raise_for_status() print("PnP device imported.")
Community Discussion