Get Virtualizor

Edit Volumes

Edit volumes api is for editing the volumes,Volume can attached, deattached, resized and deleted.

HTTP Request

https://hostname:4085/index.php?act=volumes

Parameters

NameMethodValueDescriptionRequired
actGETVolumesThe action will return done as true after the particular volume has been editedYes
e_seridPOSTIntThe serid of node where volumes isYes
e_vpsidPOSTintThe vpsid for voluYes
e_todoPOSTIntThe action to perform 
pass 1 to attach volume
pass 2 to deattach volume
pass 3 to resize volume
Yes
e_disk_size POST int Size of the volume during resize No

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

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

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

     $post = array();
     $post['e_serid'] = 1;
     $post['e_vpsid'] = 143;
     $post['e_todo'] =  2;
     $post['e_disk_size'] = '';
     $post['disk_did_action'] = 246;
     
     $data = $admin->perform_volumes_actions($post);
     print_r($data);

?>

Output

Array
(
    ["done"] => Array
        (
            ["action_done"] => 1
        )

)
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list