Edit volume

The action will edit volume for a particular vps and user. Use Edit Volume API to attach,deattach,resize and delete volume on your server.

This function is for cloud user

HTTP Request

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

Parameters

ParametersTypeValueDescription
actGETvolumeThe action will edit volume for a particular user and vpsdd.
perform_actionPOSTtextPass 1 to attach volume
Pass 2 to deattach volume
Pass 3 to resize volume
vpsid_volPOSTintvpsid of the volume
e_vol_didPOSTintVolume id
vol_sizePOSTintpass volume if you want to resize the volume

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['perform_action'] = '2';
    $post['vpsid_vol']= 143;
    $post['e_vol_did']= 249;

    $data = $v->perform_action_volume($post);
    print_r($data);

Curl

curl -k -X POST -d "perform_action=2&vpsid_vol=143&e_vol_did=249" -L 

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

&api=json&apikey=your_api_key

&apipass=your_api_pass"

Output

 Array
        (
            [msg] => Volume detached from VPS
            [goto] => act=volume
        )

Was this page helpful?