Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - JeffreyT

#1
Did you ever get anywhere with this? Trying to do the same.

Quote from: mhen79 on September 26, 2024, 02:39:25 AMHi,

i got install, configure and run successfully the zenarmor plugin in opnsense.

Now i want to control a working policy via api request, simply to switch on or off the policy.

To get status and some information for all policies is simple done with:
curl -sk -u "$key":"$secret" https://<ip>/api/zenarmor/policy
response:
{
  "policies": [
    {
      "id": 1727212787,
      "local_id": 1727212787,
      "cloud_policyid": "",
      "name": "Allow_Services",
      "isCentralized": false,
      "isActive": true,
      "isDefault": false,
      "user": "0",
      "nodes": [
        {
          "id": "0"
        }
      ],
      "tags": [],
      "projects": [],
      "checksum": 1727212787
    },
    {
      "id": 0,
      "local_id": 0,
      "cloud_policyid": "",
      "name": "Default",
      "isCentralized": false,
      "isActive": true,
      "isDefault": true,
      "user": "0",
      "nodes": [
        {
          "id": "0"
        }
      ],
      "tags": [],
      "projects": [],
      "checksum": 0
    }
  ]
}

My question is, how could i modify the "isActive" status to false, of id:1727212787 ? I could'nt find any documentation regarding toggle on/off policies via api call.

Br,

Marco