cdot65 / pan-os-upgrade

An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
https://cdot65.github.io/pan-os-upgrade/
Apache License 2.0
39 stars 7 forks source link

Implement tech-support file generation and download using PAN-OS SDK #132

Open cdot65 opened 4 months ago

cdot65 commented 4 months ago

Is your feature request related to a problem? Please describe. When troubleshooting or investigating issues related to PAN-OS upgrades using the pan-os-upgrade utility, having access to the tech-support file from the firewall can provide valuable information and assist in the debugging process. Currently, the utility does not have a built-in mechanism to generate and download the tech-support file using the PAN-OS SDK, which may require users to manually log in to the CLI and retrieve the file separately.

Describe the solution you'd like Enhance the pan-os-upgrade utility to include the ability to generate and download a tech-support file from the firewall using the PAN-OS SDK. The utility should:

  1. Provide a command or option to initiate the tech-support file generation process.
  2. Use the PAN-OS SDK to execute the equivalent of the request tech-support dump command on the firewall.
  3. Track the progress of the tech-support file generation using the SDK's job monitoring capabilities, similar to the show jobs all or show jobs id <job id> command.
  4. Periodically poll the job status using the SDK to determine when the tech-support file generation is complete.
  5. Once the tech-support file is ready, retrieve the file from the firewall using the appropriate SDK methods for file retrieval.
  6. Download the tech-support file to a specified location on the local machine or a remote server.
  7. Provide feedback to the user about the success or failure of the tech-support file generation and download process.
  8. Optionally, include the ability to automatically generate and download tech-support files before and after the upgrade process for comprehensive troubleshooting.

Describe alternatives you've considered An alternative approach could be to use the PAN-OS XML API directly instead of the SDK. However, using the SDK provides a more abstracted and convenient interface, reducing the complexity of handling XML requests and responses directly.

Additional context Here are a few additional points to consider:

By implementing this feature using the PAN-OS SDK, the pan-os-upgrade utility will provide a seamless and automated way to generate and download tech-support files from the firewall without requiring users to interact with the device CLI directly. This will ensure a more controlled and secure process, while still offering the benefits of quick access to relevant troubleshooting information.