]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Add drive parameter to bconsole release command execution
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 28 Nov 2015 10:07:29 +0000 (11:07 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 28 Nov 2015 10:07:29 +0000 (11:07 +0100)
gui/baculum/protected/Pages/API/StorageRelease.php
gui/baculum/protected/application.xml

index 8d58565c5097d2eab34ad410ea5ccaf32fad7022..d272f4ddddebad39c6c74bc5dc91e57c6383b088 100644 (file)
 class StorageRelease extends BaculumAPI {
        public function get() {
                $storageid = intval($this->Request['id']);
+               $drive = intval($this->Request['drive']);
+
                $storage = $this->getModule('storage')->getStorageById($storageid);
                if(!is_null($storage)) {
-                       $storageRelease = $this->getModule('bconsole')->bconsoleCommand($this->director, array('release', 'storage="' . $storage->name . '"'), $this->user);
+                       $storageRelease = $this->getModule('bconsole')->bconsoleCommand($this->director, array('release', 'storage="' . $storage->name . '"', 'drive="' . $drive . '"'), $this->user);
                        $this->output = $storageRelease->output;
                        $this->error = (integer)$storageRelease->exitcode;
                } else {
@@ -35,4 +37,4 @@ class StorageRelease extends BaculumAPI {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 81f622649c84e943b3ea5815b4b26f3d6c24255d..116597d0f4e0542ca973dbe34f957f81f1d8b99d 100644 (file)
@@ -35,7 +35,7 @@
                        <url ServiceParameter="API.StorageStatus" pattern="storages/status/{id}/" parameters.id="\d+" />
                        <url ServiceParameter="API.StorageMount" pattern="storages/mount/{id}/{drive}/{slot}/" parameters.id="\d+" parameters.drive="\d+" parameters.slot="\d+" />
                        <url ServiceParameter="API.StorageUmount" pattern="storages/umount/{id}/{drive}/" parameters.id="\d+" parameters.drive="\d+" />
-                       <url ServiceParameter="API.StorageRelease" pattern="storages/release/{id}/" parameters.id="\d+" />
+                       <url ServiceParameter="API.StorageRelease" pattern="storages/release/{id}/{drive}/" parameters.id="\d+" parameters.drive="\d+" />
                        <!-- END Storages (storage daemons) -->
                        <!-- START Volumes (media) -->
                        <url ServiceParameter="API.Volumes" pattern="volumes/" />