Updated Branches: refs/heads/master 7c5c3c5df -> 9924b6483
commit 3a3cb60e85c0254ebceff55d0b210ca1ff5386a6 Author: Likitha Shetty <[email protected]> Date: Wed Jan 9 11:54:25 2013 +0530 CLOUDSTACK-614: ListTemplates API is not returning "Enable SSH Key" attribute for any given template. Update the TemplateResponse by adding 'sshkeyenabled' attribute to it. This attribute is set to the value that the user passes as input for parameter 'sshkeyenabled' while registering the template. Signed-off-by: Min Chen <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/9924b648 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/9924b648 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/9924b648 Branch: refs/heads/master Commit: 9924b64830a406d08f53c22f7934fa31fb99de9d Parents: 7c5c3c5 Author: Min Chen <[email protected]> Authored: Wed Jan 9 10:42:44 2013 -0800 Committer: Min Chen <[email protected]> Committed: Wed Jan 9 10:42:44 2013 -0800 ---------------------------------------------------------------------- .../cloudstack/api/response/TemplateResponse.java | 9 +++++++-- server/src/com/cloud/api/ApiResponseHelper.java | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9924b648/api/src/org/apache/cloudstack/api/response/TemplateResponse.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/response/TemplateResponse.java b/api/src/org/apache/cloudstack/api/response/TemplateResponse.java index f6f74da..033c2e2 100644 --- a/api/src/org/apache/cloudstack/api/response/TemplateResponse.java +++ b/api/src/org/apache/cloudstack/api/response/TemplateResponse.java @@ -135,8 +135,8 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe @SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with tempate", responseObject = ResourceTagResponse.class) private List<ResourceTagResponse> tags; - - + @SerializedName(ApiConstants.SSHKEY_ENABLED) @Param(description="true if template is sshkey enabled, false otherwise") + private Boolean sshKeyEnabled; @Override public String getObjectId() { @@ -290,4 +290,9 @@ public class TemplateResponse extends BaseResponse implements ControlledEntityRe public void setTags(List<ResourceTagResponse> tags) { this.tags = tags; } + + public void setSshKeyEnabled(boolean sshKeyEnabled) { + this.sshKeyEnabled = sshKeyEnabled; + } + } http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9924b648/server/src/com/cloud/api/ApiResponseHelper.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 37be83e..4775439 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1265,6 +1265,7 @@ public class ApiResponseHelper implements ResponseGenerator { templateResponse.setFeatured(template.isFeatured()); templateResponse.setExtractable(template.isExtractable() && !(template.getTemplateType() == TemplateType.SYSTEM)); templateResponse.setPasswordEnabled(template.getEnablePassword()); + templateResponse.setSshKeyEnabled(template.getEnableSshKey()); templateResponse.setCrossZones(template.isCrossZones()); templateResponse.setFormat(template.getFormat()); templateResponse.setDetails(template.getDetails()); @@ -1346,6 +1347,7 @@ public class ApiResponseHelper implements ResponseGenerator { templateResponse.setFeatured(template.isFeatured()); templateResponse.setExtractable(template.isExtractable() && !(template.getTemplateType() == TemplateType.SYSTEM)); templateResponse.setPasswordEnabled(template.getEnablePassword()); + templateResponse.setSshKeyEnabled(template.getEnableSshKey()); templateResponse.setCrossZones(template.isCrossZones()); templateResponse.setFormat(template.getFormat()); if (template.getTemplateType() != null) {
