Manage VPS

Use the Manage VPS API to edit the configuration of the VPS. You can completely fine tune all the settings of the Virtual Private Server like the hostname, root password, storage space, RAM, IP addresses and assigned bandwidth . If you are unsure of any values, you can search for the VPS details by passing the VPS ID to the List Virtual Server API. We recommend using Manage VPS over edit VPS for calibrating the settings of the Virtual Private Servers.

The API response will contain “done” as “true” after successful update of the VPS configurations.

HTTP Request

https://hostname:4085/index.php?act=managevps&vpsid=VPSID

Parameters

NameMethodValueDescriptionRequired
vpsidPOSTIntThe ‘VPSID’ ID of the vps that needs to be editedYes
uidPOSTIntThe user ID to which the vps belongsNo
user_emailPOSTtextThe email of the user to be addedNo
user_passPOSTtextThe password of the user to be addedNo
fnamePOSTtextThe first name of the user to be addedNo
lnamePOSTtextThe last name of the user to be addedNo
dnsplidPOSTIntThe dns plan ID to be used by the vpsNo
plidPOSTIntIf using plans to configure the vps, then plid has to be specifiedNo
hostnamePOSTtextThe hostname of the vpsNo
rootpassPOSTtextThe password of the vpsNo
ipsPOSTarrayThe ips of type v4 to be used by the vpsNo
ips6POSTarrayThe ips of type v6 to be used by the vpsNo
num_ipsPOSTIntThe number of ips to be assigned and used by the vpsNo
num_ips6POSTnum_ipsThe number of ips to be assigned and used by the vpsNo
spacePOSTarrayThe disk space of the vpsNo
ramPOSTIntThe RAM value to be assigned to the vps in MBNo
swapramPOSTIntThe swap space assigned to the vps to be used a virtual RAM in MBNo
cpuPOSTIntThe CPU weight for the VPSNo
coresPOSTcoresThe number of CPU Cores the vps will useNo
vncPOST1/0If set, VNC access will be enabledNo
vncpassPOSTtextThe password for the vnc consoleNo
acpiPOST1/0If set , then acpi will be enabled for the vpsNo
apicPOST1/0If set , then apic will be enabled for the vpsNo
paePOST1/0If set , then pae will be enabled for the vpsNo
bootPOSTtextThis sets the boot order(cda/dca) of the os inside the vpsNo
disable_ebtablesPOST1/0If set , then disable ebtables for the vpsNo
rdpPOST1/0IF set, then RDP will be enabled for windows vpsNo
admin_managedPOST1/0If set then the VPS cannot be managed from enduser panelNo
disable_nw_configPOST1/0This will disable network config of the vpsNo
cpupinPOSTarrayIF CPU Affinity is not checked then, number of virtual cpus have to be selectedNo
cpu_modePOSTtextRefer Values from below tableNo
topology_socketsPOSTIntSpecify the number of CPU Sockets to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP)No
topology_coresPOSTIntSpecify the number of CPU cores to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP)No
topology_threadsPOSTIntSpecify the number of CPU Threads to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP)No
mgsPOSTarrayThe array of media groups to be assigned to the vpsNo
osreinstall_limitPOSTIntIt sets the OS reinstall limit inside the vpsNo
bandwidthPOSTIntThe bandwidth to be assigned to the vpsNo
network_speedPOSTIntThe network speed to be used by the vps in KB/sNo
upload_speedPOSTIntThis will set the upload speed of the vps in KB/sNo
band_suspendPOST1/0If set then the vps will be suspended once it exceeds the bandwidth limit assignedNo
ips_intPOSTarrayThe internal ips to be assigned to the vpsNo
num_int_ipsPOSTIntThe number of internal ips to be assigned to the vpsNo
macPOSTtextMac ID to be used by the vps (Only for KVM, Proxmox KVM, Proxmox LXC, LXC, Virtuozzo KVM, XCP and XEN )No
vif_typePOSTtextThe VIF type (netfront or ioemu) (Only for KVM and Xen HVM)No
nic_typePOSTtextThe NIC type (default or e1000) (Only for KVM and Xen)No
dnsPOSTarrayThe array of IPs of dns nameserverNo
virtioPOST1/0Flag to enable VIRTIO (0 or 1)(Only for KVM)No
kvm_cachePOSTtextThe type disk-cache mechanism can be writeback, writethrough, directsync or default (Only for KVM and Proxmox KVM)No
io_modePOSTtextSets the I/O policy for the VPS can be native/threads (Only for KVM)No
kvm_vgaPOST1/0Enables VGA for the VPS (Only for KVM)No
accelerationPOST1/0If VGA is enabled then this option will enable 2D and 3D acceleration will be for the VPSNo
notesPOSTtextAdds user defined textual noteNo
enable_rescuePOST1/0If set then Rescue will be enabled for the vps (KVM,LXC, Proxmox KVM, Proxmox LXC, xcp and xen)No
rescue_passPOSTtextSet the rescue password when enabledNo
conf_rescue_passPOSTtextConfirmation done for the rescue passwordNo
cpu_percentPOSTIntSet the CPU Percent, the vps could use out of the server CPUNo
shadowPOSTIntAmount of Shadow Memory for the vps(Only for Xen)No
isoPOSTtextThe name of the iso file which will be used to install vps (Only for KVM, Proxmox KVM, Virtuozzo KVM, xcp and Xen)No
pv_on_hvmPOST1/0If set then it will be enabled for the vps(Only for Xen)No
tuntapPOST1/0Flag to enable TunTap (Only for OpenVz, Virtuozzo, Proxmox)No
apply_planPOST1/0This will apply the plan values passed in plidNo
managevdfPOST1/0Haproxy Manage VPS Domain ForwardingNo
hvmPOSTIntPass value if it is hypervisorNo
ioPOSTIntSet I/O value of the vps (Only for OpenVz and Proxmox)No
burstPOSTIntSet the burst RAM for the vps (Only for OpenVz and Proxmox)N

