Python Script

Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python Script

L2 Linker

From Pan-OS 8.0 - 8.1.6, there is a bug when using FQDN's in rule sets.  Until we're ready to upgrade, I need to run a script to force a FQDN refresh, cli is "request system fqdn refresh force yes".  I'm really new to Python, but have created my API Keys.  Anyone have some guidance to pass along on how I can build this script?


Cyber Elite
Cyber Elite


You could do this easiest with a simple requests script through the XML API. Something like the below would work

import requests
key = 'ReplaceWithAPIKey'
firewall = 'ReplaceWithFirewall'
request_refresh = requests.get('https://' + str(firewall) + '/api/?type=op&cmd=<request><system><fqdn><refresh></refresh></fqdn></system></request>&key=' + str(key), verify=False)
  • 1 replies
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!