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!
Can you remove "/" between xpath and element like
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..
<response status="success" code="20"><msg>command succeeded</msg></response>
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!