This is an automated email from the ASF dual-hosted git repository.

sureshanaparti pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.22 by this push:
     new 38abe2df0bb Allow list async jobs by resource type alone (#13011)
38abe2df0bb is described below

commit 38abe2df0bb9bb876e0fb40f1e2bcae3aea45ba0
Author: Suresh Kumar Anaparti <[email protected]>
AuthorDate: Tue Apr 14 15:20:13 2026 +0530

    Allow list async jobs by resource type alone (#13011)
---
 server/src/main/java/com/cloud/api/query/QueryManagerImpl.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java 
b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
index 6214a8f2743..1eb66af396b 100644
--- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
@@ -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);

Reply via email to