示例#1
0
    $error->check();
}
if (isset($_REQUEST["vm_cpu"])) {
    $vm_cpu = $parse->vm_cpu($_REQUEST["vm_cpu"]);
    $error->check();
}
if (isset($_REQUEST["vm_memory"])) {
    $vm_memory = $parse->vm_memory($_REQUEST["vm_memory"]);
    $error->check();
}
if (isset($_REQUEST["vm_dedicated_nfs_size"])) {
    $vm_dedicated_nfs_size = $parse->vm_dedicated_nfs_size($_REQUEST["vm_dedicated_nfs_size"]);
    $error->check();
}
if (isset($_REQUEST["vm_snapshot_name"])) {
    $vm_snapshot_name = $parse->vm_snapshot_name($_REQUEST["vm_snapshot_name"]);
    $error->check();
}
if (isset($_REQUEST["op"])) {
    $op = $_REQUEST["op"];
} else {
    $op = null;
}
/***
 *** Operation
 ***/
switch ($op) {
    case 'vm_create':
        $zfs = new Zfs(ZFS_USER, ZFS_HOSTNAME);
        $zfs->create_vm($vm_name, $template_name, $vm_ip);
        $error->check();