How to fetch Panorama Device Groups and Templates using Rest API
15987
Created On 01/05/22 10:45 AM - Last Modified 08/16/22 20:38 PM
Objective
Rest API query to fetch Panorama device Groups and Templates.
Environment
- Pan OS 10.0 and above.
- Panorama VM and M-series
- RestAPI.
Procedure
From Pan OS 10.0 and above we could fetch the Panorama Device Groups and Templates using Rest API queries, the below URL will help in creating Rest API queries for the same,
- RestAPI doc
https://<Panorama IP>/restapi-doc/
- Query to fetch specific device group with reference templates
https://<Panorama IP>/restapi/v10.1/Panorama/DeviceGroups?name=<Name_of_Specific_DG>
- Query to fetch specific template
https://<Panorama API>/restapi/v10.1/Panorama/Templates?name=<Name_of_Specific_Templates>
- Query to fetch specific TemplateStacks
https://<Panorama IP>/restapi/v10.1/Panorama/TemplateStacks? name=<Name_of_Specific_TemplateStack>
- Query to fetch list of specific device group
https://<Panorama IP>/restapi/v10.1/Panorama/DeviceGroups
- Query to fetch list of Templates
https://<Panorama IP>/restapi/v10.1/Panorama/Templates
- Query to fetch list of TemplateStacks
https://<Panorama IP>/restapi/v10.1/Panorama/TemplateStacks
Additional Information
- We can see an separate Panorama Tab under restapi-doc document for 10.0 and 10.1, which is not seen under Panorama 9.1 version, can verify the same with below link.
https://<Panorama IP>/restapi-doc/ -----Panorama with Pan OS 9.1.12
https://<Panorama IP>/restapi-doc/------Panorama with Pan OS 10.0
https://<Panorama IP>/restapi-doc/ -----Panorama with version 10.1
- In Pan OS 9.1 and below, we could only get the information about Objects, Device, Policies and Network Tab that you can find it using below URL
https://<Panorama IP>/restapi-doc/