X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/5ff626ba7c8db2bd124cc64d49a8f31117d1f26c..8a2223a43e8e699a92efe950117edd4179866335:/gui/rpc/zfs.inc diff --git a/gui/rpc/zfs.inc b/gui/rpc/zfs.inc index 48c7ef4..c7fcb26 100644 --- a/gui/rpc/zfs.inc +++ b/gui/rpc/zfs.inc @@ -10,6 +10,7 @@ require_once("zfs/Utils.php"); 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 @@ -48,19 +49,23 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { 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; @@ -86,6 +91,11 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { $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; @@ -107,6 +117,9 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { case "Volume": $tmp = new OMVModuleZFSZvol($name); break; + case "Pool": + $tmp = new OMVModuleZFSZpool($name); + break; default: throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); break; @@ -137,6 +150,9 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { 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; @@ -171,6 +187,9 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract { 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;