This is an automated email from the ASF dual-hosted git repository.

kiranchavala pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new fcca3e8f391 api,server: encryptformat in volume response (#9106)
fcca3e8f391 is described below

commit fcca3e8f39185122771495103c8ec0d68cf2b958
Author: Abhishek Kumar <abhishek.mr...@gmail.com>
AuthorDate: Tue Jun 11 11:20:50 2024 +0530

    api,server: encryptformat in volume response (#9106)
    
    Fixes #9014
    
    * api,server: encryptformat in volume response
    
    * Apply suggestions from code review
    
    * remove passphrase db change
---
 .../org/apache/cloudstack/api/response/VolumeResponse.java   | 12 ++++++++++--
 .../main/resources/META-INF/db/views/cloud.volume_view.sql   |  1 +
 .../main/java/com/cloud/api/query/dao/VolumeJoinDaoImpl.java |  1 +
 .../src/main/java/com/cloud/api/query/vo/VolumeJoinVO.java   |  7 +++++++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git 
a/api/src/main/java/org/apache/cloudstack/api/response/VolumeResponse.java 
b/api/src/main/java/org/apache/cloudstack/api/response/VolumeResponse.java
index 0d502a6d7a7..2ddc5fd097e 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/VolumeResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/VolumeResponse.java
@@ -290,13 +290,17 @@ public class VolumeResponse extends 
BaseResponseWithTagInformation implements Co
     private String externalUuid;
 
     @SerializedName(ApiConstants.VOLUME_CHECK_RESULT)
-    @Param(description = "details for the volume check result, they may vary 
for different hypervisors, since = 4.19.1")
+    @Param(description = "details for the volume check result, they may vary 
for different hypervisors", since = "4.19.1")
     private Map<String, String> volumeCheckResult;
 
     @SerializedName(ApiConstants.VOLUME_REPAIR_RESULT)
-    @Param(description = "details for the volume repair result, they may vary 
for different hypervisors, since = 4.19.1")
+    @Param(description = "details for the volume repair result, they may vary 
for different hypervisors", since = "4.19.1")
     private Map<String, String> volumeRepairResult;
 
+    @SerializedName(ApiConstants.ENCRYPT_FORMAT)
+    @Param(description = "the encrypt format of the volume", since = "4.19.1")
+    private String encryptFormat;
+
     public String getPath() {
         return path;
     }
@@ -842,4 +846,8 @@ public class VolumeResponse extends 
BaseResponseWithTagInformation implements Co
     public void setVolumeRepairResult(Map<String, String> volumeRepairResult) {
         this.volumeRepairResult = volumeRepairResult;
     }
+
+    public void setEncryptFormat(String encryptFormat) {
+        this.encryptFormat = encryptFormat;
+    }
 }
diff --git 
a/engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql 
b/engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql
index fd21fff1494..950dcddf4c7 100644
--- a/engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql
+++ b/engine/schema/src/main/resources/META-INF/db/views/cloud.volume_view.sql
@@ -39,6 +39,7 @@ SELECT
     `volumes`.`path` AS `path`,
     `volumes`.`chain_info` AS `chain_info`,
     `volumes`.`external_uuid` AS `external_uuid`,
+    `volumes`.`encrypt_format` AS `encrypt_format`,
     `account`.`id` AS `account_id`,
     `account`.`uuid` AS `account_uuid`,
     `account`.`account_name` AS `account_name`,
diff --git 
a/server/src/main/java/com/cloud/api/query/dao/VolumeJoinDaoImpl.java 
b/server/src/main/java/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
index 8fcad6ed45a..c4e4ba223d8 100644
--- a/server/src/main/java/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
+++ b/server/src/main/java/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
@@ -180,6 +180,7 @@ public class VolumeJoinDaoImpl extends 
GenericDaoBaseWithTagInformation<VolumeJo
 
         if (view == ResponseView.Full) {
             volResponse.setPath(volume.getPath());
+            volResponse.setEncryptFormat(volume.getEncryptFormat());
         }
 
         // populate owner.
diff --git a/server/src/main/java/com/cloud/api/query/vo/VolumeJoinVO.java 
b/server/src/main/java/com/cloud/api/query/vo/VolumeJoinVO.java
index a8d568ff245..a8fcbfe824e 100644
--- a/server/src/main/java/com/cloud/api/query/vo/VolumeJoinVO.java
+++ b/server/src/main/java/com/cloud/api/query/vo/VolumeJoinVO.java
@@ -275,6 +275,9 @@ public class VolumeJoinVO extends 
BaseViewWithTagInformationVO implements Contro
     @Column(name = "external_uuid")
     private String externalUuid = null;
 
+    @Column(name = "encrypt_format")
+    private String encryptFormat;
+
     public VolumeJoinVO() {
     }
 
@@ -610,6 +613,10 @@ public class VolumeJoinVO extends 
BaseViewWithTagInformationVO implements Contro
         this.externalUuid = externalUuid;
     }
 
+    public String getEncryptFormat() {
+        return encryptFormat;
+    }
+
     @Override
     public Class<?> getEntityType() {
         return Volume.class;

Reply via email to