mirror of https://github.com/apache/cloudstack.git
Allow list async jobs by resource type alone (#13011)
This commit is contained in:
parent
feb6076930
commit
38abe2df0b
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue