Use the Edit Storage API to edit the configurations of the storage space on which VPSes are created. The configurations include name of the storage, alert threshold, changing the storage to be used as primary storage, and setting the oversell limit for the storage. The API response will contain "done" as "true" on successful update of the storage.
HTTP Request
https://hostname:4085/index.php?act=editstorage&stid=STID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | editstorage | The action will return done as true after the particular storage has been edited | Yes |
stid | GET | Int | The storage ID which needs to be edited | Yes |
name | POST | text | The name of the storage | Yes |
oversell | POST | Int | The oversell value given to the storage | No |
alert_threshold | POST | Int | If this used size crosses this percentage, an email will be sent to the Admin | No |
primary_storage | POST | 1/0 | If set then the storage will be set as primary | 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['stid'] = 113;
$post['name'] = 'QCOW File Storage';
$output = $admin->editstorage($post);
print_r(json_encode($output));
?>
Output
{
"title": "Edit Storage",
"done": true,
"timenow": 1535565069,
"time_taken": "0.281"
}