mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Remove deployasis parameter from register template API
This commit is contained in:
parent
46d412d998
commit
08c0b07b59
@ -162,13 +162,6 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd {
|
|||||||
description = "true if template should bypass Secondary Storage and be downloaded to Primary Storage on deployment")
|
description = "true if template should bypass Secondary Storage and be downloaded to Primary Storage on deployment")
|
||||||
private Boolean directDownload;
|
private Boolean directDownload;
|
||||||
|
|
||||||
@Parameter(name= ApiConstants.DEPLOY_AS_IS,
|
|
||||||
type = CommandType.BOOLEAN,
|
|
||||||
description = "VMware only: true if template should not strip and define disks and networks but leave those to the template definition",
|
|
||||||
since = "4.15"
|
|
||||||
)
|
|
||||||
private Boolean deployAsIs;
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -282,7 +275,7 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isDeployAsIs() {
|
public Boolean isDeployAsIs() {
|
||||||
return deployAsIs == null ? false : deployAsIs;
|
return hypervisor != null && hypervisor.equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -347,9 +340,5 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd {
|
|||||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR,
|
throw new ServerApiException(ApiErrorCode.PARAM_ERROR,
|
||||||
"Parameter directdownload is only allowed for KVM templates");
|
"Parameter directdownload is only allowed for KVM templates");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDeployAsIs() && !getHypervisor().equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString())) {
|
|
||||||
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameter deployasis is only allowed for VMware templates");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -253,7 +253,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation<Templa
|
|||||||
}
|
}
|
||||||
|
|
||||||
templateResponse.setDirectDownload(template.isDirectDownload());
|
templateResponse.setDirectDownload(template.isDirectDownload());
|
||||||
templateResponse.setDeployAsIs(template.isDeployAsIs());
|
templateResponse.setDeployAsIs(template.getHypervisorType() == HypervisorType.VMware);
|
||||||
templateResponse.setRequiresHvm(template.isRequiresHvm());
|
templateResponse.setRequiresHvm(template.isRequiresHvm());
|
||||||
|
|
||||||
//set template children disks
|
//set template children disks
|
||||||
@ -277,7 +277,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation<Templa
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setDeployAsIsDetails(TemplateJoinVO template, TemplateResponse templateResponse) {
|
private void setDeployAsIsDetails(TemplateJoinVO template, TemplateResponse templateResponse) {
|
||||||
if (template.isDeployAsIs()) {
|
if (template.getHypervisorType() == HypervisorType.VMware) {
|
||||||
List<TemplateDeployAsIsDetailVO> deployAsIsDetails = templateDeployAsIsDetailsDao.listDetails(template.getId());
|
List<TemplateDeployAsIsDetailVO> deployAsIsDetails = templateDeployAsIsDetailsDao.listDetails(template.getId());
|
||||||
for (TemplateDeployAsIsDetailVO deployAsIsDetailVO : deployAsIsDetails) {
|
for (TemplateDeployAsIsDetailVO deployAsIsDetailVO : deployAsIsDetails) {
|
||||||
if (deployAsIsDetailVO.getName().startsWith(DeployAsIsConstants.HARDWARE_ITEM_PREFIX)) {
|
if (deployAsIsDetailVO.getName().startsWith(DeployAsIsConstants.HARDWARE_ITEM_PREFIX)) {
|
||||||
|
|||||||
@ -231,9 +231,6 @@ public class TemplateJoinVO extends BaseViewWithTagInformationVO implements Cont
|
|||||||
@Column(name = "direct_download")
|
@Column(name = "direct_download")
|
||||||
private boolean directDownload;
|
private boolean directDownload;
|
||||||
|
|
||||||
@Column(name = "deploy_as_is")
|
|
||||||
private boolean deployAsIs;
|
|
||||||
|
|
||||||
public TemplateJoinVO() {
|
public TemplateJoinVO() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,10 +490,6 @@ public class TemplateJoinVO extends BaseViewWithTagInformationVO implements Cont
|
|||||||
return directDownload;
|
return directDownload;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDeployAsIs() {
|
|
||||||
return deployAsIs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getParentTemplateId() {
|
public Object getParentTemplateId() {
|
||||||
return parentTemplateId;
|
return parentTemplateId;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user