CPU Mode values for KVM

( host-model | host-passthrough )

CPU Mode values for Proxmox KVM

( host-model | host-passthrough | 486 | athlon | pentium | pentium2 | pentium3 | coreduo | core2duo | kvm32 | qemu32 | qemu64 | phenom | Conroe | Penryn | Nehalem | SandyBridge | IvyBridge | Haswell | Broadwell | Opteron_G1 | Opteron_G2 | Opteron_G3 | Opteron_G4 | Opteron_G5 )

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

    $post['vpsid'] = 51;
    $post['rootpass'] = 'test@123';
    $post['ips'] = array('10.10.100.10');
    $post['hostname'] = 'test123';
    $post['ram'] = 1024;
    $post['bandwidth'] = 0;
    $post['cores'] = 2;
    $post['cpupin'] = 0;
    $post['uid'] = 57;
    $post['network_speed'] = 0;
    $post['upload_speed'] = 0;
    $post['hvm'] = 0;
    $post['io'] = 0;
    $post['burst'] = 0;
    $post['cpu_percent'] = 0;
    $post['acpi'] = 1;
    $post['apic'] = 1;
    $post['pae'] = 1;
    $post['vnc'] = 1;
    $post['shadow'] = 0;
    $post['iso'] = '';
    $post['boot'] = 'cda';
    $post['band_suspend'] = 0;
    $post['tuntap'] = 0;
    $post['pv_on_hvm'] = 0;
    $post['ppp'] = 0;
    $post['mac_status'] = 0;
    $post['osreinstall_limit'] = 0;
    $post['mgs'] = '';
    $post['webuzo'] = '';
    $post['cpu_mode'] = 'default';
    $post['admin_managed'] = 0;
    $post['rdp'] = 1;
    $post['mac'] = '';
    $post['notes'] = '';
    $post['disable_nw_config'] = 0;
    $post['topology_sockets'] = 0;
    $post['topology_cores'] = 0;
    $post['topology_threads'] = 0;

    $output = $admin->managevps($post);

    print_r(json_encode($output));
?>

Output

{
  "title": "Manage VPS",
  "done": {
    "done": true
  },
  "error": [],
  "vs_info": {
    "vpsid": "51",
    "vps_name": "v1009",
    "uuid": "zou88fl1avyklu0s",
    "serid": "0",
    "time": "1535018665",
    "edittime": "1535123989",
    "virt": "kvm",
    "uid": "57",
    "plid": "1",
    "hostname": "test123",
    "osid": "270",
    "os_name": "centos-6.5-x86",
    "iso": "",
    "sec_iso": "",
    "boot": "cda",
    "space": "3",
    "inodes": "0",
    "ram": "1024",
    "burst": "0",
    "swap": "1024",
    "cpu": "1000",
    "cores": "2",
    "cpupin": "-1",
    "cpu_percent": "0.00",
    "bandwidth": "0",
    "network_speed": "0",
    "upload_speed": "0",
    "io": "0",
    "ubc": false,
    "acpi": "1",
    "apic": "1",
    "pae": "1",
    "shadow": "0",
    "vnc": "1",
    "vncport": "5902",
    "vnc_passwd": "",
    "hvm": "0",
    "suspended": "0",
    "suspend_reason": null,
    "nw_suspended": null,
    "rescue": "0",
    "band_suspend": "0",
    "tuntap": "0",
    "ppp": "0",
    "ploop": "0",
    "dns_nameserver": "a:0:{}",
    "osreinstall_limit": "0",
    "preferences": null,
    "nic_type": "virtio",
    "vif_type": "",
    "virtio": "0",
    "pv_on_hvm": "0",
    "disks": [
      {
        "did": "58",
        "disk_uuid": "da3pbqt8qgolohhk",
        "st_uuid": "ngavdbegidnbme2d",
        "vps_uuid": "zou88fl1avyklu0s",
        "path": "/dev/vg/vsv1009-da3pbqt8qgolohhk-zou88fl1avyklu0s",
        "primary": "1",
        "size": "3.000",
        "size_unit": "",
        "type": "block",
        "format": "raw",
        "num": "0",
        "rescue": "0",
        "extra": "",
        "vpsid": "51"
      }
    ],
    "kvm_cache": "0",
    "io_mode": "0",
    "cpu_mode": "default",
    "total_iops_sec": "0",
    "read_bytes_sec": "0",
    "write_bytes_sec": "0",
    "kvm_vga": "0",
    "acceleration": "0",
    "vnc_keymap": "en-us",
    "routing": "0",
    "mg": "",
    "used_bandwidth": "0.17",
    "cached_disk": {
      "disk": {
        "Used": 775340,
        "Available": 1190740,
        "Use%": 39.44
      },
      "inode": {
        "Inodes": 122880,
        "IUsed": 21318,
        "IFree": 101562,
        "Use%": 17.35
      }
    },
    "webuzo": "0",
    "disable_ebtables": "0",
    "install_xentools": "0",
    "admin_managed": "0",
    "rdp": "1",
    "topology_sockets": "0",
    "topology_cores": "0",
    "topology_threads": "0",
    "mac": "",
    "notes": "",
    "disable_nw_config": "0",
    "locked": "",
    "openvz_features": "",
    "speed_cap": "",
    "numa": "0",
    "bpid": "0",
    "bserid": "0",
    "timezone": null,
    "usbdevice": "N;",
    "pid": "0",
    "ips": [
      "10.10.100.10"
    ],
    "ips6": [],
    "ips6_subnet": [],
    "ips_int": []
  }
}

Was this helpful to you?