<?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: Officially supported method for Panorama backup through API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457945#M2879</link>
    <description>&lt;P&gt;Thanks for your reply, here is my real issue though. B&lt;SPAN&gt;ecause of the log4j we had to move to 9.1.12-h3, but that broke &lt;/SPAN&gt;&lt;SPAN&gt;the Schedule Config export. So I'd like to be able to automate the backup and export of the Panorama config because it still works via command line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can manually log into the Panorama via cli and run "scp export config-bundle to" the problem is, how do I automate that?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2022 15:30:16 GMT</pubDate>
    <dc:creator>RobertShawver</dc:creator>
    <dc:date>2022-01-11T15:30:16Z</dc:date>
    <item>
      <title>Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218102#M1696</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Team,&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's look like there are 2 methods for Panorama backup through API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;curl -o {{server_backup_file}} -k https://{{Panorama_IP_@}}/api/?type=export&amp;amp;category=configuration&amp;amp;key={{Panorama_API_key&amp;gt;}}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;curl -k https://{{Panorama_IP_@}}/api/?type=op&amp;amp;cmd=&amp;lt;save&amp;gt;&amp;lt;config&amp;gt;&amp;lt;to&amp;gt;{{Panorama_backup_file}}&amp;lt;/to&amp;gt;&amp;lt;/config&amp;gt;&amp;lt;/save&amp;gt;&amp;amp;key={{Panorama_API_key}}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then retrieve the file through SCP&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the outputs look different:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[admin@elkrsg01 ~]$ file backup*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;backup_API80.xml: UTF-8 Unicode text, with very long lines&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;backup_SCP80.xml: XML 1.0 document, ASCII text&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[admin@elkrsg01 ~]$ wc -lwc backup*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1112 1439 126998 backup_API80.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3986 4313 177296 backup_SCP80.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5098 5752 304294 total&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Customer would like to know which method is fully supported?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sam Prabhu&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 22:14:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218102#M1696</guid>
      <dc:creator>sprabhu</dc:creator>
      <dc:date>2018-06-15T22:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218128#M1697</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/40442"&gt;@sprabhu&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Does it need to be done by an API call? If not, probably the best way is the scheduled config export (&lt;A href="https://www.paloaltonetworks.com/documentation/80/pan-os/web-interface-help/panorama-web-interface/panorama-scheduled-config-export" target="_blank"&gt;https://www.paloaltonetworks.com/documentation/80/pan-os/web-interface-help/panorama-web-interface/panorama-scheduled-config-export&lt;/A&gt; ). This way panorama daily saves the panorama configuration and all the configurations of the managed firewalls to an SCP or FTP server.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 10:17:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218128#M1697</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2018-06-16T10:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218129#M1698</link>
      <description>&lt;P&gt;With the API I would use the export which you already mentionned or this one for the panorama config:&lt;/P&gt;&lt;PRE&gt;https://PANORAMA/api/?type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;config&amp;gt;&amp;lt;running&amp;gt;&amp;lt;%2Frunning&amp;gt;&amp;lt;%2Fconfig&amp;gt;&amp;lt;%2Fshow&amp;gt;&lt;/PRE&gt;&lt;P&gt;And the running config of the firewalls with the same save command but add this to the url to get the firewall running config:&lt;/P&gt;&lt;PRE&gt;&amp;amp;target=&amp;lt;device-serial-number&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 10:18:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218129#M1698</guid>
      <dc:creator>Remo</dc:creator>
      <dc:date>2018-06-16T10:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218726#M1711</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Since they plan to automate the solution with API, they'd like to do all things by API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SCP or FTP scheduling on Panorama is not an option. They want to trigger by an orchestration server the backup.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;They just need to know which command is the best and if there is some issue later be sure that it will be supported.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sam Prabhu&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:55:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/218726#M1711</guid>
      <dc:creator>sprabhu</dc:creator>
      <dc:date>2018-06-21T14:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457815#M2877</link>
      <description>&lt;P&gt;Sorry to hit the way-back machine on this post, but I need to do this and have no idea how to start.&amp;nbsp; Can anyone step me though it?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 18:04:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457815#M2877</guid>
      <dc:creator>RobertShawver</dc:creator>
      <dc:date>2022-01-10T18:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457921#M2878</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/155683"&gt;@RobertShawver&lt;/a&gt;&amp;nbsp;The API docs can be found here: &lt;A href="https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-panorama-api.html," target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-panorama-api.html,&lt;/A&gt; and specifically the export request type of API call here:&amp;nbsp;&lt;A href="https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-panorama-api/pan-os-xml-api-request-types/export-files-api.html" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-panorama-api/pan-os-xml-api-request-types/export-files-api.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 10:19:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457921#M2878</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-01-11T10:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457945#M2879</link>
      <description>&lt;P&gt;Thanks for your reply, here is my real issue though. B&lt;SPAN&gt;ecause of the log4j we had to move to 9.1.12-h3, but that broke &lt;/SPAN&gt;&lt;SPAN&gt;the Schedule Config export. So I'd like to be able to automate the backup and export of the Panorama config because it still works via command line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can manually log into the Panorama via cli and run "scp export config-bundle to" the problem is, how do I automate that?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 15:30:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/457945#M2879</guid>
      <dc:creator>RobertShawver</dc:creator>
      <dc:date>2022-01-11T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/458072#M2880</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/155683"&gt;@RobertShawver&lt;/a&gt;&amp;nbsp;First things first, ensure you have logged a ticket to get Scheduled Config Export investigated and fixed, let's make sure the root cause of the problem gets fixed.&lt;BR /&gt;&lt;BR /&gt;Meanwhile, if you just want to automate/mimic the behaviour of a human logging in via SSH to the CLI and performing commands, you could look into using "expect" in a simple script:&amp;nbsp;&lt;A href="https://www.google.com/search?q=ssh+expect+script&amp;amp;oq=ssh+expect+script" target="_blank"&gt;https://www.google.com/search?q=ssh+expect+script&amp;amp;oq=ssh+expect+script&lt;/A&gt;. You could run that script regularly using cron or something similar. Other methods to do the same thing are available in different programming languages too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you are going to need a regularly executing script, I would argue that using the API would be much cleaner than an expect script. Here is a very simple example below, &lt;STRONG&gt;AND PLEASE NOTE&lt;/STRONG&gt; that API keys should be treated much more securely than shown in the example here where the API key is stored/hardcoded in a script, please use a vault or something similar to securely store credentials!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#!/bin/bash

# Variables
host="1.1.1.1"
key="your-PANOS-API-key-here"
filename="exported-running-config.xml"

# Export running config file
curl -k "https://$host/api/?key=$key&amp;amp;type=config&amp;amp;action=show" &amp;gt; $filename
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 21:03:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/458072#M2880</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-01-11T21:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Officially supported method for Panorama backup through API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/458414#M2882</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; The "fix" is coming with 9.1.13, but I'll wait till it's "preferred" before jumping on it only to find out that version breaks something else.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 16:13:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/officially-supported-method-for-panorama-backup-through-api/m-p/458414#M2882</guid>
      <dc:creator>RobertShawver</dc:creator>
      <dc:date>2022-01-12T16:13:14Z</dc:date>
    </item>
  </channel>
</rss>

