: Upgrade a Firewall to the Latest PAN-OS Version (API)
Focus
Focus

Upgrade a Firewall to the Latest PAN-OS Version (API)

Table of Contents

Upgrade a Firewall to the Latest PAN-OS Version (API)

You can use the PAN-OS XML API to update your firewall with the latest PAN-OS and Content Release versions.
Because the PAN-OS XML API uses a tree of XML nodes, in your API request you must specify the correct type and action along with the XPath Node Selection. See Explore the API to learn how to construct XML requests.
  1. Download the latest content update.
    Use the following request to first download the latest content update:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<request><content><upgrade><download><latest/></download></upgrade></content></request>'
    If successful, the response contains a
    jobid
    that you can use to check on the status of your request.
    <response status="success" code="19"> <result> <msg> <line>Download job enqueued with jobid 2</line> </msg> <job>2</job> </result> </response>
  2. Check on the content download status.
    Use the
    jobid
    to ensure that the content download completes successfully:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<show><jobs><id>2</id></jobs></show>'
    The response should include the following:
    <response status="success">…
  3. Install the latest content update.
    Use the following request to install the newly downloaded content:
    curl -X POST 'https://<firewall>/api?type=op&cmd<request><content><upgrade><install> <version>latest</version></install></upgrade></content></request>key=<apikey>'
    If successful, the response contains a
    jobid
    that you can use to check on the status of your request.
    <response status="success" code="19"> <result> <msg> <line>Content install job enqueued with jobid 3</line> </msg> <job>3</job> </result> </response>
  4. Check on the content installation status.
    Use the
    jobid
    to ensure that the content installation completes successfully:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<show><jobs><id>3</id></jobs></show>'
    The response should include the following:
    <response status="success">…
  5. Check for the latest PAN-OS software update.
    After installing the latest Content Release update, check for the latest available PAN-OS software updates:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<request><system><software><check></check> </software></system></request>'
    In the response, the first entry is the latest version of PAN-OS:
    <response status="success"> <result> <sw-updates last-updated-at="2015/10/20 14:16:30"> <msg /> <versions> <version>7.1.0</version> <filename>PanOS_3000-7.1.0-c65</filename> <size>720</size> <size-kb>737504</size-kb> <released-on>2015/10/20 13:23:11</released-on> ...
  6. Download the latest PAN-OS software update.
    1. In this case, the latest version is 7.1.0-c65, so download that version:
      curl -X POST 'https://<firewall>/api?type=op&cmd=<request><system><software><download><version>7.1.0-c65</version></download></software></system></request>'
    2. Use the jobid in the response to ensure that the system update download completes successfully:
      curl -X POST 'https://<firewall>/api?type=op&cmd=<show><jobs><id>318</id></jobs></show>'
      The response should include the following:
      <response status="success">…
  7. Install the latest PAN-OS software update.
    To install the latest system update, include the version in a software install request:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<request><system><software><install><version>7.1.0-c65</version></install></software></system></request>'
  8. Check on the software installation status.
    Use the
    jobid
    in the response to ensure that the system update installs successfully:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<show><jobs><id>320</id></jobs></show>'
    The response should include the following:
    <response status="success">…
  9. Reboot the firewall.
    After the system update installs successfully, trigger:
    curl -X POST 'https://<firewall>/api?type=op&cmd=<request><restart><system></system></restart></request>'

Recommended For You