API - Fetching URLs from Custom URL object

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

API - Fetching URLs from Custom URL object

L0 Member

Hi all, we have a Custom URL category object, WL-URLS, which contains a number of URLs for a whitelist policy.

 

I am looking to find some information on how to go about retrieving the URLs from this object via the XML API. My preference is the XML API as I am working with the Python PAN-XAPI library, however I'm struggling to find what I'm looking for in the docs.

 

Any help would be much appreciated, thank you.

2 REPLIES 2

Cyber Elite
Cyber Elite

Howdy

 

So, I would say that you may be in for quite a few lines of code. 😕

On my FW, I have a custom URL category for "Exclude for Decryption" - a white list of sites.

So I think this may be a good example

I enabled debug cli on (to see the xml-api commands..) and here ya go....

 

##match "excluded from Decrypt

 

showed this output

 

(|: match: value: excluded from Decrypt)
((eol-matched: . #t) (context-inserted-at-end-p: . #f))
/usr/local/bin/pan_ms_client --config-mode=set --set-prefix='set ' --cookie=8098835205612256 <<'EOF' |sed 2>/dev/null -e 's/devices localhost.localdomain//' |/bin/grep 2>/dev/null -e 'excluded from Decrypt' |/usr/bin/less -X -E -M
<multiple-requests><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/deviceconfig"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/network"></request><request cmd="get" obj="/config/shared"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/zone"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/x-authenticated-user"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/vm-info-source"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/user-id-ssl-auth"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/user-id-collector"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/url-content-types"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/url-admin-override"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/ts-agent"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/threats"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/tag"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/setting"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/service-group"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/service"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/sdwan-interface-profile"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/schedule"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/route"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/reports"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/report-group"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/region"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/redistribution-collector"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/redistribution-agent"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/profiles"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/profile-group"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/pdf-summary-report"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/ipuser-include-exclude-list"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/iptag-include-exclude-list"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/import"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/group-mapping"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/global-protect"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/external-list"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/email-scheduler"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/dynamic-user-group"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/dns-proxy"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/display-name"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/disable-inspect"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/device-object"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/cloud-identity-engine"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/captive-portal"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/authentication-object"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application-tag"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application-group"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application-filter"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/application"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address-group"></request><request cmd="get" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address"></request><request cmd="get" obj="/config/mgt-config"></request></multiple-requests>
EOF

 

Hope this helped you.

 

 

 

Help the community: Like helpful comments and mark solutions

Thank you Steve - I appreciate the reply. Forgive me, coming from a purely REST background, I'm new to XML APIs. In your debug output there, I notice a lot of XML data and I'm struggling to make sense of it.

 

If we have an example Custom URL object, "excluded-urls", can we read the URLs within the object via the API to get a list of URLs returned? I have been exploring the documentation but it's quite intimidating at the moment.

 

Thanks again.

  • 796 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!