Get Virtualizor

Update VPS Network Rules

Use the Update VPS Network Rules API to update network rules of the VPS present on your server by passing the VPS ID to the API.

HTTP Request

https://hostname:4085/index.php?act=vs&action=vs_netrestrict&vpsid=VPSID

Parameters

NameMethodValueDescriptionRequired
actGETvsThe action specified to retrieve data after vps is startedYes
vpsidGETIntThe ID of the vps which needs to be started.Yes
actionGETtextThe value of the action should be "vs_netrestrict" for updating VPS networkYes

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);

    $vpsid = 3582;

    $output = $admin->update_vps_net_rules($vpsid);

    print_r(json_encode($output));

?>

Output

{
  "title": "Virtual Servers",
  "vsop": {
    "action": "vs_netrestrict",
    "id": 3582,
    "serid": "0",
    "output": 1,
    "status": {
      "3582": 1
    }
  },
  "timenow": 1602217803,
  "time_taken": "4.432"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list