<?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: Programatically display device configuration with set format in NS in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4873037#M7947</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Based on the Python&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/nso/api/#!_ncs-maapi/_ncs.maapi.save_config" target="_self"&gt;doc&lt;/A&gt; , you cannot . You can only get&amp;nbsp; normal Junos config without the set .&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can check&amp;nbsp; the example in the install directory (&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;$NCS_DIR/examples.ncs/getting-started/developing-with-ncs/24-layered-service-architecture-scaling/lower-nso-1/packages/device-actions/python/device_action.py)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;that show how to read&amp;nbsp; CDB config from Python&lt;STRONG&gt; ( the function&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;STRONG&gt;recv_all_and_close and&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;read_config).&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can open a new case and ask if the BU could implement it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 13 Jul 2023 06:10:35 GMT</pubDate>
    <dc:creator>Nabsch</dc:creator>
    <dc:date>2023-07-13T06:10:35Z</dc:date>
    <item>
      <title>Programatically display device configuration with set format in NSO</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4832781#M7820</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I can do the following in NSO's ncs_cli:&lt;/P&gt;&lt;P&gt;prompt&amp;gt; show configuration devices device J1 config junos:configuration | display set&lt;/P&gt;&lt;P&gt;I can write shell then in Java program to invoke the shell script:&lt;BR /&gt;ncs_cli -u admin &amp;lt;&amp;lt; END&lt;BR /&gt;show configuration devices device ${DEVNM} config junos:configuration | display set&lt;BR /&gt;exit&lt;BR /&gt;END&lt;/P&gt;&lt;P&gt;But is there any way to do it programmatically without a shell script?&lt;/P&gt;&lt;P&gt;Thx&lt;BR /&gt;sm000x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 17:13:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4832781#M7820</guid>
      <dc:creator>sm000x</dc:creator>
      <dc:date>2023-05-10T17:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4871960#M7945</link>
      <description>&lt;P&gt;Please check these repos in the Cisco Code Exchange:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.cisco.com/codeexchange/search/?products=NSO" target="_blank"&gt;https://developer.cisco.com/codeexchange/search/?products=NSO&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;They ones using Ansible or the NSO API seem promising.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a complete overview, see this repo as well:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.cisco.com/codeexchange/github/repo/juliogomez/netdevops/" target="_self"&gt;https://developer.cisco.com/codeexchange/github/repo/juliogomez/netdevops/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you find what you're looking for.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 19:50:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4871960#M7945</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2023-07-11T19:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4873037#M7947</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Based on the Python&amp;nbsp;&lt;A href="https://developer.cisco.com/docs/nso/api/#!_ncs-maapi/_ncs.maapi.save_config" target="_self"&gt;doc&lt;/A&gt; , you cannot . You can only get&amp;nbsp; normal Junos config without the set .&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can check&amp;nbsp; the example in the install directory (&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;$NCS_DIR/examples.ncs/getting-started/developing-with-ncs/24-layered-service-architecture-scaling/lower-nso-1/packages/device-actions/python/device_action.py)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;that show how to read&amp;nbsp; CDB config from Python&lt;STRONG&gt; ( the function&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;STRONG&gt;recv_all_and_close and&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;read_config).&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You can open a new case and ask if the BU could implement it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 06:10:35 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4873037#M7947</guid>
      <dc:creator>Nabsch</dc:creator>
      <dc:date>2023-07-13T06:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4873153#M7948</link>
      <description>&lt;P&gt;What is the underlying use-case for needing the config in "set"- format?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 08:35:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4873153#M7948</guid>
      <dc:creator>tohagber</dc:creator>
      <dc:date>2023-07-13T08:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4874814#M7951</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/442659"&gt;@tohagber&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I'll provide one person's brief view of why the "display set" option is important.&lt;/P&gt;&lt;P&gt;Like the "formal" parameter that's available for IOS XR's "show running-config formal" command, the Junos "display set" option produces output that provides all the configuration components that make up each command submitted to the device.&lt;/P&gt;&lt;P&gt;This level of detail makes it much easier to compare configuration statements and ensure correctness.&lt;/P&gt;&lt;P&gt;The detail also makes it easier to compare configuration statements and determine differences in the configs of different boxes.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2023 01:36:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4874814#M7951</guid>
      <dc:creator>fracjackmac</dc:creator>
      <dc:date>2023-07-15T01:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4954226#M8187</link>
      <description>&lt;P&gt;I'd echo &lt;STRONG&gt;'it'd be nice to be able to "&lt;EM&gt;show services my-service-abc | display set"&lt;/EM&gt;'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;why?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have hundreds of json requests that create nso service instances in various test cases via restconf.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I'd like to be able to generate (and keep up to date) examples for nso operators&lt;/STRONG&gt;, many of whom enjoy using set commands via CLI, and are accustomed to reviewing these.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;there must be some way to ask nso for this form of output on a service instance get, via RESTConf??&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 13:25:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4954226#M8187</guid>
      <dc:creator>atreyulovesyou</dc:creator>
      <dc:date>2023-11-06T13:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4954261#M8188</link>
      <description>&lt;P&gt;The "show ... | display set" command is implemented in NSO's CLI server, thus when communicating with NSO via restconf or other interfaces the CLI server is not involved hence that pipe command does not exist for other interfaces. &lt;BR /&gt;&lt;BR /&gt;The closest thing (i can think of how atm) is that you could implement an action that takes a path (you want to show) as a parameter&lt;BR /&gt;and the action implementation uses maapi.save_config(..) which has support for providing the result back in different formats, like:&lt;SPAN class="term"&gt;&lt;CODE class="constant"&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;MAAPI_CONFIG_XML&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;The configuration format is XML.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;MAAPI_CONFIG_XML_PRETTY&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;The configuration format is pretty printed XML.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;MAAPI_CONFIG_JSON&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;The configuration is in JSON format.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;MAAPI_CONFIG_J&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;The configuration is in curly bracket Juniper CLI format.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;MAAPI_CONFIG_C&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;The configuration is in Cisco XR style format.&lt;BR /&gt;... &lt;BR /&gt;&lt;/FONT&gt;&lt;SPAN class="term"&gt;&lt;CODE class="constant"&gt;&lt;/CODE&gt;To return that back from the action. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 14:32:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4954261#M8188</guid>
      <dc:creator>tohagber</dc:creator>
      <dc:date>2023-11-06T14:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically display device configuration with set format in NS</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4954277#M8189</link>
      <description>&lt;P&gt;Hi, Tohagber:&lt;BR /&gt;&lt;BR /&gt;Thank you for this suggestion. I will give it a try.&lt;BR /&gt;&lt;BR /&gt;THX&lt;BR /&gt;sm000x&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 14:51:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/programatically-display-device-configuration-with-set-format-in/m-p/4954277#M8189</guid>
      <dc:creator>sm000x</dc:creator>
      <dc:date>2023-11-06T14:51:17Z</dc:date>
    </item>
  </channel>
</rss>

