How to create multiple policy objects using Panorama

Reply
Highlighted
L1 Bithead

How to create multiple policy objects using Panorama

 

Is there any quick way to configure multiple policy objects on Panorama? especially looking to configure hundreds of fqdn objects to push them to firewalls managed through panorama so using GUI is quite a lot of work.

 

e.g. for standalone PA, it is quick using CLI commands


Accepted Solutions
Highlighted
L4 Transporter

Re: How to create multiple policy objects using Panorama

Highlighted
Cyber Elite

Re: How to create multiple policy objects using Panorama

https://{panorama-ip}/api/?key={API-key}&type=config&action=set&xpath=/config/device-group[@name='{devicegroup-name}']/address/entry[@name='{object-name}'] &element=<ip-netmask>{ip-address/mask}</ip-netmask>

View solution in original post


All Replies
Highlighted
L4 Transporter

Re: How to create multiple policy objects using Panorama

Highlighted
L1 Bithead

Re: How to create multiple policy objects using Panorama

Thanks for your reply. It looks to be a good solution for Shared objects.

Is there any similar method to create it for a specific Device Group?

Highlighted
L4 Transporter

Re: How to create multiple policy objects using Panorama

Unfortunately I currently got no panorama at hand, but you can have a look for the api-calls at https://<panorama-ip/api

 

Maybe there is a "device group" branch on the same level as the "shared" branch.

Highlighted
Cyber Elite

Re: How to create multiple policy objects using Panorama

https://{panorama-ip}/api/?key={API-key}&type=config&action=set&xpath=/config/device-group[@name='{devicegroup-name}']/address/entry[@name='{object-name}'] &element=<ip-netmask>{ip-address/mask}</ip-netmask>

View solution in original post

Highlighted
Community Team Member

Re: How to create multiple policy objects using Panorama

@SunilGajjar,

 

As Chacko42 & vsys_remo pointed out using XML_API can be an excellent way to do this.

 

If you're unfamiliar with how XML API works then check out the following XML API use case examples explained on the Live Community Blog (these might not match your exact use case but can definitely help you getting started with XML API) :

 

Export-the-security-rulebase-using-XML-API

XML-API-Use-Case-to-Add-amp-Delete-TS-Agents

The-Power-of-XML-API

 

 

Cheers !

-Kiwi.

Highlighted
L1 Bithead

Re: How to create multiple policy objects using Panorama

@kiwi@vsys_remo@Chacko42

 

Thanks for your replies.

Highlighted
L1 Bithead

Re: How to create multiple policy objects using Panorama

@Chacko42

 

I have drilled it down through Panorama API browser to find out Devicegroup related Xpath at: /config/devices/entry[@name='{localhost.localdomain}']/device-group/entry[@name='{device-group name}]

 

It successfully worked using below API call (replace relevant values for variables within brackets {}):

https://{panorama-ip}/api/?key={API-Key}&type=config&action=set&xpath=/config/devices/entry[@name='{localhost.localdomain}']/device-group/entry[@name='{device-group name}']/address/entry[@name='{address-object-name}'] &element=<ip-netmask>{ip-address/mask}</ip-netmask>

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!