Add a Shared Address Object Using XML API to Panorama
35170
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
- 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

- Extract the API key and note it down somewhere safe.
- 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>
- 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>
- The query should succeed as below: