Skip to content

Commit 5aec439

Browse files
authored
api: Remove psudo jobs from listAsyncJobs API (#6564)
Removes psudo job results from the response of the listAsyncJobs API
1 parent 441edf3 commit 5aec439

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateState;
124124
import org.apache.cloudstack.framework.config.ConfigKey;
125125
import org.apache.cloudstack.framework.config.Configurable;
126+
import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
126127
import org.apache.cloudstack.query.QueryService;
127128
import org.apache.cloudstack.resourcedetail.dao.DiskOfferingDetailsDao;
128129
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@@ -2483,6 +2484,7 @@ private Pair<List<AsyncJobJoinVO>, Integer> searchForAsyncJobsInternal(ListAsync
24832484

24842485
Filter searchFilter = new Filter(AsyncJobJoinVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal());
24852486
SearchBuilder<AsyncJobJoinVO> sb = _jobJoinDao.createSearchBuilder();
2487+
sb.and("instanceTypeNEQ", sb.entity().getInstanceType(), SearchCriteria.Op.NEQ);
24862488
sb.and("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN);
24872489
boolean accountJoinIsDone = false;
24882490
if (permittedAccounts.isEmpty() && domainId != null) {
@@ -2509,6 +2511,7 @@ private Pair<List<AsyncJobJoinVO>, Integer> searchForAsyncJobsInternal(ListAsync
25092511
Object startDate = cmd.getStartDate();
25102512

25112513
SearchCriteria<AsyncJobJoinVO> sc = sb.create();
2514+
sc.setParameters("instanceTypeNEQ", AsyncJobVO.PSEUDO_JOB_INSTANCE_TYPE);
25122515
if (listProjectResourcesCriteria != null) {
25132516
sc.setParameters("type", Account.Type.PROJECT);
25142517
}

0 commit comments

Comments
 (0)