API/CLI - how to access subset of devices by tag assigned to them?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

API/CLI - how to access subset of devices by tag assigned to them?

L1 Bithead

Hi there, 
I'm going to use device's tags to have another dimension beside of template/device groups. 
I've assigned a tag to subset of devices (using Panorama>Managed devices WebUI), but I'm really lost how I can get access/filter devices by this tag in CLI/API (except WebUI  - search/filter them on or when selecting scope to push). 
When I'm using Panorama XML API to get all connected devices, I didn't get any mention of the tag in response text. 
I've also looked into CLI commands that will show the tag assigned, but found only commands related to traffic tagging, not device tags.
Any idea how to get this done on CLI/API?
P.S. Panorama running PanOS 10.0.7

2 REPLIES 2

L6 Presenter

You may play with shared objects Manage Unused Shared Objects (paloaltonetworks.com)

 

 

You may also configure the firewall locally and import it:

 

How to add a locally managed firewall to panorama management (paloaltonetworks.com)

 

 

Still good to note is that better make a template stack with templates that you use on every firewall and then more specific ones specifically for firewalls

 

 

Templates and Template Stacks (paloaltonetworks.com)

 

Device Group Hierarchy (paloaltonetworks.com)

L0 Member

This is probably far too late of a response. But I was searching for the same thing and ultimately used the web-mgmt interface debug to find it:

CLI
From configure - show mgt-config devices <serial number> vsys vsys1 tag
API
/api/?type=config&action=get&xpath=/config/mgt-config/devices/entry[@name='<serial_number>']/vsys/entry[@name='vsys1']/tags

 

 

  • 2119 Views
  • 2 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!