Python Script

Reply
Highlighted
L2 Linker

Python Script

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?

Tags (2)
Highlighted
Cyber Elite

@Brad.Herbert,

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)
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 Live Community as a whole!

The Live Community thanks you for your participation!