Get Virtualizor

Suspend VM

Use Suspend Vps API to suspend VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=listvs&suspend=vpsid

Parameters

NameTypeValueDescriptionRequired
actGETlistvsRetrieves the list of vpsYes
suspendPOSTvpsidThe vpsid that needs to be suspendedYes

Sample Code

PHP

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

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);
    $vpsid = 3608;
    $output = $admin->suspend($vpsid);
    print_r(json_encode($output));
?>

Curl

curl -k -X GET -L "https://hostname:4083/index.php?act=listvs&
suspend=3606&api=json&apikey=your_api_key&
apipass=your_api_pass"

Output

{
    "uid": "372",
    "act": "listvs",
    "timezone": 1,
    "timenow": "October 7, 2016, 5:52 am",
    "vpsid": "3591",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "language": "english",
        "theme": "default",
        "timezone": 1,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": "12"
    },
    "pdns": {
        "pdnsid": "12"
    },
    "support_link": "http://softaculous.com",
    "title": "Virtual Servers",
    "vs": {
        "3591": {
            "vpsid": "3591",
            "vps_name": "v2109",
            "uuid": "tj1jeuk9tdeubn2t",
            "serid": "0",
            "time": "1475544843",
            "edittime": "1475815482",
            "virt": "kvm",
            "uid": "372",
            "plid": "0",
            "hostname": "ApiByAmeya",
            "osid": "100081",
            "os_name": "create-template",
            "iso": "",
            "sec_iso": "",
            "boot": "cda",
            "space": "6",
            "inodes": "0",
            "ram": "1024",
            "burst": "0",
            "swap": "1024",
            "cpu": "1024",
            "cores": "4",
            "cpupin": "-1",
            "cpu_percent": "0.00",
            "bandwidth": "5",
            "network_speed": "0",
            "upload_speed": "-1",
            "io": "0",
            "ubc": "",
            "acpi": "1",
            "apic": "1",
            "pae": "1",
            "shadow": "0",
            "vnc": "1",
            "vncport": "6287",
            "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": "e1000",
            "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": "0.00",
            "webuzo": "0",
            "disable_ebtables": "0",
            "admin_managed": "0",
            "rdp": "0",
            "topology_sockets": "0",
            "topology_cores": "0",
            "topology_threads": "0",
            "mac": "",
            "notes": null,
            "disable_nw_config": "0",
            "email": "test@test.com",
            "server_name": "localhost",
            "os_distro": "others",
            "distro": "others_40.gif",
            "status": 1,
            "ips": {
                "s8": "xx.xx.xx.xx"
            }
        },
        "3606": {
            "vpsid": "3606",
            "vps_name": "v2117",
            "uuid": "zy4idtgmu8jexfjz",
            "serid": "0",
            "time": "1475815018",
            "edittime": "0",
            "virt": "kvm",
            "uid": "372",
            "plid": "0",
            "hostname": "test_userapi",
            "osid": "347",
            "os_name": "centos-6.6-x86_64",
            "iso": "",
            "sec_iso": "",
            "boot": "cda",
            "space": "30",
            "inodes": "0",
            "ram": "1024",
            "burst": "0",
            "swap": "1024",
            "cpu": "1024",
            "cores": "4",
            "cpupin": "-1",
            "cpu_percent": "200.00",
            "bandwidth": "0",
            "network_speed": "0",
            "upload_speed": "-1",
            "io": "0",
            "ubc": "",
            "acpi": "1",
            "apic": "1",
            "pae": "1",
            "shadow": "0",
            "vnc": "1",
            "vncport": "6288",
            "vnc_passwd": "",
            "hvm": "0",
            "suspended": "1",
            "suspend_reason": null,
            "nw_suspended": null,
            "rescue": "0",
            "band_suspend": "1",
            "tuntap": "0",
            "ppp": "0",
            "ploop": "0",
            "dns_nameserver": "a:0:{}",
            "osreinstall_limit": "0",
            "preferences": null,
            "nic_type": "",
            "vif_type": "",
            "virtio": "0",
            "pv_on_hvm": "0",
            "kvm_cache": "",
            "io_mode": "",
            "cpu_mode": "",
            "total_iops_sec": "0",
            "read_bytes_sec": "0",
            "write_bytes_sec": "0",
            "kvm_vga": "0",
            "acceleration": "0",
            "vnc_keymap": "",
            "routing": "0",
            "mg": "",
            "used_bandwidth": "0.00",
            "webuzo": "0",
            "disable_ebtables": "0",
            "admin_managed": "0",
            "rdp": "0",
            "topology_sockets": "0",
            "topology_cores": "0",
            "topology_threads": "0",
            "mac": "",
            "notes": null,
            "disable_nw_config": "0",
            "email": "test@test.com",
            "server_name": "localhost",
            "os_distro": "centos",
            "distro": "centos_40.gif",
            "status": 2,
            "ips": {
                "s143228": "xx.xx.xx.xx"
            }
        }
    },
    "info": {
        "flags": {
            "enable_idsort": 1,
            "show_server": 0,
            "novnc": 1,
            "disable_java_vnc": 0
        }
    },
    "done": {
        "msg": "The VPS has been suspended",
        "goto": "act=listvs",
        "vpsid": "3606"
    },
    "suspend": {
        "done": 1,
        "done_msg": "The VPS has been suspended"
    },
    "time_taken": "4.038"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list