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

Who rated this post

Hi @MarketAxess,

 

That API call looks like a mixture of the XML API and the REST API. I suggest going to the documentation I linked (link) and reading the differences between the two, and then choosing one. An alternative would be to use either pan-python (thin SDK) or pan-os-python (object-oriented SDK) Python SDKs so you don't have to reinvent the API calls in your own Python code.

 

 

An XML API call to Panorama to edit an address object from IP to FQDN would look something like this:

https://{{host}}/api/?key={{key}}&type=config&action=edit&xpath=/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='{{device-group-name}}']/address/entry[@name='{{object-name-1}}']&element=<entry name="{{object-name-1}}"><fqdn>{{fqdn-1}}</fqdn></entry>

Docs: https://docs.paloaltonetworks.com/pan-os/10-2/pan-os-panorama-api/pan-os-xml-api-request-types/confi...

 

 

A REST API call to Panorama to edit an address object from IP to FQDN would look something like this, with PUT as the method, X-PAN-KEY in the headers:

https://{{host}}/restapi/v10.0/Objects/Addresses?location=device-group&device-group={{device-group-name}}&name={{object-name}}

 and a body like this:

{
    "entry": {
        "@name": "{{object-name-1}}",
        "fqdn": "{{fqdn-1}}"
    }
}

Docs: https://docs.paloaltonetworks.com/pan-os/10-2/pan-os-panorama-api/get-started-with-the-pan-os-rest-a...

 

 

Hope that helps!

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer 🙂

View solution in original post

Who rated this post