cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
620
Views
10
Helpful
3
Replies

RESCONF URL

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= "

<interface>
         <GigabitEthernet>
            <name>2</name>
            <ip>
                <address>
                   <primary>
                        <address>10.0.34.1</address>
                            <mask>255.255.255.252</mask>
                   </primary>
                </address>
          </ip>
         </GigabitEthernet>
           <GigabitEthernet>
            <name>3</name>
            <ip>
                <address>
                   <primary>
                        <address>192.168.100.10</address>
                            <mask>255.255.255.0</mask>
                   </primary>
                </address>
          </ip>
         </GigabitEthernet>
 
</interface>

"

 I am getting Response Code: 404. Could you ples help me out? 

Im using Cisco IOS XE Software, Version 17.03.04a 

 

Thanks

 

 

 

 

3 Replies 3

balaji.bandi
Hall of Fame
Hall of Fame

have you enabled RESTconf on the device, 

I would test first using GET for testing. before you post an example.

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_protocol.html

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Marcel Zehnder
Spotlight
Spotlight

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

gjaimes
Level 5
Level 5
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: