PanOS 4.1 and Commits via XML API

Not applicable

PanOS 4.1 and Commits via XML API

I upgraded to PanOS 4.1 and noticed I could no longer make commits via the XML API. Seems like maybe the syntax has changed but I can't find any documentation. When I execute the query below either by script or browser I'm returned with '500 Internal Server Error'. Correct me if I'm wrong but the XML API is kind of useless if we can't commit changes made with it. :smileysilly:

Commit Query:

https://<panfw>/esp/restapi.esp?type=config&action=commit&key=<apikey>

Any one have any suggestions?

-Brandon

L2 Linker

Re: PanOS 4.1 and Commits via XML API

Hi Brandon,

In 4.1 the XML API has been re-organized and has several enhancements.  One of which is that commit is now a 'type' and no longer nested as an 'action' under config.  There are also several additional options for partial and vsys specific commit operations.

https://hostname/api/?type=commit&action=set&key=keyvalue&cmd=<commit></commit>

This will also work (the original API path has been preserved for backward compatability:

https://honstame/esp/restapi.esp?type=commit&action=set&key=keyvalue&cmd=<commit></commit>

If you log into your firewall as a super user for an admininstrative web session, then open a new tab in your browser and navigate to:

https://hostname/api/

You will be greeted with the new API command browser to assist you in constructing XML API calls.

Best Regards,

Marc

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 Live Community as a whole!

The Live Community thanks you for your participation!