- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
11-16-2016 08:01 AM
Okay so below is what I've been attempting to use for the creation of policies automatically though the API; however when I run it I simply get a Success output and the rule never actually completes. Can anybody tell me where this is missformated?
/api/?type=config&action=get&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/[@name='$NewRule']&element=<source><member>$Source</member></source><destination><member>$Destination</member></destination><service><member>$Service</member></service><application><member>$Application</member></application><action>$Action</action><source-user><member>$srcuser</member></source-user><option><disable-server-response-inspection>no</disabled-server-response-inspection></option><negate-source>$negsource</negate-source><negate-destination>$negdest</negate-destination><disabled>$disabled</disabled><log-start>$logstart</log-start><log-end>$logend</log-end><description>$description</description><from><member>$srczone</member></from><to><member>$dstzone</member></to>
11-16-2016 08:39 AM - edited 11-16-2016 08:40 AM
you should open a TAC case because this command should create an error message.
You need to fix the XPATH as you forget an 'entry' for the rule:
/api/?type=config&action=get&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name...
11-16-2016 08:39 AM - edited 11-16-2016 08:40 AM
you should open a TAC case because this command should create an error message.
You need to fix the XPATH as you forget an 'entry' for the rule:
/api/?type=config&action=get&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name...
11-16-2016 08:44 AM
Glad it was something simple. I actually just realized a few minutes ago that I was also running get instead of set; when you run set you do actually get a malformed entry but when you run get it just says success regarless if there is a rule that matches the name or not even when I add the missing 'entry' statement.
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 LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!