From: Marcin Haba Date: Wed, 22 Mar 2023 14:49:02 +0000 (+0100) Subject: baculum: Add volstatsu property to volumes overview endpoint X-Git-Tag: Release-13.0.3~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bab3b2b2a6ba17840360e43e7e0b80d58a2f6071;p=thirdparty%2Fbacula.git baculum: Add volstatsu property to volumes overview endpoint --- diff --git a/gui/baculum/protected/API/Modules/VolumeManager.php b/gui/baculum/protected/API/Modules/VolumeManager.php index 7889cf9e8..038f00f28 100644 --- a/gui/baculum/protected/API/Modules/VolumeManager.php +++ b/gui/baculum/protected/API/Modules/VolumeManager.php @@ -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 diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index 38662aa2a..fed4c45db 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -9566,6 +9566,10 @@ "type": "integer", "description": "Volume compressed bytes" }, + "volstatus": { + "description": "Volume status", + "type": "integer" + }, "inchanger": { "type": "integer", "description": "InChanger flag"