mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
api,server: list autoscalevmgroups with keyword (#9046)
Fixes #9042 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
2d4d370be8
commit
57e67afdf0
@ -1174,6 +1174,7 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScaleManage
|
||||
Long profileId = cmd.getProfileId();
|
||||
Long zoneId = cmd.getZoneId();
|
||||
Boolean forDisplay = cmd.getDisplay();
|
||||
String keyword = cmd.getKeyword();
|
||||
|
||||
SearchWrapper<AutoScaleVmGroupVO> searchWrapper = new SearchWrapper<>(autoScaleVmGroupDao, AutoScaleVmGroupVO.class, cmd, cmd.getId());
|
||||
SearchBuilder<AutoScaleVmGroupVO> sb = searchWrapper.getSearchBuilder();
|
||||
@ -1184,6 +1185,7 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScaleManage
|
||||
sb.and("profileId", sb.entity().getProfileId(), SearchCriteria.Op.EQ);
|
||||
sb.and("zoneId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
|
||||
sb.and("display", sb.entity().isDisplay(), SearchCriteria.Op.EQ);
|
||||
sb.and("keyword", sb.entity().getName(), SearchCriteria.Op.LIKE);
|
||||
|
||||
if (policyId != null) {
|
||||
SearchBuilder<AutoScaleVmGroupPolicyMapVO> asVmGroupPolicySearch = autoScaleVmGroupPolicyMapDao.createSearchBuilder();
|
||||
@ -1213,6 +1215,9 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScaleManage
|
||||
if (forDisplay != null) {
|
||||
sc.setParameters("display", forDisplay);
|
||||
}
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
sc.setParameters("keyword", "%" + keyword + "%");
|
||||
}
|
||||
return searchWrapper.search();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user