This is an automated email from the ASF dual-hosted git repository. rohit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push: new 6f44a8d template: Return requireshvm key as part of list template response (#2921) 6f44a8d is described below commit 6f44a8d7ba22a45bc9f3827a0335d927bc91750f Author: Abhishek <abhishek.mr...@gmail.com> AuthorDate: Wed Oct 24 16:20:27 2018 +0530 template: Return requireshvm key as part of list template response (#2921) Added requireshvm key in the response of list template API. Fixes #2821 Signed-off-by: Abhishek Kumar <abhishek....@gmail.com> --- .../org/apache/cloudstack/api/response/TemplateResponse.java | 11 +++++++++++ .../java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java | 1 + 2 files changed, 12 insertions(+) diff --git a/api/src/main/java/org/apache/cloudstack/api/response/TemplateResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/TemplateResponse.java index 373198e..a83fe42 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/TemplateResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/TemplateResponse.java @@ -197,6 +197,10 @@ public class TemplateResponse extends BaseResponseWithTagInformation implements @Param(description = "if root disk template, then ids of the datas disk templates this template owns") private Set<ChildTemplateResponse> childTemplates; + @SerializedName(ApiConstants.REQUIRES_HVM) + @Param(description = "true if template requires HVM enabled, false otherwise") + private Boolean requiresHvm; + public TemplateResponse() { tags = new LinkedHashSet<ResourceTagResponse>(); } @@ -391,4 +395,11 @@ public class TemplateResponse extends BaseResponseWithTagInformation implements this.childTemplates = childTemplateIds; } + public Boolean isRequiresHvm() { + return requiresHvm; + } + + public void setRequiresHvm(Boolean requiresHvm) { + this.requiresHvm = requiresHvm; + } } diff --git a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java index c0d57d7..e4e0c44 100644 --- a/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java +++ b/server/src/main/java/com/cloud/api/query/dao/TemplateJoinDaoImpl.java @@ -213,6 +213,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation<Templa } templateResponse.setDirectDownload(template.isDirectDownload()); + templateResponse.setRequiresHvm(template.isRequiresHvm()); //set template children disks Set<ChildTemplateResponse> childTemplatesSet = new HashSet<ChildTemplateResponse>();