Get Virtualizor

VPS Configuration

Use VPS Configuration API to reconfigure your VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=hvmsettings&svs=vid

Parameters

NameTypeValueDescriptionRequired
actGEThvmsettingsThe action specified to return dataYes
svsPOSTIntThe vpsid whose settings will be changed. This is passed in URLYes
vidPOSTIntThe vpsid whose configuration has to be set.This is passed as a POST parameterYes
accelerationPOSTaccelerationIf enabled 2D & 3D acceleration will be enabledNo
bootPOSTbootSets the boot order in the vps boot values not specified eg: cda or dcaYes
hvm_vnc_keymapPOSThvm_vnc_keymapIf vnc is set then this will set vnc KeymapNo
hvmsettingsPOST1IF set, the hvm settings will be saved successfullyYes
isosPOSTisosThis will save name of the iso from a given listNo
nictypePOSTnictypeThis will select Network Interface cardYes
sec_isoPOSTsec_isoThis will set the secondary isoNo
enable_ppp_cpPOST10Enables Point to Point Protocol.(For OpenVZ)
enable_tuntap_cpPOST10Enables TunTap.(For OpenVZ)

Values for VNC keymap

en-ushusvhr
de-chittris
arltdeja
damken-gblv
etnlesnl-be
fonofipl
fr-beptfrpt-br
fr-chrufr-casl
th

Sample Code

PHP

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

    $key =  '';
    $pass = '';
    $ip = '';
    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);

    $post = array();
    $post['hvmsettings'] = 1;
    $post['acpi'] = 1;
    $post['apic'] = 1;
    $post['vnc'] = 0;
    $post['tuntap_enable'] = 1;
    $post['ppp_enable'] = 0;
    $post['boot'] = 'cd';
    $post['kvm_vga'] = 1;
    $post['acceleration'] = 1;
    $post['nic_type'] = 'e1000';
    $post['hvm_vnc_keymap'] = 'en-us';
    $vid = 3384;

    $output = $admin->hvmsettings($vid, $post);

    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "hvmsettings=1&acpi=1&apic=1&vnc=0&tuntap_enable=0& 
ppp_enable=1&boot=dc&kvm_vga=1&nic_type=e1000&hvm_vnc_keymap=en-us" 
-L "https://hostname:4083/index.php?act=hvmsettings&svs=3577&api=json& 
apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "hvmsettings",
    "timezone": 1,
    "timenow": "September 23, 2016, 6:41 am",
    "vpsid": "3008",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "language": "english",
        "theme": "default",
        "timezone": 1,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "HVM Settings",
    "done": {
        "msg": "The settings have been save successfully"
    },
    "boot": {
        "d": "CD Drive",
        "c": "Hard Disk"
    },
    "vnckeymaps": ["en-us", "de-ch", "ar", "da", "et", "fo", "fr-be", "fr-ch", "hu", "it", "lt", "mk", "nl", "no", "pt", "ru", "sv", "tr", "de", "en-gb", "es", "fi", "fr", "fr-ca", "hr", "is", "ja", "lv", "nl-be", "pl", "pt-br", "sl", "th"],
    "nictypes": {
        "default": "Realtek 8139(default)",
        "virtio": "Virtio",
        "e1000": "Intel E1000",
        "ne2k_pci": "Novell NE2000",
        "i82559er": "Intel i82559er",
        "pcnet": "AMD PCNET",
        "ne2k_isa": "Novell E2000 ISA"
    },
    "isos": {
        "debian-8.0.0-amd64-netinst.iso": {
            "iso": "debian-8.0.0-amd64-netinst.iso",
            "mg": [17],
            "name": "debian-8.0.0-amd64-netinst.iso",
            "filename": "debian-8.0.0-amd64-netinst.iso",
            "size": 257949696,
            "distro": "debian"
        },  
        "CentOS-6.8-x86_64-minimal.iso": {
            "iso": "CentOS-6.8-x86_64-minimal.iso",
            "mg": null,
            "name": "CentOS-6.8-x86_64-minimal.iso",
            "filename": "CentOS-6.8-x86_64-minimal.iso",
            "size": 468713472,
            "distro": "centos"
        },
        "CentOS-7-x86_64-Minimal-1511.iso": {
            "iso": "CentOS-7-x86_64-Minimal-1511.iso",
            "mg": null,
            "name": "CentOS-7-x86_64-Minimal-1511.iso",
            "filename": "CentOS-7-x86_64-Minimal-1511.iso",
            "size": 632291328,
            "distro": "centos"
        },
    },
    "oslist": null,
    "vps": {
        "vpsid": "3008",
        "vps_name": "v1846",
        "uuid": "5irewd0nb2jnmdyh",
        "serid": "1",
        "time": "1465779583",
        "edittime": "1473922007",
        "virt": "kvm",
        "uid": "321",
        "plid": "0",
        "hostname": "test_api",
        "osid": "347",
        "os_name": "centos-6.6-x86_64",
        "iso": "",
        "sec_iso": "",
        "boot": "dca",
        "space": "30",
        "inodes": "0",
        "ram": "2048",
        "burst": "0",
        "swap": "2048",
        "cpu": "2048",
        "cores": "8",
        "cpupin": "-1",
        "cpu_percent": "0.00",
        "bandwidth": "0",
        "network_speed": "0",
        "upload_speed": "-1",
        "io": "0",
        "ubc": "",
        "acpi": "1",
        "apic": "1",
        "pae": "1",
        "shadow": "0",
        "vnc": "1",
        "vncport": "5903",
        "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": "default",
        "vif_type": "",
        "virtio": "0",
        "pv_on_hvm": "0",
        "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": "7.56",
        "webuzo": "0",
        "disable_ebtables": "1",
        "admin_managed": "0",
        "rdp": "0",
        "topology_sockets": "0",
        "topology_cores": "0",
        "topology_threads": "0",
        "mac": "",
        "notes": null,
        "disable_nw_config": "0",
        "pid": "0"
    },
    "virt": "kvm",
    "flags": {
        "enable_tuntap_cp": 0,
        "enable_ppp_cp": 1,
        "enable_enduser_vnc": 1,
        "enable_nic": 1
    },
    "time_taken": "1.427"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list