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
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | vs | The action specified to retrieve data after vps is started | Yes |
vpsid | GET | Int | The ID of the vps which needs to be started. | Yes |
action | GET | text | The value of the action should be "vs_netrestrict" for updating VPS network | Yes |
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"
}