mirror of https://github.com/apache/cloudstack.git
bug 8578: make listRouters API take in id parameter.
This commit is contained in:
parent
de4b79bd6d
commit
c475aacc08
|
|
@ -27,6 +27,7 @@ import com.cloud.api.ApiConstants;
|
|||
import com.cloud.api.BaseListCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.DomainRouterResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
|
|
@ -51,6 +52,9 @@ public class ListRoutersCmd extends BaseListCmd {
|
|||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID of the router")
|
||||
private Long hostId;
|
||||
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the disk volume")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the router")
|
||||
private String routerName;
|
||||
|
||||
|
|
@ -82,6 +86,10 @@ public class ListRoutersCmd extends BaseListCmd {
|
|||
return hostId;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getRouterName() {
|
||||
return routerName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2138,6 +2138,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
|
||||
Filter searchFilter = new Filter(DomainRouterVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal());
|
||||
|
||||
Object id = cmd.getId();
|
||||
Object name = cmd.getRouterName();
|
||||
Object state = cmd.getState();
|
||||
Object zone = cmd.getZoneId();
|
||||
|
|
@ -2148,6 +2149,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
|
||||
SearchBuilder<DomainRouterVO> sb = _routerDao.createSearchBuilder();
|
||||
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("accountId", sb.entity().getAccountId(), SearchCriteria.Op.IN);
|
||||
sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
|
||||
sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ);
|
||||
|
|
@ -2185,6 +2187,10 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
if (name != null) {
|
||||
sc.setParameters("name", "%" + name + "%");
|
||||
}
|
||||
|
||||
if(id != null) {
|
||||
sc.setParameters("id", id);
|
||||
}
|
||||
|
||||
if (accountId != null) {
|
||||
sc.setParameters("accountId", accountId);
|
||||
|
|
|
|||
|
|
@ -92,9 +92,7 @@ function routerJsonToDetailsTab() {
|
|||
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
||||
$thisTab.find("#tab_container").hide();
|
||||
$thisTab.find("#tab_spinning_wheel").show();
|
||||
|
||||
//uncomment the following section when Bug 8578("listRouters API doesnt' take in id parameter correctly") is fixed.
|
||||
/*
|
||||
|
||||
$.ajax({
|
||||
data: createURL("command=listRouters&id="+jsonObj.id),
|
||||
dataType: "json",
|
||||
|
|
@ -107,8 +105,7 @@ function routerJsonToDetailsTab() {
|
|||
}
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
||||
setVmStateInRightPanel(fromdb(jsonObj.state), $thisTab.find("#state"));
|
||||
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
||||
|
|
|
|||
Loading…
Reference in New Issue