<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: I'm unable to get data from restconf in the CML devnet sandbox in DevNet Sandbox</title>
    <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922133#M8608</link>
    <description>&lt;P&gt;Did you enable RESTCONF correct on the router (see&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/ios-xe/#!enabling-restconf-on-ios-xe" target="_blank"&gt;https://developer.cisco.com/docs/ios-xe/#!enabling-restconf-on-ios-xe&lt;/A&gt;), 502 is not an error code used by RESTCONF, might be not correctly enabled.&lt;/P&gt;
&lt;P&gt;Also, can you post your RESTCONF endpoint, headers and payload?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 15:25:39 GMT</pubDate>
    <dc:creator>Marcel Zehnder</dc:creator>
    <dc:date>2023-09-12T15:25:39Z</dc:date>
    <item>
      <title>I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922108#M8607</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;I was using restconf code on a cisco IOS-XE router (dist-rtr02) in the pre-built sample network. I'm wondering if I got a status code of 502 because of a firewall issue.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 14:31:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922108#M8607</guid>
      <dc:creator>acherubin</dc:creator>
      <dc:date>2023-09-12T14:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922133#M8608</link>
      <description>&lt;P&gt;Did you enable RESTCONF correct on the router (see&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/ios-xe/#!enabling-restconf-on-ios-xe" target="_blank"&gt;https://developer.cisco.com/docs/ios-xe/#!enabling-restconf-on-ios-xe&lt;/A&gt;), 502 is not an error code used by RESTCONF, might be not correctly enabled.&lt;/P&gt;
&lt;P&gt;Also, can you post your RESTCONF endpoint, headers and payload?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 15:25:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922133#M8608</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-09-12T15:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922322#M8611</link>
      <description>&lt;P&gt;Here's a sample of my code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# Router details&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;router_ip = '10.10.20.176'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;username = 'cisco'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;password = 'cisco'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;interface_name = 'GigabitEthernet=1'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# API endpoint for native interface JSON output&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;api_endpoint = f"https://{router_ip}/restconf/data/Cisco-IOS-XE-native:native/interface/{interface_name}/ip/address/primary"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# Request headers&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;headers = {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;'Accept': 'application/yang-data+json',&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;'Content-Type': 'application/yang-data+json'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# Authentication credentials&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;auth = (username, password)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;# Make the request&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;response = requests.get(api_endpoint, headers=headers, auth=auth, verify=False)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 20:42:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922322#M8611</guid>
      <dc:creator>acherubin</dc:creator>
      <dc:date>2023-09-12T20:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922467#M8612</link>
      <description>&lt;P&gt;Ok folks, I tried it again and I got it to work. Here's a look at the JSON data I got:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"Cisco-IOS-XE-native:primary": {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"address": "10.10.20.176",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"mask": "255.255.255.0"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks for your assistance.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 04:06:21 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922467#M8612</guid>
      <dc:creator>acherubin</dc:creator>
      <dc:date>2023-09-13T04:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922468#M8613</link>
      <description>&lt;P&gt;What was the issue, how did you solve it?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 04:35:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922468#M8613</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-09-13T04:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922474#M8614</link>
      <description>&lt;P&gt;When I ran my python code the first time, I was getting a HTTPS status code of 502. I'm not sure why this happened but when I tried again it worked. What I noticed was RESTCONF was not enabled on the router by default. I had to configure the router to use it. They probably omitted that configuration when they upgraded the version of CML to 2.5.1.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 08:58:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922474#M8614</guid>
      <dc:creator>acherubin</dc:creator>
      <dc:date>2023-09-13T08:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: I'm unable to get data from restconf in the CML devnet sandbox</title>
      <link>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922493#M8615</link>
      <description>&lt;P&gt;Okay, that's what I thought, glad it works now.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 05:51:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/devnet-sandbox/i-m-unable-to-get-data-from-restconf-in-the-cml-devnet-sandbox/m-p/4922493#M8615</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-09-13T05:51:59Z</dc:date>
    </item>
  </channel>
</rss>

