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.
  1. Download the latest content update.
    Use the following request to first download the latest content update:
    curl -X GET 'https://<firewall>/api/?type=op&cmd=<request><content><upgrade><download><latest/> 
    </download></upgrade></content></request>&key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    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>
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  2. Check on the content download status.
    Use the jobid to ensure that the content download completes successfully:
    curl -X GET 'https://<firewall>/api/?type=op&action=get&job-id=2&key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    The response should include the following:
    <response status="success">…
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  3. Install the latest content update.
    Use the following request to install the newly downloaded content:
    curl -X GET 'https://<firewall>/api/?type=op&cmd<request><content><upgrade><install> <version>latest</version></install></upgrade></content></request>key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    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>
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  4. Check on the content installation status.
    Use the jobid to ensure that the content installation completes successfully:
    curl -X GET 'https://<firewall>/api/?type=op&action=get&job-id=3&key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    The response should include the following:
    <response status="success">…
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  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 GET 'https://<firewall>/api/?type=op&cmd=<request><system><software><check></check> 
    </software></system></request>&key=<apikey>' 
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    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> 
    ... 
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  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 GET 'https://<firewall>/api/?type=op&cmd=<request><system><software><download><version>7.1.0 
      -c65</version></download></software></system></request>&key=<apikey>' 
      Code copied to clipboard
      Unable to copy due to lack of browser support.
    2. Use the jobid in the response to ensure that the system update download completes successfully:
      curl -X GET 'https://<firewall>/api/?type=op&action=get&job-id=318&key=<apikey>'
      Code copied to clipboard
      Unable to copy due to lack of browser support.
      The response should include the following:
      <response status="success">…
      Code copied to clipboard
      Unable to copy due to lack of browser support.
  7. Install the latest PAN-OS software update.
    To install the latest system update, include the version in a software install request:
    curl -X GET 'https://<firewall>/api/?type=op&cmd=<request><system><software><install><version>7.1.0-c65</version></install></software></system></request>&key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  8. Check on the software installation status.
    Use the jobid in the response to ensure that the system update installs successfully:
    curl -X GET 'https://<firewall>/api/?type=op&action=get&job-id=320&key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.
    The response should include the following:
    <response status="success">…
    Code copied to clipboard
    Unable to copy due to lack of browser support.
  9. Reboot the firewall.
    After the system update installs successfully, trigger:
    curl -X GET 
    'https://<firewall>/api/?type=op&cmd=<request><restart><system></system></restart> 
    </request>&key=<apikey>'
    Code copied to clipboard
    Unable to copy due to lack of browser support.

Related Documentation