- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-15-2022 01:26 AM
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>
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}}"
}
}
Hope that helps!