require_once("zfs/Dataset.php");
require_once("zfs/Snapshot.php");
require_once("zfs/Zvol.php");
+require_once("zfs/Zpool.php");
class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
public function getName() { return "ZFS";} // RPC Service name. Same as in .js files
public function addObject($params, $context) {
$this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR));
switch ($params['type']) {
- case "filesystem":
+ case "Filesystem":
$name = $params['path'] . "/" . $params['name'];
$tmp = new OMVModuleZFSDataset($name);
break;
- case "snapshot":
+ case "Snapshot":
$name = $params['path'] . "@" . $params['name'];
$tmp = new OMVModuleZFSSnapshot($name);
break;
- case "volume":
+ case "Volume":
$name = $params['path'] . "/" . $params['name'];
$tmp = new OMVModuleZFSZvol($name);
$tmp->create($params['size']);
break;
+ case "Pool":
+ $name = $params['path'] . "/" . $params['name'];
+ $tmp = new OMVModuleZFSZpool($name);
+ break;
default:
throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
break;
$tmp = new OMVModuleZFSZvol($name);
$tmp->destroy();
break;
+ case "Pool":
+ $name = $params['name'];
+ $tmp = new OMVModuleZFSZpool($name);
+ $tmp->destroy();
+ break;
default:
throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
break;
$objects = array();
$name = $params['name'];
switch ($params['type']) {
- case "Filesystem" || "Clone":
+ case "Filesystem":
+ case "Clone":
$tmp = new OMVModuleZFSDataset($name);
break;
case "Snapshot":
case "Volume":
$tmp = new OMVModuleZFSZvol($name);
break;
+ case "Pool":
+ $tmp = new OMVModuleZFSZpool($name);
+ break;
default:
throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
break;
$this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR));
$objects = array();
switch ($params['type']) {
- case "Filesystem" || "Clone":
+ case "Filesystem":
+ case "Clone":
$tmp = new OMVModuleZFSDataset($params['name']);
break;
case "Snapshot":
case "Volume":
$tmp = new OMVModuleZFSZvol($params['name']);
break;
+ case "Pool":
+ $tmp = new OMVModuleZFSZpool($params['name']);
+ break;
default:
throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
break;
$bgOutputFilename = $this->createBgProcOutput();
$this->updateBgProcStatus($bgStatusFilename, "outputfilename", $bgOutputFilename);
switch ($params['type']) {
- case "Filesystem" || "Clone":
+ case "Filesystem":
+ case "Clone":
$tmp = new OMVModuleZFSDataset($params['name']);
break;
case "Snapshot":
case "Volume":
$tmp = new OMVModuleZFSZvol($params['name']);
break;
+ case "Pool":
+ $tmp = new OMVModuleZFSZpool($params['name']);
+ break;
default:
throw new OMVModuleZFSException("Illegal type provided: " . $params['type']);
break;
// Prepare the configuration object. Use the name of the shared
// folder as the relative directory name of the share.
switch ($params['type']) {
- case "Filesystem" || "Clone":
+ case "Filesystem":
+ case "Clone":
$tmp = new OMVModuleZFSDataset($name);
break;
default: