Delete volume

Use Delete Volume API to delete all volumes on the server,

This function is for cloud user

HTTP Request

https://hostname:4083/index.php?act=volume

Parameters

</tr
ParametersTypeValueDescription
actGETvolumeThe action will delete volume of particular user and vps.
delvolPOSTintvolume id to delete it

Sample Code

PHP

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

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

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

   
    $post = array();
    $post['delvol'] = '249';
    $data = $v->delete_volumes($post);
    print_r($data);

Curl

curl -k -L "https://hostname:4083/index.php?act=volume
&api=json&apikey=your_api_key
&apipass=your_api_pass"

Output

Array
(
    [247] => Array
        (
            [did] => 247
            [disk_uuid] => d4sl17zln359niz8
            [st_uuid] => rjpzdi7exu0njjeh
            [vps_uuid] => tjkgme2cjn9tgzet
            [path] => /dev/vgs/vsv1003attach-d4sl17zln359niz8-tjkgme2cjn9tgzet
            [primary] => 0
            [size] => 1.000
            [size_unit] =>
            [type] => block
            [format] => raw
            [num] => 1
            [rescue] => 0
            [extra] =>
            [bus_driver] =>
            [bus_driver_num] => 0
            [user_uid] => 2
            [disk_name] => sec
            [mnt_point] => /mnt
            [stid] => 1
            [vpsid] => 143
            [vps_name] => v1003
            [serid] => 1
            [sgid] => 0
            [user_email] => testvirt.com
        )

)
Was this page helpful?