commit 3a3cb60e85c0254ebceff55d0b210ca1ff5386a6

Author: Likitha Shetty <likitha.shetty@citrix.com>
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 <min.chen@citrix.com>
This commit is contained in:
Min Chen 2013-01-09 10:42:44 -08:00
parent 7c5c3c5dfc
commit 9924b64830
2 changed files with 9 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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) {