- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
03-17-2021 01:46 PM
Hello All,
I am trying to use the XML API to automate the process of removing a firewall from a log collector group, pushing changes to collector, then removing managed device from Panorama. I am curious if anyone has done something similar? Every time I run the workflow, when trying to delete firewall I get the following error, "cannot be deleted because of references from:</line><line> log-collector-group". I know this is due to the log collector still having an entry for the firewall. But I am making the commit all XML API call to push these changes.
Worflow
03-19-2021 01:28 PM
Hi @julioperez,
I was able to do this with:
https://{{host}}/api/?key={{key}}&type=config&action=delete&xpath=/config/devices/entry[@name='localhost.localdomain']/log-collector-group/entry[@name='{{log-collector-group}}']/logfwd-setting/devices/entry[@name='{{ngfw-serial-number}}']
From your original command to remove the NGFW from the LC Group, try removing this section just before the API key:
/collectors/entry[@name='SOMECOLLECTORSN']
03-19-2021 01:28 PM
Hi @julioperez,
I was able to do this with:
https://{{host}}/api/?key={{key}}&type=config&action=delete&xpath=/config/devices/entry[@name='localhost.localdomain']/log-collector-group/entry[@name='{{log-collector-group}}']/logfwd-setting/devices/entry[@name='{{ngfw-serial-number}}']
From your original command to remove the NGFW from the LC Group, try removing this section just before the API key:
/collectors/entry[@name='SOMECOLLECTORSN']
03-22-2021 10:19 AM
Hi Jimmy,
I will give this a shot this week and report back what I find!
03-22-2021 10:45 AM
Thank you Jimmy for this, just tested in the lab and it looks to have deleted the managed device correctly. You rock dude! I cant tell you how long I've been stuck on this?
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!