QuestionQ66
VerifiedDevice-Level Network AutomationDrag and drop the code snippets into the boxes to construct a RESTCONF request that creates two access VLANs on a Cisco IOS XE device. Not all options are used.
Drag & Drop
base_url = "https://10.10.20.40:443/restconf/data/" path_url = "Cisco-IOS-XE-native:native/vlan" url = base_url + path_url ={ "Cisco-IOS-XE-vlan:vlan-list": [ { "id": 135, "name": "DATA" }, { "id": 254, "name": "MGMT" } ] } headers = { 'Accept': 'application/yang-data+json, application/yang-data.errors+json', 'Content-Type': 'application/yang-data+json', } resp = requests.(url, =("admin", "Admin_1234!"), headers=headers, = data, verify=False) print(resp.status_code)
Community Discussion