CLI
Focus
Focus
Next-Generation Firewall

CLI

Table of Contents

CLI

Use an SSH client or terminal to access your firewall or Panorama CLI.
You can use the debug mode to see the underlying XML API requests used for the PAN-OS appliance.
Enter the following command to activate debug mode:
debug cli on
					
Running a CLI command, will give you the syntax for the XML API equivalent. For example the command,
test url http://paloaltonetworks.com
Returns the following:
<request cmd="op" cookie="7581536015878829" uid="1206"><operations><test><url>http://paloaltonetworks.com</url></test></operations></request>
The first part of the query corresponds to the command type. With the response, you can formulate the corresponding XML call, like so:
https://<firewall>/api/?type=op&cmd=<test><url>http://paloaltonetworks.com</url></test>&key=<apikey>
Depending on the CLI command, the XML tag values forcmd will vary. For example, here is a CLI command for showing firewall information:run show system info
The corresponding API call looks like this:
curl -X POST 'https://firewall/api?type=op&cmd=<show><system><info></info></system></show>&key=<apikey>"