@@ -2309,6 +2309,7 @@ public Pair<List<Long>, Integer> searchForServerIdsAndCount(ListHostsCmd cmd) {
23092309 Long pageSize = cmd .getPageSizeVal ();
23102310 Hypervisor .HypervisorType hypervisorType = cmd .getHypervisor ();
23112311 final CPU .CPUArch arch = cmd .getArch ();
2312+ String version = cmd .getVersion ();
23122313
23132314 Filter searchFilter = new Filter (HostVO .class , "id" , Boolean .TRUE , startIndex , pageSize );
23142315
@@ -2325,6 +2326,7 @@ public Pair<List<Long>, Integer> searchForServerIdsAndCount(ListHostsCmd cmd) {
23252326 hostSearchBuilder .and ("resourceState" , hostSearchBuilder .entity ().getResourceState (), SearchCriteria .Op .EQ );
23262327 hostSearchBuilder .and ("hypervisor_type" , hostSearchBuilder .entity ().getHypervisorType (), SearchCriteria .Op .EQ );
23272328 hostSearchBuilder .and ("arch" , hostSearchBuilder .entity ().getArch (), SearchCriteria .Op .EQ );
2329+ hostSearchBuilder .and ("version" , hostSearchBuilder .entity ().getVersion (), SearchCriteria .Op .EQ );
23282330
23292331 if (keyword != null ) {
23302332 hostSearchBuilder .and ().op ("keywordName" , hostSearchBuilder .entity ().getName (), SearchCriteria .Op .LIKE );
@@ -2409,6 +2411,10 @@ public Pair<List<Long>, Integer> searchForServerIdsAndCount(ListHostsCmd cmd) {
24092411 sc .setParameters ("arch" , arch );
24102412 }
24112413
2414+ if (version != null ) {
2415+ sc .setParameters ("version" , version );
2416+ }
2417+
24122418 Pair <List <HostVO >, Integer > uniqueHostPair = hostDao .searchAndCount (sc , searchFilter );
24132419 Integer count = uniqueHostPair .second ();
24142420 List <Long > hostIds = uniqueHostPair .first ().stream ().map (HostVO ::getId ).collect (Collectors .toList ());
@@ -5397,6 +5403,7 @@ public ListResponse<ManagementServerResponse> listManagementServers(ListMgmtsCmd
53975403 protected Pair <List <ManagementServerJoinVO >, Integer > listManagementServersInternal (ListMgmtsCmd cmd ) {
53985404 Long id = cmd .getId ();
53995405 String name = cmd .getHostName ();
5406+ String version = cmd .getVersion ();
54005407
54015408 SearchBuilder <ManagementServerJoinVO > sb = managementServerJoinDao .createSearchBuilder ();
54025409 SearchCriteria <ManagementServerJoinVO > sc = sb .create ();
@@ -5406,6 +5413,9 @@ protected Pair<List<ManagementServerJoinVO>, Integer> listManagementServersInter
54065413 if (name != null ) {
54075414 sc .addAnd ("name" , SearchCriteria .Op .EQ , name );
54085415 }
5416+ if (version != null ) {
5417+ sc .addAnd ("version" , SearchCriteria .Op .EQ , version );
5418+ }
54095419 return managementServerJoinDao .searchAndCount (sc , null );
54105420 }
54115421
0 commit comments