OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • 24.1 Legacy Series »
  • toggleRule api
« previous next »
  • Print
Pages: [1]

Author Topic: toggleRule api  (Read 475 times)

mije

  • Newbie
  • *
  • Posts: 1
  • Karma: 1
    • View Profile
toggleRule api
« on: June 27, 2024, 04:32:39 pm »
hello, I have read the different articles on the subject but still I can't figure it out. I simply want to disable / enable a rule with the API.
ex :

Code: [Select]
curl -XPOST -k -u "mykey":"mysecret" https://myfirewall:4443/api/firewall/filter/toggleRule/86833879d5f092ffefd6c7ea13224c43/1
result :

Code: [Select]
<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8" />
  <title>411 Length Required</title>
 </head>
 <body>
  <h1>411 Length Required</h1>
 </body>
</html>

with postman :

Code: [Select]
{
    "result": "failed"
}

I tried several syntax found on the forum, docs, tutorials, but no positive results. However when I make API requests on the aliases it works.
thank you in advance for your help

Logged

bitTwiddler

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
    • View Profile
Re: toggleRule api
« Reply #1 on: July 04, 2024, 12:49:13 am »
I am looking at these docs and it is unclear if the API works on the built-in firewall rules based upon this statement:

Although the plugin does contains a basic user interface (in Firewall ‣ Automation), it’s mirely intended as a reference and testbed. There’s no relation to any of the rules being managed via the core system.

Either the docs are broken or those API endpoints are not for the built-in firewall.  I am trying to figure out the same thing.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • 24.1 Legacy Series »
  • toggleRule api
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2