]> git.datanom.net - omvzfs.git/blobdiff - gui/rpc/zfs.inc
Fix some bugs. Implement methods needed by zfs.inc. Zpool.php completed
[omvzfs.git] / gui / rpc / zfs.inc
index 48c7ef40a32c524c5a414096e90e2ef79a228831..c7fcb264d3e0088bed6aede3a93c9ea29fdda87f 100644 (file)
@@ -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;
This page took 0.032546 seconds and 5 git commands to generate.