CLOUDSTACK-3016: remove zonetype parameter from listHosts API.

This commit is contained in:
Jessica Wang 2013-06-14 16:14:21 -07:00
parent 4b2eb18cfc
commit cb37d4cb63
2 changed files with 3 additions and 15 deletions

View File

@ -74,9 +74,6 @@ public class ListHostsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
description="the Zone ID for the host")
private Long zoneId;
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
private String zoneType;
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
required=false, description="lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM")
@ -126,10 +123,6 @@ public class ListHostsCmd extends BaseListCmd {
public Long getZoneId() {
return zoneId;
}
public String getZoneType() {
return zoneType;
}
public Long getVirtualMachineId() {
return virtualMachineId;

View File

@ -1422,8 +1422,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
public Pair<List<HostJoinVO>, Integer> searchForServersInternal(ListHostsCmd cmd) {
Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(), cmd.getZoneId());
String zoneType = cmd.getZoneType();
Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(UserContext.current().getCaller(), cmd.getZoneId());
Object name = cmd.getHostName();
Object type = cmd.getType();
Object state = cmd.getState();
@ -1444,8 +1443,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
sb.and("type", sb.entity().getType(), SearchCriteria.Op.LIKE);
sb.and("status", sb.entity().getStatus(), SearchCriteria.Op.EQ);
sb.and("dataCenterId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
sb.and("dataCenterType", sb.entity().getZoneType(), SearchCriteria.Op.EQ);
sb.and("dataCenterId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
sb.and("podId", sb.entity().getPodId(), SearchCriteria.Op.EQ);
sb.and("clusterId", sb.entity().getClusterId(), SearchCriteria.Op.EQ);
sb.and("resourceState", sb.entity().getResourceState(), SearchCriteria.Op.EQ);
@ -1489,10 +1487,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
}
if (zoneId != null) {
sc.setParameters("dataCenterId", zoneId);
}
if (zoneType != null) {
sc.setParameters("dataCenterType", zoneType);
}
}
if (pod != null) {
sc.setParameters("podId", pod);
}