Not appending new address object in address group through REST API

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

Not appending new address object in address group through REST API

L1 Bithead

We have been trying to append a new address object to an address group in the firewall. However, when we use the PUT method in Postman to insert it into the group, it replaces the existing address objects instead of adding the new one. Additionally, using the POST method results in an error.

4 REPLIES 4

Cyber Elite
Cyber Elite

Hi @ShaileshKum ,

 

You cannot append with the REST API.  You would need to modify your script to read the members of the address group, append your new value, and replace the contents.

 

REST typically only does CRUD operations.  Here are the supported REST and HTTP methods:

 

  • Create = Post
  • Read = Get
  • Update = Put
  • Delete = Delete
  • Rename = Post
  • Move (policy only) = Post

 

https://docs.paloaltonetworks.com/pan-os/11-0/pan-os-panorama-api/get-started-with-the-pan-os-rest-a...

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.

L1 Bithead

Hi @TomYoung 

Thanks for your reply! Usually, when we add an object to a group, we need to copy a previous object and paste it when adding a new object.

L1 Bithead

Is there any other option? Currently, when we create a new object, we copy all the properties of an old object and paste them into the new one

Cyber Elite
Cyber Elite

Hi @ShaileshKum ,

 

It should be possible with the XML API using the set action.  See this post which has an example of appending an application to a security policy rule.  https://live.paloaltonetworks.com/t5/panorama-discussions/add-or-remove-application-in-a-security-ru...

 

Thanks,

 

Tom

Help the community: Like helpful comments and mark solutions.
  • 336 Views
  • 4 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!