### PAN-OS XML API GET Request Example Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/about-the-pan-os-xml-api/structure-of-a-pan-os-xml-api-request Use a GET request for queries under 2KB when passing strings in the URL. This example demonstrates a keygen request with username and password. ```http GET /api/?type=keygen&user=&password= ``` -------------------------------- ### List Resource Example (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api Use the GET method with the 'location' and 'output-format' query parameters to list resources. ```HTTP GET https:///restapi/v11.0/?location=location&output-format=json ``` -------------------------------- ### Example PAN-OS API Key Usage Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/pan-os-api-authentication/generate-an-api-key-certificate This example demonstrates how to use an API key in subsequent requests using the X-PAN-KEY header. Ensure you replace '* * *' with your actual API key. ```bash curl -X POST 'https://firewall/api?&type=config&action=get&xpath=/config/devices/entry[@name=%27localhost.localdomain%27]/network/interface/ethernet' -H 'X-PAN-KEY: ************************' ``` -------------------------------- ### PAN-OS REST API Request Example Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/pan-os-rest-api-request-response-structure This is a general example of a GET request to a PAN-OS REST API endpoint. It shows the base path, resource URI, and query parameters. ```bash curl -X GET "https:///restapi//?request body" ``` -------------------------------- ### Partial Virtual Router Response Example Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/update-a-virtual-router-rest-api A successful GET request returns detailed information about virtual routers. This example shows a partial response, highlighting the 'interface.member' list which is crucial for update requests. ```json { "@status": "success", "@code": "19", "result": { "@count": "1", "entry": [ { "@name": "default", "@location": "panorama-pushed", "interface": { "member": [ "ethernet1/4" ], "routing-table": {}, "protocol": {}, "admin-dists": {}, "ecmp": {} } } ] } } ``` -------------------------------- ### Create Resource Example (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api Use the POST method with 'location' and 'name' query parameters to create a new resource. ```HTTP POST https:///restapi/v11.0/?location=location&name=name ``` -------------------------------- ### PAN-OS XML API Request Example Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/about-the-pan-os-xml-api/structure-of-a-pan-os-xml-api-request/xml-and-xpath This example demonstrates a basic POST request to the PAN-OS XML API to retrieve security rules. Remember to replace placeholder values with your actual firewall/Panorama IP/hostname and API key. ```curl curl -X POST 'https://firewall/api?type=config&action=show&key=&xpath=/config/devices/entry/vsys/entry/rulebase/security' ``` -------------------------------- ### PAN-OS XML API POST Request Example Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/about-the-pan-os-xml-api/structure-of-a-pan-os-xml-api-request Use a POST request for larger data (2KB-5MB) or non-ASCII characters, such as importing files. This example shows login credentials in the request body. ```http POST /api/ HTTP/1.1 Content-Type: application/x-www-form-urlencoded password=&user=&type=keygen ``` -------------------------------- ### Create or Update a Security Policy Rule Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/create-security-policy-rule-rest-api This example demonstrates how to create and update a Security policy rule using the PAN-OS REST API. It's a foundational example for understanding policy management via the API and can be adapted for other policy types. ```APIDOC ## POST /api/v1/policies/security ### Description Creates a new security policy rule or updates an existing one on the firewall. ### Method POST ### Endpoint /api/v1/policies/security ### Parameters #### Request Body - **rule** (object) - Required - The security policy rule object to create or update. - **name** (string) - Required - The name of the security policy rule. - **description** (string) - Optional - A description for the security policy rule. - **tags** (array) - Optional - A list of tags associated with the rule. - **source-zone** (array) - Required - List of source security zones. - **destination-zone** (array) - Required - List of destination security zones. - **source-ip** (array) - Required - List of source IP addresses or objects. - **destination-ip** (array) - Required - List of destination IP addresses or objects. - **application** (array) - Required - List of applications. - **service** (array) - Required - List of services. - **action** (string) - Required - The action to take for traffic matching this rule (e.g., 'allow', 'deny', 'drop'). - **disabled** (boolean) - Optional - Whether the rule is disabled. ### Request Example ```json { "rule": { "name": "Example-Rule", "description": "Rule to allow web traffic from internal to external", "tags": ["web-access", "production"], "source-zone": ["trust"], "destination-zone": ["untrust"], "source-ip": ["192.168.1.0/24"], "destination-ip": ["any"], "application": ["web-browsing"], "service": ["application-default"], "action": "allow", "disabled": false } } ``` ### Response #### Success Response (200 OK) - **message** (string) - Indicates the success of the operation. - **code** (integer) - The response code, typically 0 for success. #### Response Example ```json { "message": "success", "code": 0 } ``` ``` -------------------------------- ### Create a Security Zone Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/configure-a-security-zone-rest-api This example demonstrates how to create a new security zone on Panorama, including specifying Ethernet and virtual SD-WAN interfaces. ```APIDOC ## Create a Security Zone ### Description Creates a new security zone on Panorama, allowing for the inclusion of various network interface types. ### Method POST ### Endpoint `/restapi/v11.0/network/zones?location=template&template=` ### Parameters #### Query Parameters - **location** (string) - Required - Specifies the location for the configuration (e.g., `template`). - **template** (string) - Required - The name of the template to which the zone will be added. #### Request Body - **entry** (object) - Required - Contains the details of the security zone to be created. - **@name** (string) - Required - The name of the security zone. - **enable-user-identification** (string) - Optional - Enables or disables user identification for the zone (`yes` or `no`). - **network** (object) - Required - Defines the network properties of the zone. - **layer3** (object) - Required - Specifies Layer 3 network settings. - **member** (array of strings) - Required - A list of interface names to be included in the zone. ### Request Example ```json { "entry": { "@name": "Untrust", "enable-user-identification": "no", "network": { "layer3": { "member": [ "ethernet1/1", "ethernet1/2", "ethernet1/3", "sdwan.1" ] } } } } ``` ### Response #### Success Response (200) Details of the created security zone (structure not explicitly defined in source, but implies success confirmation). ``` -------------------------------- ### Construct API Call for System Info Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-cli-to-find-xml-api-syntax This example demonstrates constructing a 'curl' command for a type=op API call to retrieve system information, based on the 'show system info' CLI command. ```bash curl -X POST 'https://firewall/api?type=op&cmd=&key=" ``` -------------------------------- ### Run CLI Command and Get XML Response Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-cli-to-find-xml-api-syntax Execute a CLI command after enabling debug mode to receive the corresponding XML and XPath in the response. This example shows a test URL command. ```bash test url http://paloaltonetworks.comhttp://paloaltonetworks.com ``` -------------------------------- ### Generate API Key with Keygen Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/pan-os-api-authentication/generate-an-api-key-certificate This example shows how to generate a new API key using the type=keygen parameter. The generated key will be encrypted using the configured API Key Certificate. ```bash curl -H "Content-Type: application/x-www-form-urlencoded" -X POST https://firewall/api/?type=keygen -d 'user=&password=' ``` -------------------------------- ### Create and Configure Virtual SD-WAN Interface Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/configure-virtual-sd-wan-interface-rest-api Creates a virtual SD-WAN interface and assigns member Ethernet interfaces. This example includes two Ethernet interfaces as members. ```curl curl -X POST 'https:///restapi/v9.1/network/sdwanInterfaces?location=template&template=SDWAN-Branch-Network&name=sdwan.1' -H 'X-PAN-KEY: -d '{ "entry": { "@name": "sdwan.1", "interface": { "member": [ "ethernet1/3", "ethernet1/4" ] } } }' ``` -------------------------------- ### Rename Resource Example (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api Use the POST method with 'location', 'name', and 'newname' query parameters to rename a resource. ```HTTP POST https:///restapi/v11.0/:rename?location=location&name=name &newname=newname ``` -------------------------------- ### Edit Resource Example (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api Use the PUT method with 'location' and 'name' query parameters to modify an existing resource. ```HTTP PUT https:///restapi/v11.0/?location=location&name=name ``` -------------------------------- ### Update a Security Zone Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/configure-a-security-zone-rest-api This example shows how to update an existing security zone by adding a new Ethernet interface, ensuring existing configurations are preserved. ```APIDOC ## Update a Security Zone ### Description Updates an existing security zone by adding or modifying its associated network interfaces. It is recommended to first retrieve the current zone configuration to avoid data loss. ### Method PUT ### Endpoint `/restapi/v11.0/network/zones?location=vsys&vsys=&name=` ### Parameters #### Query Parameters - **location** (string) - Required - Specifies the location for the configuration (e.g., `vsys`). - **vsys** (string) - Required - The name of the virtual system. - **name** (string) - Required - The name of the security zone to update. #### Request Body - **entry** (object) - Required - Contains the updated details of the security zone. - **@name** (string) - Required - The name of the security zone. - **enable-device-identification** (string) - Optional - Enables or disables device identification. - **enable-user-identification** (string) - Optional - Enables or disables user identification. - **network** (object) - Required - Defines the network properties of the zone. - **layer3** (object) - Required - Specifies Layer 3 network settings. - **member** (array of strings) - Required - A list of interface names to be included in the zone. Ensure all existing members are included. ### Request Example ```json { "entry": { "@name": "test", "enable-device-identification": "no", "enable-user-identification": "no", "network": { "layer3": { "member": [ "ethernet1/4", "ethernet1/3" ] } } } } ``` ### Response #### Success Response (200) Indicates the security zone was successfully updated. Specific response body details are not provided in the source. ``` -------------------------------- ### Create a Security Policy Rule (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/pan-os-rest-api Instructions and examples for creating new security policy rules using the PAN-OS REST API. ```APIDOC ## Create a Security Policy Rule (REST API) Use the following endpoint to create a security policy rule. **Endpoint:** `/api/v1/policies/securityrules` **Method:** POST **Request Body Example:** ```json { "name": "Allow-Web-Traffic", "source-zone": ["trust", "untrust"], "destination-zone": ["untrust", "trust"], "application": ["web-browsing", "ssl"], "service": ["service-http", "service-https"], "action": "allow" } ``` ``` -------------------------------- ### Import Ethernet Interface into Virtual System (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/configure-ethernet-interface-rest-api Imports a configured Ethernet interface into a specified virtual system (vsys). This example adds ethernet1/3 to vsys1. ```bash curl -X POST https:///restapi/v11.0/device/virtualsystems?name=vsys1' \ -H 'X-PAN-KEY: \ -d { "entry": [ { "@name": "vsys1", "import": { "network": { "interface": { "member": [ "ethernet1/3" ] } } } } ] } ``` -------------------------------- ### Create a Security Policy Rule Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/create-security-policy-rule-rest-api Creates a new security policy rule. This example demonstrates creating a rule named 'rule-example1' in 'vsys1' that allows traffic matching the 'email-collaboration-apps' application object. ```APIDOC ## POST /restapi/v11.0/Policies/SecurityRules ### Description Creates a Security policy rule. This example defines a rule named 'rule-example1' within 'vsys1' that allows traffic from 'zone-edge1' to 'any' destination, using the 'application-default' service, and permits the 'email-collaboration-apps' application. ### Method POST ### Endpoint `/restapi/v11.0/Policies/SecurityRules?location=vsys&vsys=vsys1&name=rule-example1` ### Parameters #### Query Parameters - **location** (string) - Required - Specifies the location of the rule (e.g., 'vsys'). - **vsys** (string) - Required - The virtual system name (e.g., 'vsys1'). - **name** (string) - Required - The name of the security policy rule. #### Request Body - **entry** (array) - Required - An array containing the security policy rule definition. - **@location** (string) - Required - The location of the rule (e.g., 'vsys'). - **@name** (string) - Required - The name of the rule. - **@vsys** (string) - Required - The virtual system name. - **action** (string) - Required - The action to take for matching traffic (e.g., 'allow'). - **application** (object) - Required - Defines the applications allowed by this rule. - **member** (array) - Required - A list of application names or objects. - **category** (object) - Required - Defines the application categories. - **member** (array) - Required - A list of category names (e.g., 'any'). - **destination** (object) - Required - Defines the destination addresses. - **member** (array) - Required - A list of destination address names or objects (e.g., 'any'). - **from** (object) - Required - Defines the source zones. - **member** (array) - Required - A list of zone names (e.g., 'zone-edge1'). - **source-hip** (object) - Optional - Defines Host Information Profile (HIP) profiles for the source. - **member** (array) - Optional - A list of HIP profile names. - **destination-hip** (object) - Optional - Defines HIP profiles for the destination. - **member** (array) - Optional - A list of HIP profile names. - **service** (object) - Required - Defines the services. - **member** (array) - Required - A list of service names (e.g., 'application-default'). - **source** (object) - Required - Defines the source addresses. - **member** (array) - Required - A list of source address names or objects (e.g., 'any'). - **source-user** (object) - Required - Defines the source users. - **member** (array) - Required - A list of user names or groups (e.g., 'any'). - **to** (object) - Required - Defines the destination zones. - **member** (array) - Required - A list of zone names (e.g., 'any'). ### Request Example ```json { "entry": [ { "@location": "vsys", "@name": "rule-example1", "@vsys": "vsys1", "action": "allow", "application": { "member": [ "email-collaboration-apps" ] }, "category": { "member": [ "any" ] }, "destination": { "member": [ "any" ] }, "from": { "member": [ "zone-edge1" ] }, "source-hip": { "member": [ "any" ] }, "destination-hip": { "member": [ "any" ] }, "service": { "member": [ "application-default" ] }, "source": { "member": [ "any" ] }, "source-user": { "member": [ "any" ] }, "to": { "member": [ "any" ] } } ] } ``` ### Response #### Success Response (200) (Response details not explicitly provided in the source, but typically confirms rule creation.) #### Response Example (Response example not explicitly provided in the source.) ### Alternative Application Specification Instead of using an application object, applications can be listed by name if they are included in the installed application content version. ```json "application": { "member": [ "gmail", "linkedin", "sendgrid", "front" ] } ``` ``` -------------------------------- ### Create an Application Object Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/create-security-policy-rule-rest-api Creates a new application object that can be used in security policy rules. This example demonstrates creating an object for browser-based collaboration and email applications. ```APIDOC ## POST /restapi/v11.0/Objects/Applications ### Description Creates an application object that allows specific browser-based applications belonging to the 'collaboration' category and 'email' subcategory. The object is named 'email-collaboration-apps' and is configured to be available across all virtual systems by setting `location=shared`. ### Method POST ### Endpoint `/restapi/v11.0/Objects/Applications?location=shared&name=email-collaboration-apps` ### Request Body - **entry** (array) - Required - An array containing the application object definition. - **@location** (string) - Required - The location of the object (e.g., 'shared'). - **@name** (string) - Required - The name of the application object. - **able-to-transfer-file** (string) - Optional - Indicates if file transfer is allowed ('yes' or 'no'). - **category** (string) - Required - The application category (e.g., 'collaboration'). - **description** (string) - Optional - A description for the application object. - **risk** (string) - Optional - The risk level of the application (e.g., '2'). - **subcategory** (string) - Required - The application subcategory (e.g., 'email'). - **technology** (string) - Optional - The technology used by the application (e.g., 'browser-based'). ### Request Example ```json { "entry": [ { "@location": "shared", "@name": "email-collaboration-apps", "able-to-transfer-file": "yes", "category": "collaboration", "description": "apps we allow for collaboration", "risk": "2", "subcategory": "email", "technology": "browser-based" } ] } ``` ### Response #### Success Response (200) (Response details not explicitly provided in the source, but typically confirms object creation.) #### Response Example (Response example not explicitly provided in the source.) ``` -------------------------------- ### Get Address Objects using PAN-OS REST API Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/work-with-address-objects-rest-api Retrieve a list of all address objects within a specific location using a GET request. The example shows how to fetch objects from 'vsys1'. ```curl curl -X GET \ 'https://10.2.1.4/restapi/v11.0/Objects/Addresses?location=vsys&vsys=vsys1' \ -H 'X-PAN-KEY: ********' ``` -------------------------------- ### Corresponding PAN-OS XML API Call (curl) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-web-interface-to-find-xml-api-syntax This example demonstrates how to construct a `curl` command to execute the API call corresponding to the XML syntax found in the debug console. It includes the operation type, the XML command, and a placeholder for the API key. ```curl curl -X POST 'https://firewall/api?type=op&cmd=&key=' ``` -------------------------------- ### Get Address Objects Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/work-with-address-objects-rest-api Retrieves a list of all address objects within a specified location using a GET request. The location can be specified using query parameters. ```APIDOC ## GET /restapi/v11.0/Objects/Addresses ### Description Retrieves a list of address objects. ### Method GET ### Endpoint /restapi/v11.0/Objects/Addresses ### Parameters #### Query Parameters - **location** (string) - Required - The location to retrieve address objects from (e.g., 'shared', 'vsys'). - **vsys** (string) - Optional - If location is 'vsys', specify the virtual system name. ### Response #### Success Response (200) - **@code** (string) - Success code. - **@status** (string) - Success status. - **result** (object) - The result of the operation. - **@count** (string) - The number of address objects returned. - **@total-count** (string) - The total number of address objects available. - **entry** (array) - An array of address objects. - **@location** (string) - The location of the address object. - **@name** (string) - The name of the address object. - **@vsys** (string) - The virtual system name (if applicable). - **fqdn** (string) - The FQDN of the address object (if applicable). - **ip-netmask** (string) - The IP address/netmask of the address object (if applicable). - **@oldname** (string) - The old name of the address object (if renamed). ``` -------------------------------- ### Get Existing Security Zone Details Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/configure-a-security-zone-rest-api Retrieve the configuration of an existing security zone from a PAN-OS firewall using a GET request. This is a prerequisite for updating the zone to ensure existing configurations are preserved. ```bash curl -X GET 'https:///restapi/v11.0/network/zones?name=test&location=vsys&vsys=vsys1' \ -H 'X-PAN-KEY: ' ``` -------------------------------- ### Create a Tag Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/create-a-tag-rest-api This example demonstrates how to create a link tag for an SD-WAN configuration on Panorama using a REST API POST request. It includes specifying the location, device group, tag name, and a comment for the tag. ```APIDOC ## POST /restapi/v11.0/objects/tags ### Description Creates a tag, which can be used to group objects. Link tags are specifically used for SD-WAN configurations on Panorama. ### Method POST ### Endpoint `/restapi/v11.0/objects/tags` ### Parameters #### Query Parameters - **location** (string) - Required - Specifies the location for the tag (e.g., 'device-group'). - **device-group** (string) - Required - The name of the device group to which the tag belongs. - **name** (string) - Required - The name of the tag to be created. #### Request Body - **entry** (object) - Required - Contains the details of the tag to be created. - **@name** (string) - Required - The name of the tag. - **comments** (string) - Optional - A description for the tag. ### Request Example ```json { "entry": { "@name": "Low-Cost-Paths", "comments": "Groups two low cost broadband links and a backup link" } } ``` ### Response #### Success Response (200) (Response structure not explicitly defined in the source, but typically includes a success indicator or details of the created object.) #### Response Example (No example provided in the source.) ``` -------------------------------- ### Get Custom Reports Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api Retrieve custom reports that have been created by the user. ```APIDOC ## Custom Reports ### Description Retrieves custom reports that have been defined by the user to meet specific monitoring and analysis needs. ### Method GET (typically, though specific implementation may vary) ### Endpoint `/api/v1/reports/custom` (example, actual endpoint may differ) ### Parameters #### Query Parameters - **name** (string) - Required - The name of the custom report to retrieve. ### Response #### Success Response (200) - **report_data** (xml) - The data of the custom report in XML format. #### Response Example ```xml custom_value ``` ``` -------------------------------- ### Basic PAN-OS XML API Request Structure (curl) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/about-the-pan-os-xml-api/structure-of-a-pan-os-xml-api-request This example shows the general structure of a PAN-OS XML API request using curl, highlighting key parameters like type, action, xpath, and the API key. ```bash curl -X POST 'https://firewall/api?type=&action=&xpath=&key=' ``` -------------------------------- ### Get Predefined Reports Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api Retrieve predefined reports that are available out-of-the-box. ```APIDOC ## Predefined Reports ### Description Retrieves predefined reports that come with the PAN-OS or Panorama system. These reports cover common operational and security aspects. ### Method GET (typically, though specific implementation may vary) ### Endpoint `/api/v1/reports/predefined` (example, actual endpoint may differ) ### Parameters #### Query Parameters - **name** (string) - Required - The name of the predefined report to retrieve. ### Response #### Success Response (200) - **report_data** (xml) - The data of the predefined report in XML format. #### Response Example ```xml value ``` ``` -------------------------------- ### Get Dynamic Reports Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api Retrieve dynamic reports generated by the firewall or Panorama. ```APIDOC ## Dynamic Reports ### Description Retrieves dynamic reports that are generated based on real-time data and specific query parameters. ### Method GET (typically, though specific implementation may vary) ### Endpoint `/api/v1/reports/dynamic` (example, actual endpoint may differ) ### Parameters #### Query Parameters - **name** (string) - Required - The name of the dynamic report to retrieve. - **filter** (string) - Optional - Filters to apply to the report data. ### Response #### Success Response (200) - **report_data** (xml) - The data of the dynamic report in XML format. #### Response Example ```xml value1 value2 ``` ``` -------------------------------- ### Get Version Info (API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api Retrieve version information for the PAN-OS or Panorama system. ```APIDOC ## Get Version Info (API) ### Description Retrieves the version information of the PAN-OS or Panorama software. This is useful for inventory management and compatibility checks. ### Method GET (typically, though specific implementation may vary) ### Endpoint `/api/v1/system/version` (example, actual endpoint may differ) ### Response #### Success Response (200) - **version_info** (xml) - The version information in XML format. #### Response Example ```xml 11.1.0 1234 ``` ``` -------------------------------- ### Configure Interface Management Profile (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/configure-ethernet-interface-rest-api Creates an interface management profile to protect the firewall from unauthorized access by defining permitted services and IP addresses. This example allows ping and response pages from a specific subnet. ```bash curl -X POST https:///restapi/v11.0/network/interfacemanagementnetworkprofiles?name=ping-and-response-pages' \ -H 'X-PAN-KEY: \ -d { "entry": { "@name": "ping-and-response-pages", "http": "no", "http-ocsp": "no", "https": "no", "permitted-ip": { "entry": [ { "@name": "192.168.1.0/24" } ] }, "ping": "yes", "response-pages": "yes", "snmp": "no", "ssh": "no", "telnet": "no", "userid-service": "no", "userid-syslog-listener-ssl": "no", "userid-syslog-listener-udp": "no" } } ``` -------------------------------- ### Get Candidate Configuration Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api Retrieve the candidate configuration of the firewall or Panorama. This is the configuration that is pending a commit. ```APIDOC ## Get Candidate Configuration ### Description Retrieves the candidate configuration, which is the configuration that has been modified but not yet committed. ### Method GET (typically, though specific implementation may vary) ### Endpoint `/api/v1/config/candidate` (example, actual endpoint may differ) ### Parameters #### Query Parameters - **xpath** (string) - Optional - The XPath expression to specify the configuration nodes to retrieve. ### Response #### Success Response (200) - **configuration** (xml) - The candidate configuration in XML format. #### Response Example ```xml Welcome! ``` ``` -------------------------------- ### Construct API Call from CLI Output Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-cli-to-find-xml-api-syntax Use the 'cmd' value and XML elements from the CLI response to form a type=op API call. This example constructs an API call for testing a URL. ```bash https:///api/?type=op&cmd=http://paloaltonetworks.com&key= ``` -------------------------------- ### Get Address Objects Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/work-with-address-objects-rest-api This section describes how to retrieve a list of all address objects or a specific address object by its ID. ```APIDOC ## GET /objects/address ### Description Retrieves a list of all address objects. ### Method GET ### Endpoint /objects/address ### Response #### Success Response (200 OK) - **data** (array) - An array of address objects. - **id** (string) - The unique identifier of the address object. - **name** (string) - The name of the address object. - **value** (string) - The value of the address object. #### Response Example ```json { "data": [ { "id": "abcdef12-3456-7890-abcd-ef1234567890", "name": "web-server-01", "value": "192.168.1.100" }, { "id": "fedcba09-8765-4321-fedc-ba0987654321", "name": "dmz-server", "value": "10.0.0.50" } ] } ``` ## GET /objects/address/{id} ### Description Retrieves a specific address object by its unique identifier. ### Method GET ### Endpoint /objects/address/{id} - **id** (string) - Required - The unique identifier of the address object to retrieve. ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier of the address object. - **name** (string) - The name of the address object. - **value** (string) - The value of the address object. #### Response Example ```json { "id": "abcdef12-3456-7890-abcd-ef1234567890", "name": "web-server-01", "value": "192.168.1.100" } ``` ``` -------------------------------- ### Create an SD-WAN Policy Pre Rule (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/pan-os-rest-api How to create pre-rules for SD-WAN policies using the PAN-OS REST API. ```APIDOC ## Create an SD-WAN Policy Pre Rule (REST API) This API allows the creation of SD-WAN policy pre-rules. **Endpoint:** `/api/v1/sdwan/policy/prerules` **Method:** POST **Request Body Example:** ```json { "name": "Default-PreRule", "source-zone": ["any"], "destination-zone": ["any"], "action": "allow" } ``` ``` -------------------------------- ### Delete Resource Example (REST API) Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api/get-started-with-the-pan-os-rest-api/methods-supported-rest-api Use the DELETE method with 'location' and 'name' query parameters to remove a resource. ```HTTP DELETE https:///restapi/v11.0/?location=location&name=name ``` -------------------------------- ### Use XPath to Get ARP Information Source: https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-panorama-api Retrieve Address Resolution Protocol (ARP) information from the firewall using an XPath query. ```APIDOC ## Use XPath to Get ARP Information ### Description Retrieves ARP table information from the firewall using a specific XPath query. ### Method GET (typically, though specific implementation may vary) ### Endpoint `/api/v1/system/arp` (example, actual endpoint may differ) ### Parameters #### Query Parameters - **xpath** (string) - Required - The XPath expression to retrieve ARP information (e.g., `//arp`). ### Response #### Success Response (200) - **arp-table** (xml) - The ARP table information in XML format. #### Response Example ```xml 192.168.1.1 00:11:22:33:44:55 ``` ```