API ISO

From Virtualizor Wiki
Jump to: navigation, search
NOTE
This is OLD API Documentation. Click on the following link for New API Documentation
Admin API

Add an ISO

Parameters Description
url URL of the OS ISO
filename Name of the ISO to be saved as( Optional)
mgs Name of the Media Group( Optional)

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

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

    $post = array();
    $post['url'] = 'http://files.example.com/template.iso';
    $post['filename'] = 'template_name';
    $post['mgs'] = 'mediagroup_name';

    $output = $admin->addiso($post);
    print_r($output);
?>

Returns:

Array
(
    [title] => Add ISO
    [done] => 1
)