How to push configurations to multiple device groups in the same API request
Objective
Intended to push configurations and changes to multiple device address groups within the same API request
Environment
**Network Config**
• Panorama
• Firewalls
Procedure
Step 1: Create a API key
To generate an API key, make a GET or POST request to the firewall’s hostname or IP addresses using the administrative credentials and type=keygen
> curl -k -X GET 'https://<panorama>/api/?type=keygen&user=<username>&password=<password>'
A successful API call returns status="success" along with the API key within the key element:
For Example:
<response status="success"> <result> <key>gJlQWE56987nBxIqyfa62sZeRtYuIo2BgzEA9UOnlZBhU==</key> </result> </response>
Step 2: Use below API curl command for commit operation for multiple device groups
curl -k -X POST 'https://PANORAMA/api/?type=commit&action=all&cmd=<commit-all><shared-policy><admin><member>$ADMIN</member></admin><device-group><entry name=“DEVICE_GROUP_NAME_A”/><entry name=“DEVICE_GROUP_NAME_B”/></device-group></shared-policy></commit-all>’
Replace following in above curl command:
PANORAMA - Change to panorama FQDN or IP address
ADMIN - specific administrator name
DEVICE_GROUP_NAME_A - Select the device group name A
DEVICE_GROUP_NAME_B - Select the device group name B
Step 3: Test above curl command by executing it in bash terminal to ensure the syntax is correct.
Note: This will initiate a commit for the configured device group.
Additional Information