<?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: Data Method Load example in JSON-RPC in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920027#M4255</link>
    <description>&lt;P&gt;From the NSO Web UI Book, the load method's parameters are as stated&lt;/P&gt;
&lt;PRE class="programlisting"&gt;{"th": &amp;lt;integer&amp;gt;,
 "data": &amp;lt;string&amp;gt;
 "path": &amp;lt;string, default: "/"&amp;gt;
 "format": &amp;lt;"json" | "xml", default: "xml"&amp;gt;
 "mode": &amp;lt;"create" | "merge" | "replace", default: "merge"&amp;gt;}&lt;/PRE&gt;
&lt;P&gt;Did the JSON payload include a comma after the "data" string? It seems that the documentation is missing these, which results in invalid JSON.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A valid JSON-RPC parameter payload for the "load" method would loke something like&lt;/P&gt;
&lt;PRE&gt;{"th": 42,&lt;BR /&gt; "data": "&amp;lt;config xmlns="http://tail-f.com/ns/config/1.0"&amp;gt;&amp;lt;wrapper xmlns="urn:model"&amp;gt;&amp;lt;name&amp;gt;create&amp;lt;/name&amp;gt;&amp;lt;/wrapper&amp;gt;&amp;lt;/config&amp;gt;",&lt;BR /&gt; "mode": "create"}&lt;/PRE&gt;
&lt;P&gt;Note that it should be possible to omit parameters with default values.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2019 07:14:06 GMT</pubDate>
    <dc:creator>perander</dc:creator>
    <dc:date>2019-09-06T07:14:06Z</dc:date>
    <item>
      <title>Data Method Load example in JSON-RPC</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3919887#M4253</link>
      <description>&lt;P&gt;Looking for an example of the Data Method: Load in JSON-RPC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen the documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{"th": &amp;lt;integer&amp;gt;,&lt;BR /&gt;"data": &amp;lt;string&amp;gt;&lt;BR /&gt;"path": &amp;lt;string, default: "/"&amp;gt;&lt;BR /&gt;"format": &amp;lt;"json" | "xml", default: "xml"&amp;gt;&lt;BR /&gt;"mode": &amp;lt;"create" | "merge" | "replace", default: "merge"&amp;gt;}&lt;/PRE&gt;&lt;P class="p1"&gt;Though anything I seem to try - attempting json-data - doesn't seem to work. The RPC always returns a&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"reason"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"invalid_trailing_data"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 20:42:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3919887#M4253</guid>
      <dc:creator>lukepatrick</dc:creator>
      <dc:date>2019-09-05T20:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Data Method Load example in JSON-RPC</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920027#M4255</link>
      <description>&lt;P&gt;From the NSO Web UI Book, the load method's parameters are as stated&lt;/P&gt;
&lt;PRE class="programlisting"&gt;{"th": &amp;lt;integer&amp;gt;,
 "data": &amp;lt;string&amp;gt;
 "path": &amp;lt;string, default: "/"&amp;gt;
 "format": &amp;lt;"json" | "xml", default: "xml"&amp;gt;
 "mode": &amp;lt;"create" | "merge" | "replace", default: "merge"&amp;gt;}&lt;/PRE&gt;
&lt;P&gt;Did the JSON payload include a comma after the "data" string? It seems that the documentation is missing these, which results in invalid JSON.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A valid JSON-RPC parameter payload for the "load" method would loke something like&lt;/P&gt;
&lt;PRE&gt;{"th": 42,&lt;BR /&gt; "data": "&amp;lt;config xmlns="http://tail-f.com/ns/config/1.0"&amp;gt;&amp;lt;wrapper xmlns="urn:model"&amp;gt;&amp;lt;name&amp;gt;create&amp;lt;/name&amp;gt;&amp;lt;/wrapper&amp;gt;&amp;lt;/config&amp;gt;",&lt;BR /&gt; "mode": "create"}&lt;/PRE&gt;
&lt;P&gt;Note that it should be possible to omit parameters with default values.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 07:14:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920027#M4255</guid>
      <dc:creator>perander</dc:creator>
      <dc:date>2019-09-06T07:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data Method Load example in JSON-RPC</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920079#M4258</link>
      <description>&lt;P&gt;Of course the XML data above needs to escape quotes, e.g. ..."data": "&amp;lt;config xmlns=\"...\"&amp;gt;...&amp;lt;/config&amp;gt;".&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 09:03:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920079#M4258</guid>
      <dc:creator>perander</dc:creator>
      <dc:date>2019-09-06T09:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data Method Load example in JSON-RPC</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920174#M4264</link>
      <description>&lt;P&gt;thank you for the response.&lt;/P&gt;&lt;P&gt;Yes, we did notice the missing comma's and have included those.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a working example with JSON as the data parameter payload?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 13:13:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3920174#M4264</guid>
      <dc:creator>lukepatrick</dc:creator>
      <dc:date>2019-09-06T13:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data Method Load example in JSON-RPC</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3921021#M4266</link>
      <description>&lt;P&gt;Given the following YANG model&lt;/P&gt;
&lt;PRE&gt;module ex { &lt;BR /&gt;    namespace "urn:ex";&lt;BR /&gt;    prefix ex;&lt;BR /&gt;&lt;BR /&gt;    leaf value { type int32; }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;The following JSON-RPC payload loads config&lt;/P&gt;
&lt;PRE&gt;{"jsonrpc": "2.0",&lt;BR /&gt; "method": "load",&lt;BR /&gt; "params":&lt;BR /&gt;   {"th": 1,&lt;BR /&gt;    "data": "{\"ex:value\":42}",&lt;BR /&gt;    "mode": "create",&lt;BR /&gt;    "format": "json"},&lt;BR /&gt; "id":1}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 08:57:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/data-method-load-example-in-json-rpc/m-p/3921021#M4266</guid>
      <dc:creator>perander</dc:creator>
      <dc:date>2019-09-09T08:57:38Z</dc:date>
    </item>
  </channel>
</rss>

