]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add volstatsu property to volumes overview endpoint
authorMarcin Haba <marcin.haba@bacula.pl>
Wed, 22 Mar 2023 14:49:02 +0000 (15:49 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 20 Apr 2023 10:00:26 +0000 (12:00 +0200)
gui/baculum/protected/API/Modules/VolumeManager.php
gui/baculum/protected/API/openapi_baculum.json

index 7889cf9e80debf339c2cc47f1860aad4c33a6933..038f00f28ed96ae60c5199617c7b1ad9f98f3513 100644 (file)
@@ -178,13 +178,14 @@ LEFT JOIN Storage USING (StorageId)
                // get disk volume types (file, dedup and alighed together)
                $vt_disk = $this->getDiskVolTypes();
                $sql = 'SELECT
-                               VolumeName   AS volumename,
-                               Pool.Name    AS pool,
-                               Storage.Name AS storage,
-                               VolBytes     AS volbytes,
-                               VolABytes    AS volabytes,
-                               InChanger    AS inchanger,
-                               Slot         AS slot,
+                               VolumeName      AS volumename,
+                               Pool.Name       AS pool,
+                               Storage.Name    AS storage,
+                               VolBytes        AS volbytes,
+                               VolABytes       AS volabytes,
+                               Media.VolStatus AS volstatus,
+                               InChanger       AS inchanger,
+                               Slot            AS slot,
                                CASE 
                                        WHEN Media.VolStatus IN (\'Full\', \'Used\') THEN ' . $expire_query . '
                                        ELSE 0
@@ -201,13 +202,14 @@ LEFT JOIN Storage USING (StorageId)
                // get tape volume types
                $vt_tape = $this->getTapeVolTypes();
                $sql = 'SELECT
-                               VolumeName   AS volumename,
-                               Pool.Name    AS pool,
-                               Storage.Name AS storage,
-                               VolBytes     AS volbytes,
-                               VolABytes    AS volabytes,
-                               InChanger    AS inchanger,
-                               Slot         AS slot,
+                               VolumeName      AS volumename,
+                               Pool.Name       AS pool,
+                               Storage.Name    AS storage,
+                               VolBytes        AS volbytes,
+                               VolABytes       AS volabytes,
+                               Media.VolStatus AS volstatus,
+                               InChanger       AS inchanger,
+                               Slot            AS slot,
                                CASE 
                                        WHEN Media.VolStatus IN (\'Full\', \'Used\') THEN ' . $expire_query . '
                                        ELSE 0
@@ -224,13 +226,14 @@ LEFT JOIN Storage USING (StorageId)
                // get cloud volume types
                $vt_cloud = $this->getCloudVolTypes();
                $sql = 'SELECT
-                               VolumeName   AS volumename,
-                               Pool.Name    AS pool,
-                               Storage.Name AS storage,
-                               VolBytes     AS volbytes,
-                               VolABytes    AS volabytes,
-                               InChanger    AS inchanger,
-                               Slot         AS slot,
+                               VolumeName      AS volumename,
+                               Pool.Name       AS pool,
+                               Storage.Name    AS storage,
+                               VolBytes        AS volbytes,
+                               VolABytes       AS volabytes,
+                               Media.VolStatus AS volstatus,
+                               InChanger       AS inchanger,
+                               Slot            AS slot,
                                CASE 
                                        WHEN Media.VolStatus IN (\'Full\', \'Used\') THEN ' . $expire_query . '
                                        ELSE 0
index 38662aa2af5564b187a72acdf260e12a1f682ea2..fed4c45db8ee838ad84e4c1475e5c0aef9adfb6a 100644 (file)
                                        "type": "integer",
                                        "description": "Volume compressed bytes"
                                },
+                               "volstatus": {
+                                       "description": "Volume status",
+                                       "type": "integer"
+                               },
                                "inchanger": {
                                        "type": "integer",
                                        "description": "InChanger flag"