<?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: Exec CLI from NSO REST API for CISCO IOS-XE in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3802256#M3301</link>
    <description>&lt;P&gt;And using RESTCONF, here an example of a show command action (alu NED). For a NETCONF RPC is not different. Just search the path to the RPC definition and then draft your "input" parameters. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;One tricky thing on RESTCONF that I always miss is that you do not use the prefix of a module but the module name.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;curl -X POST \&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;'&lt;A href="http://127.0.0.1:8080/restconf/data/devices/device=alu0/live-status/tailf-ned-alu-sr-stats:exec/show" target="_blank"&gt;http://127.0.0.1:8080/restconf/data/devices/device=alu0/live-status/tailf-ned-alu-sr-stats:exec/show&lt;/A&gt;'\&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'Authorization: Basic YWRtaW46YWRtaW4='\&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'Content-Type: application/yang-data+json' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'Postman-Token: 5ffb3be3-5556-416e-a10a-1e59e3d82cf4' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'cache-control: no-cache' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'password: admin' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'username: admin' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-d '{ "input": { "args":"version"} }’&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Regards,&lt;/DIV&gt;
&lt;DIV&gt;Roque&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sconnect-is-installed" style="display: none;"&gt;2.8.0.0&lt;/DIV&gt;
&lt;DIV id="sconnect-is-installed" style="display: none;"&gt;2.8.0.0&lt;/DIV&gt;</description>
    <pubDate>Thu, 14 Feb 2019 21:15:50 GMT</pubDate>
    <dc:creator>rogaglia</dc:creator>
    <dc:date>2019-02-14T21:15:50Z</dc:date>
    <item>
      <title>Exec CLI from NSO REST API for CISCO IOS-XE</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3798408#M3260</link>
      <description>&lt;P&gt;I am trying to use REST API on NSO - to execute exec CLIs like reload or image copy etc.&lt;/P&gt;
&lt;P&gt;I am using Cisco Catalyst Switch with IOS-XE OS and using IOS-XE netconf NED on NSO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not able to find appropriate REST API call to execute this from NSO NB interface.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to execute this using NSO CLI - which works fine :&lt;BR /&gt;&lt;BR /&gt;Entering configuration mode terminal&lt;BR /&gt;admin@ncs(config)# devices device cat9200-sthana&lt;BR /&gt;admin@ncs(config-device-cat9200-sthana)# rpc rpc-license license smart { register { idtoken test-token } }&lt;BR /&gt;&lt;BR /&gt;but on REST API side : what path should i use to execute this RPC ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://127.0.0.1:8080/api/running/devices/device/cat9200-sthana/rpc/_operations" target="_blank"&gt;http://127.0.0.1:8080/api/running/devices/device/cat9200-sthana/rpc/_operations&lt;/A&gt; ?&amp;nbsp;&lt;BR /&gt;and how do i form my JSON object for this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 15:11:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3798408#M3260</guid>
      <dc:creator>santpati</dc:creator>
      <dc:date>2019-02-09T15:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Exec CLI from NSO REST API for CISCO IOS-XE</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3798414#M3261</link>
      <description>&lt;P&gt;I tried this from REST API , but does not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-02-08 at 5.28.20 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/29767i3C44CE16DF669359/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-02-08 at 5.28.20 PM.png" alt="Screen Shot 2019-02-08 at 5.28.20 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 15:19:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3798414#M3261</guid>
      <dc:creator>santpati</dc:creator>
      <dc:date>2019-02-09T15:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Exec CLI from NSO REST API for CISCO IOS-XE</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3801655#M3296</link>
      <description>&lt;P&gt;First of all, I would really recommend that you switch from the old and no longer developing proprietary REST interface to the standard RESTCONF. There are really&amp;nbsp;few reasons to develop code for the non-standard REST interface these days. If you switch, you can also get help, find tools, specifications (RFC 8040) and examples a lot easier.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The path you are using is wrong. Look up the rpc you are looking for in the NED you are using.&amp;nbsp;A trick you can use to find out is to look in the NED's src/ncsc-out/modules/yang and see the complete path there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 09:39:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3801655#M3296</guid>
      <dc:creator>Jan Lindblad</dc:creator>
      <dc:date>2019-02-14T09:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exec CLI from NSO REST API for CISCO IOS-XE</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3802256#M3301</link>
      <description>&lt;P&gt;And using RESTCONF, here an example of a show command action (alu NED). For a NETCONF RPC is not different. Just search the path to the RPC definition and then draft your "input" parameters. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;One tricky thing on RESTCONF that I always miss is that you do not use the prefix of a module but the module name.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;curl -X POST \&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;'&lt;A href="http://127.0.0.1:8080/restconf/data/devices/device=alu0/live-status/tailf-ned-alu-sr-stats:exec/show" target="_blank"&gt;http://127.0.0.1:8080/restconf/data/devices/device=alu0/live-status/tailf-ned-alu-sr-stats:exec/show&lt;/A&gt;'\&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'Authorization: Basic YWRtaW46YWRtaW4='\&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'Content-Type: application/yang-data+json' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'Postman-Token: 5ffb3be3-5556-416e-a10a-1e59e3d82cf4' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'cache-control: no-cache' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'password: admin' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-H 'username: admin' \&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&amp;nbsp;-d '{ "input": { "args":"version"} }’&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Regards,&lt;/DIV&gt;
&lt;DIV&gt;Roque&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sconnect-is-installed" style="display: none;"&gt;2.8.0.0&lt;/DIV&gt;
&lt;DIV id="sconnect-is-installed" style="display: none;"&gt;2.8.0.0&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Feb 2019 21:15:50 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/3802256#M3301</guid>
      <dc:creator>rogaglia</dc:creator>
      <dc:date>2019-02-14T21:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exec CLI from NSO REST API for CISCO IOS-XE</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/4294939#M6123</link>
      <description>&lt;P&gt;&lt;EM&gt;hello that works really we’ll just one question&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;im using iOS xr and I would like to run the following command: run ls -la /&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;I have tried using this&amp;nbsp;&lt;SPAN&gt;d '{ "input": { "args":"run ls -la /"} }’&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;but no luck, I get an error&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&lt;SPAN&gt;can you guys help me with this?&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 14:26:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/exec-cli-from-nso-rest-api-for-cisco-ios-xe/m-p/4294939#M6123</guid>
      <dc:creator>oscsalga</dc:creator>
      <dc:date>2021-02-21T14:26:57Z</dc:date>
    </item>
  </channel>
</rss>

