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
Parameters | Type | Value | Description |
---|---|---|---|
act | GET | volume | The action will edit volume for a particular user and vpsdd. |
perform_action | POST | text | Pass 1 to attach volume Pass 2 to deattach volume Pass 3 to resize volume |
vpsid_vol | POST | int | vpsid of the volume |
e_vol_did | POST | int | Volume id |
vol_size | POST | int | pass volume if you want to resize the volume |
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"