Disable rule using XML API 5.0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Disable rule using XML API 5.0

L2 Linker

Dear alll,

I am trying to disable a specific rule from the security policy using the XML api...

I am sending the following URL:

https://192.168.1.1/api/?type=config&action=edit&key=<my_key_here>=&xpath=/config/devices/entry/vsys/entry/rulebase/security/rules/entry[@name='rule1']&element=<disabled>yes</disabled>

But as a result I get the following error:

<response status="error" code="12"><msg><line>Edit breaks config validity</line></msg></response>

What am I doing wrong?

George

1 accepted solution
5 REPLIES 5

L0 Member

Try changing the action to "action=set", rather than edit.

L3 Networker

edit wants an xpath node which 'overlaps' with the element (XML) data, so add '/disabled' at the end of your xpath.

I tried this last one worked.

Thanks for useful command.I also wonder how debug commands can be used by Api (or if we can)

L4 Transporter

Debug commands are not supported by the API.

  • 1 accepted solution
  • 4422 Views
  • 5 replies
  • 0 Likes
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!