<?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: Python updateDeviceSwitchPort get data from and exported JSON in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/python-updatedeviceswitchport-get-data-from-and-exported-json/m-p/5437246#M5930</link>
    <description>&lt;P&gt;Nevermind I found how to do that&lt;/P&gt;</description>
    <pubDate>Fri, 22 May 2020 12:28:41 GMT</pubDate>
    <dc:creator>damienleick1</dc:creator>
    <dc:date>2020-05-22T12:28:41Z</dc:date>
    <item>
      <title>Python updateDeviceSwitchPort get data from and exported JSON</title>
      <link>https://community.cisco.com/t5/network-platform-api/python-updatedeviceswitchport-get-data-from-and-exported-json/m-p/5437245#M5929</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;here is my question&lt;/P&gt;&lt;P&gt;Actually a i made a python script to export a full ports configuration of switch, stored those json data and i would like to uses those data tu push ports configuration to another switch of the same model &lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;serial = &lt;/SPAN&gt;&lt;SPAN&gt;input&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Enter the serial number of the switch to backup: '&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Switch_export = dashboard.switch_ports.getDeviceSwitchPorts(serial)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt; (Switch_export)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;The switch port information has been stored'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;serial2 = &lt;/SPAN&gt;&lt;SPAN&gt;input&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Please enter de serial of the destination switch : "&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;i=&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; port &lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt; Switch_export:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    Switch_import = dashboard.switch_ports.updateDeviceSwitchPort(serial2, i, )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;    i = i+&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'The switch port information has been restored'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;Because API doenst purpose to pussh all the configuration with one command i need to do a for with JSON data&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Is there any possibilty to use json data port value of "Switch_export" in the "Switch_imports" arguments without need to use a Csv reader ?&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;thanks&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 May 2020 15:27:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/python-updatedeviceswitchport-get-data-from-and-exported-json/m-p/5437245#M5929</guid>
      <dc:creator>damienleick1</dc:creator>
      <dc:date>2020-05-21T15:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Python updateDeviceSwitchPort get data from and exported JSON</title>
      <link>https://community.cisco.com/t5/network-platform-api/python-updatedeviceswitchport-get-data-from-and-exported-json/m-p/5437246#M5930</link>
      <description>&lt;P&gt;Nevermind I found how to do that&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 12:28:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/python-updatedeviceswitchport-get-data-from-and-exported-json/m-p/5437246#M5930</guid>
      <dc:creator>damienleick1</dc:creator>
      <dc:date>2020-05-22T12:28:41Z</dc:date>
    </item>
  </channel>
</rss>

