Allow list async jobs by resource type alone (#13011)

This commit is contained in:
Suresh Kumar Anaparti 2026-04-14 15:20:13 +05:30 committed by GitHub
parent feb6076930
commit 38abe2df0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 5 deletions

View File

@ -3197,13 +3197,11 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
sc.addAnd("instanceType", SearchCriteria.Op.EQ, resourceType.toString());
final String resourceId = getResourceUuid(cmd.getResourceId());
if (resourceId == null) {
throw new InvalidParameterValueException("Invalid resource id for the resource type " + resourceType);
if (resourceId != null) {
sc.addAnd("instanceUuid", SearchCriteria.Op.EQ, resourceId);
}
sc.addAnd("instanceUuid", SearchCriteria.Op.EQ, resourceId);
} else if (cmd.getResourceId() != null) {
throw new InvalidParameterValueException("Resource type must be specified for the resource id");
throw new InvalidParameterValueException(String.format("%s parameter must be used with %s parameter", ApiConstants.RESOURCE_ID, ApiConstants.RESOURCE_TYPE));
}
return _jobJoinDao.searchAndCount(sc, searchFilter);