From a11fc43788e873f09031d0b03cdbf6477d8305da Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sat, 9 Dec 2023 11:43:52 +0530 Subject: [PATCH] server: fix diskoffering details in vm response (#8135) Fixes #8120 --- .../org/apache/cloudstack/api/response/UserVmResponse.java | 4 ++-- .../java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java index 114403da7bc..4c67d24ae83 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/UserVmResponse.java @@ -159,11 +159,11 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co private String serviceOfferingName; @SerializedName(ApiConstants.DISK_OFFERING_ID) - @Param(description = "the ID of the disk offering of the virtual machine", since = "4.4") + @Param(description = "the ID of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4") private String diskOfferingId; @SerializedName("diskofferingname") - @Param(description = "the name of the disk offering of the virtual machine", since = "4.4") + @Param(description = "the name of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4") private String diskOfferingName; @SerializedName(ApiConstants.BACKUP_OFFERING_ID) diff --git a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java index 49489c2bfeb..7f376b16f02 100644 --- a/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java @@ -27,6 +27,7 @@ import java.util.stream.Collectors; import javax.inject.Inject; +import com.cloud.storage.Volume; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.annotation.AnnotationService; import org.apache.cloudstack.annotation.dao.AnnotationDao; @@ -42,6 +43,7 @@ import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.query.QueryService; import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -550,6 +552,11 @@ public class UserVmJoinDaoImpl extends GenericDaoBaseWithTagInformation