02-16-2023 06:14 AM
Hi all!
I hope you all doing well.
I am new to RESCONF and getting confused to write the proper URL for multiple configurations. I wanna configure multiple interfaces at the same time and I have used this URL "https://....../restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=2,GigabitEthernet=3" to configure G2 and G3 with XML payload.
XML= "
"
I am getting Response Code: 404. Could you ples help me out?
Im using Cisco IOS XE Software, Version 17.03.04a
Thanks
02-16-2023 06:33 AM
have you enabled RESTconf on the device,
I would test first using GET for testing. before you post an example.
02-16-2023 07:05 AM - edited 02-16-2023 07:08 AM
The RESTCONF specification states that a result containing multiple instances (e.g a number of list entries) is not allowed if XML encoding is used. The reason for this is that an XML document can only have one root node. [1]
But you can use JSON content, and PATCH to https://IP/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet
in order to configure multiple GigabitEthernet interfaces:
{
"Cisco-IOS-XE-native:GigabitEthernet": [
{
"name": "3",
"ip": {
"address": {
"primary": {
"address": "100.100.84.1",
"mask": "255.255.255.0"
}
}
}
},
{
"name": "4",
"ip": {
"address": {
"primary": {
"address": "100.100.85.1",
"mask": "255.255.255.0"
}
}
}
}
]
}
HTH
Marcel
[1]: quoted from https://developer.cisco.com/docs/nso/guides/#!the-restconf-api/extensions
see https://www.rfc-editor.org/rfc/rfc8040.html for details
03-31-2023 12:19 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide