Use the Add ISO API to add an ISO image on the server. All ISOs are stored in /var/virtualizor/iso
directory of the server. These ISOs can be used to create Virtual
Private Servers. The API response will contain "done" as "1" on
successful download of the ISO.
For more information, you can refer this Add ISO guide.
HTTP Request
https://hostname:4085/index.php?act=edittemplate&osid=OSID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | addiso | The action specified to perform operation and retrieve data | Yes |
url | POST | text | URL of the OS ISO | Yes |
filename | POST | text | Name of the ISO to be saved as | No |
mgs | POST | array | Array of media group IDs, if passed the added ISO will belong to that media group(s) | 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['url'] = 'http://old.kali.org/kali-images/kali-1.0.6/kali-linux-1.0.6-amd64-mini.iso';
$post['filename'] = 'template_name';
$output = $admin->addiso($post);
print_r($output);
?>
Output
{
"title": "Add ISO",
"done": 1,
"time_taken": "0.187"
}