Get Virtualizor

Edit Firewall Plan

API Description

This API is used to edit Firewall Plan from admin side.

Parameters

Sample Code

 <?php
    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $output = $post = [];

    $post['fwid'] = 30;
    $post['fwp_name'] = 'Test SSH';
    $post['default_policy'] = 'DROP';
    $post['api_firewall_rules'] = [["4", "IN" ,"ACCEPT" ,"TCP" ,"ALL", "192.168.1.10"],
                                ["4", "IN", "ACCEPT","TCP","80","0.0.0.0/0"]];

    $output = $admin->editfirewall_plan($post);
    print_r($output);

?>

Output

{
  "done": {
    "msg": "Firewall Plan updated successfully"
  }
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list