Add a Shared Address Object Using XML API to Panorama

Add a Shared Address Object Using XML API to Panorama

30252
Created On 09/25/18 19:49 PM - Last Modified 08/19/21 20:45 PM


Environment


  • Any Panorama
  • Any PAN-OS.
  • Example of XML API for a shared object.


Resolution


  1. Generate the API key for Panorama, using the query below. 
https://{panorama-ip}/api/?type=keygen&user={username}&password={password}

Replace:

{panorama-ip} - Panorama's IP
{username} - super user username
{password} - password of the user

 

API call key

  1.  Extract the API key and note it down somewhere safe.
  2.  Then use the query below after replacing the parameters.
https://{panorama-ip}/api/?key={API-key}&type=config&action=set&xpath=/config/shared/address/entry[@name=
'{object-name}'] &element=<ip-netmask>{ip-address/mask}</ip-netmask>
  1. An example of the exact query to add a Shared Addresses Object to Panorama is shown below.

In this example:

Panorama IP: 10.50.243.13
API key: LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERU0000
Address Object Name: Google-DNS
Address Object IP/Netmask: 8.8.8.8/32

The Query for the same is:

https://10.50.243.13/api/?key=LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERU0000
&type=config&action=set&xpath=/config/shared/address/entry[@name='Google-DNS']&element=<ip-netmask>8.8.8.8/32</ip-netmask>
 
  1. The query should succeed as below:
API succeed message

 

 

 



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000CleqCAC&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language