How To Import and Install Content via API From a UNIX Server

How To Import and Install Content via API From a UNIX Server

Created On 04/19/19 09:32 AM - Last Modified 09/22/22 18:10 PM

This document describes the steps to manually install the content updates on the Palo Alto Networks firewall via API and for users whose device can't download files from update server. If your device can access the update server and download files, please refer to the following article: Upgrade a Firewall to the Latest PAN-OS Version (API).

The update files can be downloaded by logging into the Palo Alto Networks Customer Support Portal and clicking Dynamic Updates under the RESOURCES section.

Screen Shot 2014-02-04 at 5.47.55 PM.png


STEP 1: Generate the API key by entering the following URL in the browser:
https://<FW IPaddress>/api/?type=keygen&user=<username>&password=<password>

Command sample:

Result sample:
<response status="success">

STEP 2: Run the following command on the UNIX server in order to upload update file:
curl -s -k -F file=@<file name> "https://<FW IPaddress>/api/?type=import&category=content&key=<API Key>"

Command sample:
curl -s -k -F file=@panupv2-all-contents-8144-5408 ""

Result sample:
<response status="success"><msg><line>panupv2-all-contents-8144-5408 saved</line></msg></response>

STEP 3: Run the following command on the UNIX server in order to install uploaded file:
curl -s -k "https://<FW IPaddress>/api/?type=op&cmd=<request><content><upgrade><install><file><file name></file></install></upgrade></content></request>&key=<API Key>"

Command sample:
curl -s -k "<request><content><upgrade><install><file>panupv2-all-contents-8144-5408</file></install></upgrade></content></request>&key=LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERUQT09"

Result sample:
<response status="success" code="19"><result><msg><line>Content install job enqueued with jobid 2</line></msg><job>2</job></result></response>

STEP 4: Run the following command on the UNIX server in order to check the result:
curl -s -k "https://<FW IPaddress>/api/?type=op&cmd=<show><jobs><id><id number></id></jobs></show>&key=<API Key>"

Command sample:
curl -s -k "<show><jobs><id>2</id></jobs></show>&key=LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERUQT09"

Result sample:
<response status="success"><result><job><tenq>2019/04/25 10:57:42</tenq><tdeq>10:57:42</tdeq><id>2</id><user>admin</user><type>Content</type><status>FIN</status><queued>NO</queued><stoppable>no</stoppable><result>OK</result><tfin>10:59:04</tfin><description></description><positionInQ>0</positionInQ><progress>10:59:04</progress><details><line>Configuration committed successfully</line><line>Successfully committed last configuration</line></details><warnings></warnings></job></result></response>


Additional Information
For additional information about Using Web Browser, please refer to this article: How to Manually Install Antivirus, Content, and WildFire Updates on the Firewall.

For additional information on how to use the API browser, please refer to this article: Use the API Browser.

You can update antivirus and WildFire in the same way. It is necessary that API request should be converted for each file. Please refer to this URL if you need detailed Rest API URL.

  • Print
  • Copy Link