PANOS 6.0 XML - set failed?

Not applicable

PANOS 6.0 XML - set failed?

Hello all,

I am trying to edit/set a security rule using the XML API.  So far i have the following: https://x.x.x.x/api/?type=config&action=set&key=hiddenkeyhere&xpath=/config/devices/entry/vsys/entry... 1-1-1-1-1']/&element=<from><member>inside</member></from>

sadly all I get in return is "set failed, may need to override template object first".  When I change the action from set to override I get another error.  I am sure that this rule and element did not get inherited from a template.

I went into the CLI and issued the set command there and it works perfectly.  Just to make sure I formatted the element properly I turned on cli debugging so I could see what needs to be in the element section, below is the output: 

<request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='Rule 1-1-1-1-1']" cookie="xxxxxxxxxxxxxxxxx"><from><member>inside</member></from></request>

Has anyone overcome this issue with setting elements for security rules?  If so, how?

Thanks in advanced!

Tags (4)
L4 Transporter

Re: PANOS 6.0 XML - set failed?

Can you remove "/" between xpath and element like

http(s)://hostname/api/?type=config&action=set&key=keyvalue&xpath=xpath-value&element=element-value

~ Sai Srivastava Tumuluri ~
L1 Bithead

Re: PANOS 6.0 XML - set failed?

Hi Lee,

not sure what point release of 6 you're on, but i upgraded from 5 to 6.0.4 today and had the same error message when attempting to add members to address-groups (which broke all my auto-blocking code lol) - in that instance i found  i was missing a  <static> keyword around the member entry (ill raise a support call on monday with my reseller as an FYI), but in your case, im afraid i dont get the same error and the api call completes successfully..

https://x.x.x.x/api/?type=config&action=set&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/ru... 1-1-1-1-1']&element=<from><member>inside</member></from>&key=hiddenkeyhere

<response status="success" code="20"><msg>command succeeded</msg></response>

cheers

damian

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!