Use the vertical scaling data API to save the data for vps.you will get response in "ver_done" (Since V3.1.3)
Note
- Vertical scaling is supported on KVM based virtualization only.
- QEMU version should be greater than or equal to 1.5, To check QEMU Version run "/usr/bin/virsh version"
- Vertical scaling is currently not supported on Windows VPS
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | vpsmanage | The action which will return data belonging to a particular page | Yes |
svs | POST | VPSID | Provide vpsid of the VM for which you want to save the data. | Yes |
vs_ver_ram_inc_by | POST | int(In GB) | If set then while scaling, ram will be increased/decreased using this parameter. | Yes |
vs_ver_cpu_inc_by | POST | int(cores) | If set then while scaling, CPU cores will be increased/decreased using this parameter. | Yes |
PHP
<?php require_once('/usr/local/virtualizor/sdk/enduser.php'); $key = 'your_api_key'; $pass = 'your_api_pass'; $ip = 'host_ip'; $v = new Virtualizor_Enduser_API($ip, $key, $pass); $vid = 6710; //vpsid
$post['
vs_ver_ram_inc_by'] = 2;
$post['
vs_ver_cpu_inc_by'] = 1;
$vps = $v->save_vertical_data($vid, $post); print_r(json_encode($vps)); ?>
Output
{ "uid":"600", "act":"vpsmanage", "timezone":2, "timenow":"July 24, 2019, 12:24 pm", "vpsid":6710, "username":"a@a.com", "user_type":"2", "preferences":{ "theme":"default", "language":"english", "timezone":2 }, "url":"index.php?", "rdns":{ "pdnsid":null }, "support_link":"http:\/\/softaculous.com", "enable_eu_iso":1, "billing_symbol":"$", "enable_registration":0, "inhouse_billing":"0", "title":"KVMTestServer", "info":{ "os":{ "osid":"626", "type":"kvm", "name":"centos-6.9-x86_64", "filename":"centos-6.9-x86_64.img", "size":"1291845632", "pygrub":"0", "drive":"", "hvm":"0", "perf_ops":"1", "active":"1", "url":"http:\/\/files.virtualizor.com\/ostemplates.php?osid=626", "distro":"centos", "Nvirt":"kvm", "distro_logo":"centos_60.gif" },
"ver_done" : "The settings have been save successfully""time_taken":"2.352" }