<?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 When I use the API to pull the device-state - am I getting the latest device state? in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/when-i-use-the-api-to-pull-the-device-state-am-i-getting-the/m-p/306187#M2130</link>
    <description>&lt;P&gt;In another article here, from 2014 (precambrian issues) - they broke down some of the insides of the device state config backup.&lt;/P&gt;&lt;P&gt;One of the commands listed said that I should issue the "save device state" command from the config cli - only - it's no longer there.&lt;/P&gt;&lt;P&gt;My script worked brilliantly for pulling the configs down on my Mac - just want to make sure I'm getting valid configs and don't have to do something else to get these accurately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;echo "Building list of firewalls to collect from panorama"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;curl -X GET 'https://panorama/api/?type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;devices&amp;gt;&amp;lt;all&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/devices&amp;gt;&amp;lt;/show&amp;gt;&amp;amp;key=Your_API_Key_Here=' -o devices.xml&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;xmllint --format devices.xml | grep -e "&amp;lt;ip-address&amp;gt;" | sed "s/ip-address//g;s/\&amp;lt;//g;s/\&amp;gt;//g;s/\///g;s/ //g" &amp;gt; iplist.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo "Pulling device-state backups from all firewalls"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;filename="iplist.txt"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;while IFS= read fw;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;do&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;curl -k -X GET 'https://'$fw'/api/?type=export&amp;amp;category=device-state&amp;amp;key=Your_API_Key_Here=' -o device_state_cfg-$fw.tgz&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;done &amp;lt; "$filename"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 19:51:10 GMT</pubDate>
    <dc:creator>josilvia</dc:creator>
    <dc:date>2020-01-09T19:51:10Z</dc:date>
    <item>
      <title>When I use the API to pull the device-state - am I getting the latest device state?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/when-i-use-the-api-to-pull-the-device-state-am-i-getting-the/m-p/306187#M2130</link>
      <description>&lt;P&gt;In another article here, from 2014 (precambrian issues) - they broke down some of the insides of the device state config backup.&lt;/P&gt;&lt;P&gt;One of the commands listed said that I should issue the "save device state" command from the config cli - only - it's no longer there.&lt;/P&gt;&lt;P&gt;My script worked brilliantly for pulling the configs down on my Mac - just want to make sure I'm getting valid configs and don't have to do something else to get these accurately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;echo "Building list of firewalls to collect from panorama"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;curl -X GET 'https://panorama/api/?type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;devices&amp;gt;&amp;lt;all&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/devices&amp;gt;&amp;lt;/show&amp;gt;&amp;amp;key=Your_API_Key_Here=' -o devices.xml&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;xmllint --format devices.xml | grep -e "&amp;lt;ip-address&amp;gt;" | sed "s/ip-address//g;s/\&amp;lt;//g;s/\&amp;gt;//g;s/\///g;s/ //g" &amp;gt; iplist.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;echo "Pulling device-state backups from all firewalls"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;filename="iplist.txt"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;while IFS= read fw;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;do&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;curl -k -X GET 'https://'$fw'/api/?type=export&amp;amp;category=device-state&amp;amp;key=Your_API_Key_Here=' -o device_state_cfg-$fw.tgz&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;done &amp;lt; "$filename"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 19:51:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/when-i-use-the-api-to-pull-the-device-state-am-i-getting-the/m-p/306187#M2130</guid>
      <dc:creator>josilvia</dc:creator>
      <dc:date>2020-01-09T19:51:10Z</dc:date>
    </item>
  </channel>
</rss>

