]>
Commit | Line | Data |
---|---|---|
6b3ce31b MR |
1 | <?php |
2 | ||
3 | require_once("openmediavault/object.inc"); | |
4 | require_once("openmediavault/config.inc"); | |
5 | require_once("openmediavault/error.inc"); | |
6 | require_once("openmediavault/util.inc"); | |
7 | require_once("openmediavault/rpcservice.inc"); | |
8 | require_once("openmediavault/notify.inc"); | |
9 | require_once("zfs/Utils.php"); | |
10 | require_once("zfs/Dataset.php"); | |
11 | require_once("zfs/Snapshot.php"); | |
12 | require_once("zfs/Zvol.php"); | |
503ffcc8 | 13 | require_once("zfs/Zpool.php"); |
c0253592 | 14 | require_once("zfs/NotifyListener.php"); |
6b3ce31b MR |
15 | |
16 | class OMVRpcServiceZFS extends OMVRpcServiceAbstract { | |
a36352f7 NB |
17 | public function getName() { |
18 | return "ZFS"; // RPC Service name. Same as in .js files | |
19 | } | |
6b3ce31b | 20 | |
a36352f7 NB |
21 | /* Initialize the RPC service. Different methods of the RPC service are declared here*/ |
22 | public function initialize() { | |
42856e8b | 23 | $this->registerMethod("addPool"); |
a36352f7 NB |
24 | $this->registerMethod("getObjectTree"); |
25 | $this->registermethod("passParam"); | |
26 | $this->registermethod("addObject"); | |
27 | $this->registermethod("deleteObject"); | |
28 | $this->registermethod("getProperties"); | |
29 | $this->registermethod("setProperties"); | |
30 | $this->registermethod("inherit"); | |
31 | $this->registermethod("getSharedParams"); | |
32 | $this->registermethod("createShare"); | |
54b9d43e | 33 | $this->registermethod("getObjectDetails"); |
a36352f7 | 34 | } |
6b3ce31b | 35 | |
42856e8b NB |
36 | public function addPool($params, $context) { |
37 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
38 | // Validate the parameters of the RPC service method. |
39 | $this->validateMethodParams($params, '{ | |
40 | "type":"object", | |
41 | "properties":{ | |
42 | "pooltype":{"type":"string","enum":["basic","mirror",' . | |
43 | '"raidz1","raidz2","raidz3"]}, | |
44 | "force":{"type":"boolean"}, | |
45 | "mountpoint":{"type":"string"}, | |
46 | "name":{"type":"string"}, | |
47 | "devices":{"type":"string"} | |
48 | } | |
49 | }'); | |
42856e8b NB |
50 | switch ($params['pooltype']) { |
51 | case "basic": | |
52 | $pooltype = OMVModuleZFSVdevType::OMVMODULEZFSPLAIN; | |
53 | break; | |
54 | case "mirror": | |
55 | $pooltype = OMVModuleZFSVdevType::OMVMODULEZFSMIRROR; | |
56 | break; | |
57 | case "raidz1": | |
58 | $pooltype = OMVModuleZFSVdevType::OMVMODULEZFSRAIDZ1; | |
59 | break; | |
60 | case "raidz2": | |
61 | $pooltype = OMVModuleZFSVdevType::OMVMODULEZFSRAIDZ2; | |
62 | break; | |
63 | case "raidz3": | |
64 | $pooltype = OMVModuleZFSVdevType::OMVMODULEZFSRAIDZ3; | |
65 | break; | |
66 | default: | |
67 | throw new OMVModuleZFSException("Incorrect pool type specified"); | |
68 | break; | |
69 | } | |
7d6b772c NB |
70 | //Check for user supplied options |
71 | $opts = ""; | |
72 | if ($params['force']) { | |
73 | $opts .= "-f "; | |
74 | } | |
c6117b32 NB |
75 | if (strlen($params['mountpoint']) > 0) { |
76 | $opts .= "-m " . $params['mountpoint'] . " "; | |
77 | } | |
78 | ||
e20fe312 | 79 | //Use /dev/disk/by-path as deafult when creating new pools as suggested in ZoL FAQ. |
42856e8b | 80 | $disks = preg_split("/[,;]/", $params['devices']); |
e20fe312 NB |
81 | if (file_exists("/dev/disk/by-path/")) { |
82 | $tmp_disks = array(); | |
83 | foreach ($disks as $disk) { | |
84 | $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk); | |
85 | } | |
86 | $disks = $tmp_disks; | |
87 | } | |
88 | ||
42856e8b | 89 | $vdev = new OMVModuleZFSVdev($params['name'], $pooltype, $disks); |
7d6b772c | 90 | $pool = new OMVModuleZFSZpool($vdev, $opts); |
57667eb1 NB |
91 | //Ugly fix to solve the problem of blkid not displaying info on newly created pools |
92 | $pool->export(); | |
93 | $pool->import($pool->getName()); | |
42856e8b NB |
94 | } |
95 | ||
6b3ce31b MR |
96 | public function getObjectTree($params, $context) { |
97 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
98 | $objects = OMVModuleZFSUtil::getZFSFlatArray(); | |
99 | $new = array(); | |
100 | foreach ($objects as $a){ | |
101 | $new[$a['parentid']][] = $a; | |
102 | } | |
103 | $tree = OMVModuleZFSUtil::createTree($new, $new['root']); | |
a36352f7 | 104 | OMVModuleZFSUtil::addMissingOMVMntEnt(); //Adds missing ZFS filesystems to the OMV core |
6b3ce31b MR |
105 | return $tree; |
106 | } | |
107 | ||
108 | public function passParam($params, $context) { | |
109 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
110 | // Validate the parameters of the RPC service method. |
111 | $this->validateMethodParams($params, '{ | |
112 | "type":"object", | |
113 | "properties":{ | |
114 | "key":{"type":"string"}, | |
115 | "value":{"type":"string"} | |
116 | } | |
117 | }'); | |
6b3ce31b MR |
118 | return array($params['key'] => $params['value']); |
119 | } | |
120 | ||
121 | public function addObject($params, $context) { | |
122 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
123 | // Validate the parameters of the RPC service method. |
124 | $this->validateMethodParams($params, '{ | |
125 | "type":"object", | |
126 | "properties":{ | |
127 | "type":{"type":"string","enum":["filesystem","snapshot",' . | |
128 | '"volume"]}, | |
129 | "path":{"type":"string"}, | |
130 | "name":{"type":"string"}, | |
131 | "size":{"type":"string"} | |
132 | } | |
133 | }'); | |
6b3ce31b | 134 | switch ($params['type']) { |
57667eb1 | 135 | case "filesystem": |
6b3ce31b MR |
136 | $name = $params['path'] . "/" . $params['name']; |
137 | $tmp = new OMVModuleZFSDataset($name); | |
138 | break; | |
57667eb1 | 139 | case "snapshot": |
6b3ce31b MR |
140 | $name = $params['path'] . "@" . $params['name']; |
141 | $tmp = new OMVModuleZFSSnapshot($name); | |
142 | break; | |
57667eb1 | 143 | case "volume": |
6b3ce31b MR |
144 | $name = $params['path'] . "/" . $params['name']; |
145 | $tmp = new OMVModuleZFSZvol($name); | |
146 | $tmp->create($params['size']); | |
147 | break; | |
148 | default: | |
149 | throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); | |
150 | break; | |
151 | } | |
152 | } | |
153 | ||
154 | public function deleteObject($params, $context) { | |
155 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
156 | // Validate the parameters of the RPC service method. |
157 | $this->validateMethodParams($params, '{ | |
158 | "type":"object", | |
159 | "properties":{ | |
160 | "type":{"type":"string","enum":["Filesystem","Snapshot",' . | |
161 | '"Volume","Clone","Pool"]}, | |
162 | "name":{"type":"string"} | |
163 | } | |
164 | }'); | |
97e4887b NB |
165 | global $xmlConfig; |
166 | $name = $params['name']; | |
6b3ce31b | 167 | switch ($params['type']) { |
81500319 | 168 | case "Filesystem": |
216661f4 NB |
169 | OMVModuleZFSUtil::deleteShares($name); |
170 | $tmp = new OMVModuleZFSDataset($name); | |
171 | $tmp->destroy(); | |
172 | break; | |
81500319 | 173 | case "Clone": |
6b3ce31b MR |
174 | $tmp = new OMVModuleZFSDataset($name); |
175 | $tmp->destroy(); | |
176 | break; | |
177 | case "Snapshot": | |
6b3ce31b MR |
178 | $tmp = new OMVModuleZFSSnapshot($name); |
179 | $tmp->destroy(); | |
180 | break; | |
181 | case "Volume": | |
6b3ce31b MR |
182 | $tmp = new OMVModuleZFSZvol($name); |
183 | $tmp->destroy(); | |
184 | break; | |
503ffcc8 | 185 | case "Pool": |
97e4887b NB |
186 | $disks = OMVModuleZFSUtil::getDevDisksByPool($name); |
187 | $pooluuid = OMVModuleZFSUtil::getUUIDbyName($name); | |
503ffcc8 MR |
188 | $tmp = new OMVModuleZFSZpool($name); |
189 | $tmp->destroy(); | |
97e4887b NB |
190 | $xpath = "//system/fstab/mntent[fsname='" . $pooluuid . "' and type='zfs']"; |
191 | $object = $xmlConfig->get($xpath); | |
192 | $xmlConfig->delete($xpath); | |
193 | $dispatcher = &OMVNotifyDispatcher::getInstance(); | |
194 | $dispatcher->notify(OMV_NOTIFY_DELETE,"org.openmediavault.system.fstab.mntent", $object); | |
195 | OMVModuleZFSUtil::clearZFSLabel($disks); | |
503ffcc8 | 196 | break; |
6b3ce31b MR |
197 | default: |
198 | throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); | |
199 | break; | |
200 | } | |
201 | } | |
202 | ||
203 | public function getProperties($params, $context) { | |
204 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
205 | // Validate the parameters of the RPC service method. |
206 | $this->validateMethodParams($params, '{ | |
207 | "type":"object", | |
208 | "properties":{ | |
209 | "type":{"type":"string"}, | |
210 | "name":{"type":"string"}, | |
211 | "start":{"type":"integer"}, | |
212 | "limit":{'.$GLOBALS['OMV_JSONSCHEMA_COUNTFIELD'].'}, | |
213 | "sortfield":{'.$GLOBALS['OMV_JSONSCHEMA_SORTFIELD'].'}, | |
214 | "sortdir":{'.$GLOBALS['OMV_JSONSCHEMA_SORTDIR'].'} | |
215 | } | |
216 | }'); | |
6b3ce31b MR |
217 | $objects = array(); |
218 | $name = $params['name']; | |
219 | switch ($params['type']) { | |
5ff626ba MR |
220 | case "Filesystem": |
221 | case "Clone": | |
6b3ce31b MR |
222 | $tmp = new OMVModuleZFSDataset($name); |
223 | break; | |
224 | case "Snapshot": | |
225 | $tmp = new OMVModuleZFSSnapshot($name); | |
226 | break; | |
227 | case "Volume": | |
228 | $tmp = new OMVModuleZFSZvol($name); | |
229 | break; | |
503ffcc8 | 230 | case "Pool": |
a36352f7 NB |
231 | $tmp = new OMVModuleZFSZpool($name); |
232 | break; | |
6b3ce31b MR |
233 | default: |
234 | throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); | |
235 | break; | |
236 | } | |
237 | $properties = $tmp->getProperties(); | |
238 | foreach ($properties as $propertyk => $propertyv) { | |
239 | if (!(strcmp($propertyv['source'], "-") == 0)) { | |
240 | $objects[] = array('property' => $propertyk, | |
241 | 'value' => $propertyv['value'], | |
242 | 'source' => $propertyv['source'], | |
243 | 'modified' => "false"); | |
244 | } | |
245 | } | |
246 | return $objects; | |
247 | } | |
248 | ||
249 | public function setProperties($params, $context) { | |
250 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
251 | // Validate the parameters of the RPC service method. |
252 | $this->validateMethodParams($params, '{ | |
253 | "type":"object", | |
254 | "properties":{ | |
255 | "type":{"type":"string","enum":["Filesystem","Snapshot",' . | |
256 | '"Volume","Clone","Pool"]}, | |
257 | "name":{"type":"string"}, | |
258 | "properties":{"type":"array","items":{ | |
259 | "type":"object", | |
260 | "properties":{ | |
261 | "property":{"type":"string"}, | |
262 | "value":{"type":"string"}}}} | |
263 | } | |
264 | }'); | |
6b3ce31b MR |
265 | $objects = array(); |
266 | switch ($params['type']) { | |
5ff626ba MR |
267 | case "Filesystem": |
268 | case "Clone": | |
6b3ce31b MR |
269 | $tmp = new OMVModuleZFSDataset($params['name']); |
270 | break; | |
271 | case "Snapshot": | |
272 | $tmp = new OMVModuleZFSSnapshot($params['name']); | |
273 | break; | |
274 | case "Volume": | |
275 | $tmp = new OMVModuleZFSZvol($params['name']); | |
276 | break; | |
503ffcc8 MR |
277 | case "Pool": |
278 | $tmp = new OMVModuleZFSZpool($params['name']); | |
279 | break; | |
6b3ce31b MR |
280 | default: |
281 | throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); | |
282 | break; | |
81500319 | 283 | } |
6b3ce31b MR |
284 | foreach ($params['properties'] as $property) { |
285 | $objects[$property['property']] = $property['value']; | |
286 | } | |
287 | $tmp->setProperties($objects); | |
288 | } | |
289 | ||
290 | public function inherit($params, $context) { | |
291 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
292 | // Validate the parameters of the RPC service method. |
293 | $this->validateMethodParams($params, '{ | |
294 | "type":"object", | |
295 | "properties":{ | |
296 | "type":{"type":"string","enum":["Filesystem","Snapshot",' . | |
297 | '"Volume","Clone","Pool"]}, | |
298 | "name":{"type":"string"}, | |
299 | "property":{"type":"string"} | |
300 | } | |
301 | }'); | |
6b3ce31b MR |
302 | // Create a background process. |
303 | $bgStatusFilename = $this->createBgProcStatus(); | |
304 | $pid = $this->fork(); | |
305 | if($pid > 0) { // Parent process. | |
306 | $this->initializeBgProcStatus($bgStatusFilename, $pid); | |
307 | return $bgStatusFilename; | |
308 | } | |
309 | // Child process. | |
310 | try { | |
311 | $bgOutputFilename = $this->createBgProcOutput(); | |
312 | $this->updateBgProcStatus($bgStatusFilename, "outputfilename", $bgOutputFilename); | |
313 | switch ($params['type']) { | |
5ff626ba MR |
314 | case "Filesystem": |
315 | case "Clone": | |
6b3ce31b MR |
316 | $tmp = new OMVModuleZFSDataset($params['name']); |
317 | break; | |
318 | case "Snapshot": | |
319 | $tmp = new OMVModuleZFSSnapshot($params['name']); | |
320 | break; | |
321 | case "Volume": | |
322 | $tmp = new OMVModuleZFSZvol($params['name']); | |
323 | break; | |
503ffcc8 MR |
324 | case "Pool": |
325 | $tmp = new OMVModuleZFSZpool($params['name']); | |
326 | break; | |
6b3ce31b MR |
327 | default: |
328 | throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); | |
329 | break; | |
330 | } | |
331 | $tmp->inherit($params['property']); | |
332 | $this->finalizeBgProcStatus($bgStatusFilename, $output); | |
333 | exit(0); | |
334 | } catch(Exception $e) { | |
335 | $this->finalizeBgProcStatus($bgStatusFilename, "", $e); | |
336 | exit(1); | |
337 | } | |
338 | } | |
339 | ||
340 | public function getSharedParams($params, $context) { | |
341 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
342 | // Validate the parameters of the RPC service method. |
343 | $this->validateMethodParams($params, '{ | |
344 | "type":"object", | |
345 | "properties":{ | |
346 | "type":{"type":"string"}, | |
347 | "name":{"type":"string"} | |
348 | } | |
349 | }'); | |
6b3ce31b MR |
350 | $objects = array(); |
351 | $ds = new OMVModuleZFSDataset($params['name']); | |
352 | $mountpoint = $ds->getMountPoint(); | |
353 | return array( | |
354 | "mountpoint" => $mountpoint, | |
355 | "name" => $params['name'], | |
356 | "type" => $params['type']); | |
357 | } | |
358 | ||
359 | public function createShare($params, $context) { | |
360 | global $xmlConfig; | |
361 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
ecee099b NB |
362 | // Validate the parameters of the RPC service method. |
363 | $this->validateMethodParams($params, '{ | |
364 | "type":"object", | |
365 | "properties":{ | |
366 | "name":{"type":"string"}, | |
367 | "type":{"type":"string","enum":["Filesystem","Clone"]}, | |
368 | "sharename":{'.$GLOBALS['OMV_JSONSCHEMA_SHARENAME'].'}, | |
369 | "comment":{"type":"string"}, | |
370 | "mode":{"type":"string","enum":["700","750","755",'. | |
371 | '"770","775","777"],"optional":true}, | |
372 | "mountpoint":{"type":"string"} | |
373 | } | |
374 | }'); | |
6b3ce31b MR |
375 | |
376 | //Get the UUID of the Pool | |
4163f889 NB |
377 | $poolname = OMVModuleZFSUtil::getPoolname($params['name']); |
378 | $pooluuid = OMVModuleZFSUtil::getUUIDbyName($poolname); | |
6b3ce31b | 379 | |
6b3ce31b | 380 | //Get the mntent object and fetch it's uuid. |
216661f4 | 381 | $xpath = "//system/fstab/mntent[fsname='" . $pooluuid . "']"; |
4163f889 NB |
382 | $mountpoint = $xmlConfig->get($xpath); |
383 | $mntentref = $mountpoint['uuid']; | |
6b3ce31b MR |
384 | |
385 | // Prepare the configuration object. Use the name of the shared | |
386 | // folder as the relative directory name of the share. | |
387 | switch ($params['type']) { | |
5ff626ba | 388 | case "Filesystem": |
a36352f7 NB |
389 | $tmp = new OMVModuleZFSDataset($params['name']); |
390 | break; | |
5ff626ba | 391 | case "Clone": |
a36352f7 | 392 | $tmp = new OMVModuleZFSDataset($params['name']); |
6b3ce31b MR |
393 | break; |
394 | default: | |
395 | throw new OMVModuleZFSException("Illegal type provided: " . $params['type']); | |
396 | break; | |
397 | } | |
398 | ||
399 | $uuid = OMVUtil::uuid(); | |
400 | $pathName = $tmp->getMountPoint(); | |
216661f4 | 401 | $reldirpath = OMVModuleZFSUtil::getReldirpath($pathName); |
6b3ce31b MR |
402 | $object = array( |
403 | "uuid" => $uuid, | |
404 | "name" => $params['sharename'], | |
405 | "comment" => $params['comment'], | |
406 | "mntentref" => $mntentref, | |
407 | "reldirpath" => $reldirpath | |
408 | ); | |
409 | ||
410 | // Set the configuration object. | |
411 | $success = FALSE; | |
412 | // Check uniqueness. The share name must be global unique because | |
413 | // the name is also used when exporting a shared folder via NFS for | |
414 | // example. | |
415 | $xpath = sprintf("//system/shares/sharedfolder[name='%s']", | |
416 | $params['name']); | |
417 | if(TRUE === $xmlConfig->exists($xpath)) { | |
418 | throw new OMVException(OMVErrorMsg::E_CONFIG_OBJECT_UNIQUENESS, | |
419 | gettext("A shared folder with the given name already exists")); | |
420 | } | |
421 | ||
422 | // Add empty list of privileges per default. | |
423 | $object['privileges'] = array(); | |
424 | ||
425 | // Append object to configuration. | |
426 | $success = $xmlConfig->set("//system/shares", | |
427 | array("sharedfolder" => $object)); | |
428 | if(FALSE === $success) { | |
429 | throw new OMVException(OMVErrorMsg::E_CONFIG_SET_OBJECT_FAILED); | |
430 | } | |
431 | ||
432 | // Append the file mode field to the notification object if set. | |
433 | // Defaults to 775. | |
434 | $object['mode'] = "775"; | |
435 | if(array_key_exists("mode", $params)) { | |
436 | $object['mode'] = $params['mode']; | |
437 | } | |
438 | ||
439 | // Change group owner of directory to configured default group, | |
440 | // e.g. 'users'. | |
441 | if(FALSE === chgrp($pathName, $GLOBALS['OMV_USERMGMT_DEFAULT_GROUP'])) { | |
442 | throw new OMVException(OMVErrorMsg::E_MISC_FAILURE, | |
443 | sprintf("Failed to set file group to '%s' for '%s'", | |
444 | $GLOBALS['OMV_USERMGMT_DEFAULT_GROUP'], $pathName)); | |
445 | } | |
446 | ||
447 | // Set the setgid bit. Setting this permission means that all files | |
448 | // created in the folder will inherit the group of the folder rather | |
449 | // than the primary group of the user who creates the file. | |
450 | $mode = fileperms($pathName) | 02000; | |
451 | if(FALSE === chmod($pathName, $mode)) { | |
452 | throw new OMVException(OMVErrorMsg::E_MISC_FAILURE, | |
453 | sprintf("Failed to set file mode to '%o' for '%s'", | |
454 | $mode, $pathName)); | |
455 | } | |
456 | ||
457 | // Notify configuration changes. | |
458 | $dispatcher = &OMVNotifyDispatcher::getInstance(); | |
459 | $dispatcher->notify(OMV_NOTIFY_CREATE,"org.openmediavault.system.shares.sharedfolder", $object); | |
460 | // Return the configuration object. | |
461 | return $object; | |
6b3ce31b MR |
462 | } |
463 | ||
54b9d43e NB |
464 | public function getObjectDetails($params, $context) { |
465 | $this->validateMethodContext($context, array("role" => OMV_ROLE_ADMINISTRATOR)); | |
466 | // Validate the parameters of the RPC service method. | |
467 | $this->validateMethodParams($params, '{ | |
468 | "type":"object", | |
469 | "properties":{ | |
470 | "name":{"type":"string"}, | |
471 | "type":{"type":"string"} | |
472 | } | |
473 | }'); | |
474 | $output = ""; | |
475 | switch ($params['type']) { | |
476 | case "Filesystem": | |
477 | $output .= "Filesystem details (zfs get all):\n\r\n\r"; | |
478 | $cmd = "zfs get all {$params['name']}"; | |
479 | break; | |
480 | case "Volume": | |
481 | $output .= "Volume details (zfs get all):\n\r\n\r"; | |
482 | $cmd = "zfs get all {$params['name']}"; | |
483 | break; | |
484 | case "Snapshot": | |
485 | $output .= "Snapshot details (zfs get all):\n\r\n\r"; | |
486 | $cmd = "zfs get all {$params['name']}"; | |
487 | break; | |
488 | case "Pool": | |
489 | $output .= "Pool details (zpool get all):\n\r\n\r"; | |
490 | $cmd = "zpool get all {$params['name']}"; | |
491 | break; | |
492 | default: | |
493 | throw new OMVModuleZFSException("Incorrect type provided"); | |
494 | } | |
495 | OMVModuleZFSUtil::exec($cmd,$out,$res); | |
496 | $output .= implode("\n\r", $out); | |
497 | return array("details" => $output); | |
498 | } | |
6b3ce31b MR |
499 | } |
500 | ||
501 | // Register the RPC service. | |
81500319 | 502 | $rpcServiceMgr = &OMVRpcServiceMgr::getInstance(); // Get the "root" instance for the Services |
6b3ce31b MR |
503 | $rpcServiceMgr->registerService(new OMVRpcServiceZFS()); // Register a new instance of the RPC service described above |
504 | ?> | |
505 |