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
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | Volumes | The action will return done as true after the particular volume has been edited | Yes |
e_serid | POST | Int | The serid of node where volumes is | Yes |
e_vpsid | POST | int | The vpsid for volu | Yes |
e_todo | POST | Int | The 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
)
)