How to upgrade firmware on Gen7 firewall with API tool?

Description

Postman is a platform for API development. Since Gen7 firewalls use API, we can use Postman to upgrade firmware with API. More information about Postman can be found in the following link:https://www.postman.com/product/what-is-postman/

NOTE: Same version of firmware can not be upgraded via API. For example, SonicOS 7.0.1-5018-R1709: its firmware version is 7.0.1-5018. This version may have different minor releases, but as long as its name starts with 7.0.1-5018, then its firmware version is 7.0.1-5018. SonicOS 7.0.1-5030-R2007-H17127-540: firmware version is 7.0.1-5030. 

NOTE: The upgrade is one firewall at a time. But we can use variables to quickly change the target firewall IP address in order to upgrade next firewall. Example on upgrading firmware on TZ570 from 7.0.1-5030 to 7.0.1-5050.


Current firewall firmware:

Image


Configured Postman:


Image


Steps:

  • Create a folder, example called “Gen 7 firmware upgrade’, define Variables, including IP, PORT, and baseUrl, and Save the settings:

    IP: 10.67.10.70 (Is FW IP)
    PORT: 443 (is MGMt port of the FW)
    baseUrl to be: https://{{IP}}:{{PORT}}/api/sonicos

    Here the IP can be changed easily to upgrade next firewall.

    Image

  • Navigate to Auth_API. POST section has the variables:  {{baseUrl}}/auth

    Image

    In Body section, enter username and password. Then click Send:

    Image

    It returned “bearer_token”:

    Image

    Copy/paste the token at “Gen 7 firmware upgrade” folder under Authorization, click Save:

    Image


  • Next API “Go to Config mode”. The API call is: {{baseUrl}}/config-mode.  Its type should be “Inherit auth from parent”:

    Image

    Click Send, it returned success, the firewall is in Config Mode:

    Image


  • Next API call “upload firmware”: {{baseUrl}}/import/firmware

    The Authorization is still “Inherit auth from parent”:
    Image

    In Headers section, Content-Type has to be: Multipart/form-data; boundary=<calculated when request is sent> along with that we need Content-length value needs to set as <calculated when request is sent>
    Image

    At Body, need to enter KEY to be  “firmware”, VALUE to select “File”

    Image

    Click “Select Files” will prompt to select the firmware version 7.0.1-5050:

    Image

    CONTENT TYPE to be: application/octet-stream:

    Image

    Click on “Send”. It will take several minutes depending on file size. Here are the results:

    Image


  • Next API “boot with uploaded firmware”: {{baseUrl}}/boot/uploaded

    No need to add or change any value here. Click Send

    TIP: Send button is shadowed under "No new changes to save".

    Image

    It returned message “Success” and Restarting now.

    Image




    Logging into firewall, confirmed the firmware has been upgraded to 7.0.1-5050:

    Image

Related Articles

  • Analytics On-Prem vs NSM Feature Matrix
    Read More
  • Analytics On-Prem End of Life and NSM Transition FAQ
    Read More
  • NSM On-Prem: Backups over SCP to Windows OpenSSH Server
    Read More
not finding your answers?