<?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: Restconf URI special chars in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674685#M7352</link>
    <description>&lt;P&gt;Turned out this was due to the Nginx proxy that was decoding the URI before sending to NSO. I had to add some rewrite statements to Nginx to tell it to not decode the URI and send it as is to NSO.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  #Server Location
    rewrite ^ $request_uri;
    rewrite ^/(.*) $1 break;
    return 400;
    proxy_pass              http://127.0.0.1:8080/$uri;
    proxy_request_buffering off;
    proxy_read_timeout      90;&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/28684300/nginx-pass-proxy-subdirectory-without-url-decoding/37584637#37584637" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/28684300/nginx-pass-proxy-subdirectory-without-url-decoding/37584637#37584637&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 13:34:05 GMT</pubDate>
    <dc:creator>tsiemers1</dc:creator>
    <dc:date>2022-08-24T13:34:05Z</dc:date>
    <item>
      <title>Restconf URI special chars</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4673539#M7345</link>
      <description>&lt;P&gt;NSO Version 5.5.4.1&lt;/P&gt;&lt;P&gt;Sending restconf call with special chars in it returns 404.&amp;nbsp;&lt;/P&gt;&lt;P&gt;show l3vpn-interface LABDEVICE 1111:1111:111:1fff:1111::/128 | display restconf&lt;/P&gt;&lt;P&gt;/restconf/data/l3vpn-interface:l3vpn-interface=LABDEVICE,1111%3A1111%3A111%3A1fff%3A1111%3A%3A%2F128&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "ietf-restconf:errors": {
        "error": [
            {
                "error-type": "application",
                "error-tag": "invalid-value",
                "error-message": "uri keypath not found"
            }
        ]
    }
}&lt;/LI-CODE&gt;&lt;P&gt;Does NSO require a special syntax for restconf URI characters? Per the RFC this should be a valid path&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;The following example shows how reserved characters are
   percent-encoded within a key value.  The value of "key1" contains
   a comma, single-quote, double-quote, colon, double-quote, space,
   and forward slash (,'":" /).  Note that double-quote is not a
   reserved character and does not need to be percent-encoded.  The
   value of "key2" is the empty string, and the value of "key3" is the
   string "foo".

   Example URL:

      /restconf/data/example-top:top/list1=%2C%27"%3A"%20%2F,,foo&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 18:52:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4673539#M7345</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2022-08-22T18:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Restconf URI special chars</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674429#M7349</link>
      <description>&lt;P&gt;How does your call look? Copying the path from NSOs display restconf should work. I was able to make the RESTCONF call with the following model:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;list example-list {
  key "name address";
  leaf name {
    type string;
  }
  leaf address {
    type inet:ipv6-prefix;
  }
  leaf example-leaf {
    type string;
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;Which resulted in the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl -u admin:admin http://localhost:8080/restconf/data/test-service:example-list=test-name,1111%3A1111%3A111%3A1fff%3A1111%3A%3A%2F128 -H "Accept: application/yang-data+json"
{
  "test-service:example-list": [
    {
      "name": "test-name",
      "address": "1111:1111:111:1fff:1111::/128",
      "example-leaf": "randomdata"
    }
  ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 08:47:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674429#M7349</guid>
      <dc:creator>hazad</dc:creator>
      <dc:date>2022-08-24T08:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Restconf URI special chars</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674671#M7350</link>
      <description>&lt;P&gt;Instance&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;admin@labncs# show running-config l3vpn-interface LABDEVICE 2607:f440:300:11ff:1111::/128 | display restconf 

/restconf/data/l3vpn-interface:l3vpn-interface=LABDEVICE,2607%3Af440%3A300%3A11ff%3A1111%3A%3A%2F128&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;➜ ~ curl -u admin:admin https://ncslab.localhost/restconf/data/l3vpn-interface:l3vpn-interface=LABDEVICE,2607%3Af440%3A300%3A11ff%3A1111%3A%3A%2F128

&amp;lt;errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"&amp;gt;
&amp;lt;error&amp;gt;
&amp;lt;error-type&amp;gt;application&amp;lt;/error-type&amp;gt;
&amp;lt;error-tag&amp;gt;invalid-value&amp;lt;/error-tag&amp;gt;
&amp;lt;error-message&amp;gt;uri keypath not found&amp;lt;/error-message&amp;gt;
&amp;lt;/error&amp;gt;
&amp;lt;/errors&amp;gt;
➜ ~&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Aug 2022 13:06:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674671#M7350</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2022-08-24T13:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Restconf URI special chars</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674674#M7351</link>
      <description>&lt;P&gt;After seeing that it worked I tested again and noticed that it was our HTTP proxy nginx configuration that is breaking this. If I turn off nginx and go directly to NSO it works fine.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 13:13:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674674#M7351</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2022-08-24T13:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Restconf URI special chars</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674685#M7352</link>
      <description>&lt;P&gt;Turned out this was due to the Nginx proxy that was decoding the URI before sending to NSO. I had to add some rewrite statements to Nginx to tell it to not decode the URI and send it as is to NSO.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  #Server Location
    rewrite ^ $request_uri;
    rewrite ^/(.*) $1 break;
    return 400;
    proxy_pass              http://127.0.0.1:8080/$uri;
    proxy_request_buffering off;
    proxy_read_timeout      90;&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/28684300/nginx-pass-proxy-subdirectory-without-url-decoding/37584637#37584637" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/28684300/nginx-pass-proxy-subdirectory-without-url-decoding/37584637#37584637&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 13:34:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/restconf-uri-special-chars/m-p/4674685#M7352</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2022-08-24T13:34:05Z</dc:date>
    </item>
  </channel>
</rss>

