How to remove an address-group member via XML API

cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove an address-group member via XML API

Not applicable

Hi,

I would like to remove a single member from an address-group, here is the query I am sending:

https://firewall1.it.mydomain.net/api/?type=config&action=delete&xpath=/config/devices/entry/vsys/en...

The query returns the following:

      <response status="success" code="20">

           <msg>Object doesn't exist</msg>

</response>


I double-checked that both NameOfTheGroup and NameOfTheMember are correct.

What am I missing.

Thanks in advance.

Alex.

I













I

1 ACCEPTED SOLUTION

Accepted Solutions

L7 Applicator

What version of PAN-OS are you using ?


On PAN OS 6.0.x, here is the command to remove an address object called 'MyAddress' from an address group called 'MyGroup' (notice the additional '/static' in the XPath):

https://IP/api/?type=config&action=delete&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/addr...

<response status="success" code="20">

<msg>command succeeded</msg>

</response>

For this test 'REST_API_TOKEN' was used for auth, that can be ignored since you are using a key (&key=MyKey) which works as well.

View solution in original post

3 REPLIES 3

L7 Applicator

What version of PAN-OS are you using ?


On PAN OS 6.0.x, here is the command to remove an address object called 'MyAddress' from an address group called 'MyGroup' (notice the additional '/static' in the XPath):

https://IP/api/?type=config&action=delete&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/addr...

<response status="success" code="20">

<msg>command succeeded</msg>

</response>

For this test 'REST_API_TOKEN' was used for auth, that can be ignored since you are using a key (&key=MyKey) which works as well.

Thank you so much, that was it. Btw, where can I learn about REST_API_TOKEN, since sending my key in the query string seems insecure.

Alex.




The token is displayed in the browser address bar if you use first login to the UI & then navigate to API browser at https://firewall/api  The token lifetime should be limited to the lifetime of the UI session you are logged in so the using the key may be the right way to go if you need to automate API requests unattended.

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!