Delete VM

Use Delete VM API to delete your VPS from your server.

This function is for cloud user

HTTP Request

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

Parameters

NameTypeValueDescriptionRequired
actGETlistvsRetrieves the list of vps createdYes
delvsPOSTvpsidThe vpsid that needs to be deletedYes

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);
    $del_vpsid = 3589;
    $output = $admin->listvs($del_vpsid);

    print_r(json_encode($output));
?>

Curl

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

Output

{
    "uid": "372",
    "act": "listvs",
    "timezone": 1,
    "timenow": "October 7, 2016, 5:21 am",
    "vpsid": "3605",
    "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": {
        "3588": {
            "vpsid": "3588",
            "vps_name": "v2107",
            "uuid": "w39wbbcohi8rwz2p",
            "serid": "0",
            "time": "1475370479",
            "edittime": "1475799626",
            "virt": "kvm",
            "uid": "372",
            "plid": "0",
            "hostname": "testmic_23",
            "osid": "347",
            "os_name": "centos-6.6-x86_64",
            "iso": "",
            "sec_iso": "",
            "boot": "cda",
            "space": "42",
            "inodes": "0",
            "ram": "1024",
            "burst": "0",
            "swap": "1024",
            "cpu": "1024",
            "cores": "4",
            "cpupin": "-1",
            "cpu_percent": "200.00",
            "bandwidth": "1",
            "network_speed": "0",
            "upload_speed": "-1",
            "io": "0",
            "ubc": "",
            "acpi": "1",
            "apic": "1",
            "pae": "1",
            "shadow": "0",
            "vnc": "1",
            "vncport": "6285",
            "vnc_passwd": "",
            "hvm": "0",
            "suspended": "0",
            "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": "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": "0.02",
            "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": 1,
            "ips": {
                "s143228": "xx.xx.xx.xx"
            }
        },
        "3605": {
            "vpsid": "3605",
            "vps_name": "v2117",
            "uuid": "3b2dhqrq9cjilhbq",
            "serid": "0",
            "time": "1475812986",
            "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": "5",
            "inodes": "0",
            "ram": "1024",
            "burst": "0",
            "swap": "1024",
            "cpu": "1024",
            "cores": "8",
            "cpupin": "-1",
            "cpu_percent": "400.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": "0",
            "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": 1,
            "ips": {
                "s76463": "xx.xx.xx.xx."
            }
        }
    },
    "info": {
        "flags": {
            "enable_idsort": 1,
            "show_server": 0,
            "novnc": 1,
            "disable_java_vnc": 0
        }
    },
    "done": {
        "msg": "The VPS delete process has been initiated",
        "goto": "act=listvs",
        "vpsid": null
    },
    "delvs": {
        "done": true,
        "done_msg": "The VPS delete process has been initiated"
    },
    "time_taken": "0.488"
}
Was this helpful to you?