This is an automated email from the ASF dual-hosted git repository.
weizhouapache pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 5e5ae0c51cd Fix type parameter in listBackupServiceJobs API (#13940)
5e5ae0c51cd is described below
commit 5e5ae0c51cd01387ae50e74f430c14b241edf636
Author: João Jandre <[email protected]>
AuthorDate: Sat Aug 22 05:45:36 2026 -0300
Fix type parameter in listBackupServiceJobs API (#13940)
---
.../cloudstack/backup/dao/InternalBackupServiceJobDao.java | 2 +-
.../cloudstack/backup/dao/InternalBackupServiceJobDaoImpl.java | 4 ++--
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java | 9 ++++-----
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git
a/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDao.java
b/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDao.java
index c80734b9cb3..01a23206aca 100644
---
a/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDao.java
+++
b/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDao.java
@@ -32,7 +32,7 @@ public interface InternalBackupServiceJobDao extends
GenericDao<InternalBackupSe
List<InternalBackupServiceJobVO>
listExecutingJobsByHostsAndStartTimeBeforeAndTypeIn(Object[] hostIds, Date
date, InternalBackupServiceJobType... jobTypes);
- Pair<List<InternalBackupServiceJobVO>, Integer>
searchAndCountForListApi(Long id, Long backupId, Long hostId, Long zoneId,
InternalBackupServiceJobType type, boolean executing,
+ Pair<List<InternalBackupServiceJobVO>, Integer>
searchAndCountForListApi(Long id, Long backupId, Long hostId, Long zoneId,
String type, boolean executing,
boolean scheduled, Long startIndex, Long pageSize);
void update(InternalBackupServiceJobVO job);
diff --git
a/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDaoImpl.java
b/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDaoImpl.java
index 32e81261838..d724539dcf3 100644
---
a/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDaoImpl.java
+++
b/engine/schema/src/main/java/org/apache/cloudstack/backup/dao/InternalBackupServiceJobDaoImpl.java
@@ -98,7 +98,7 @@ public class InternalBackupServiceJobDaoImpl extends
GenericDaoBase<InternalBack
}
@Override
- public Pair<List<InternalBackupServiceJobVO>, Integer>
searchAndCountForListApi(Long id, Long backupId, Long hostId, Long zoneId,
InternalBackupServiceJobType type, boolean executing,
+ public Pair<List<InternalBackupServiceJobVO>, Integer>
searchAndCountForListApi(Long id, Long backupId, Long hostId, Long zoneId,
String type, boolean executing,
boolean scheduled, Long startIndex, Long pageSize) {
SearchBuilder<InternalBackupServiceJobVO> sb = createSearchBuilder();
@@ -122,7 +122,7 @@ public class InternalBackupServiceJobDaoImpl extends
GenericDaoBase<InternalBack
sc.setParametersIfNotNull(HOST_ID, hostId);
sc.setParametersIfNotNull(ZONE_ID, zoneId);
if (type != null) {
- sc.setParameters(TYPE, type);
+ sc.setParameters(TYPE, InternalBackupServiceJobType.valueOf(type));
}
Filter filter = new Filter(InternalBackupServiceJobVO.class,
"created", false, startIndex, pageSize);
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 dda52fc41a1..d700fba5a78 100644
--- a/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
@@ -158,7 +158,6 @@ import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.api.response.VirtualMachineResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.cloudstack.backup.InternalBackupServiceJobType;
import org.apache.cloudstack.backup.InternalBackupServiceJobVO;
import org.apache.cloudstack.backup.BackupOfferingVO;
import org.apache.cloudstack.backup.BackupVO;
@@ -6436,7 +6435,7 @@ public class QueryManagerImpl extends
MutualExclusiveIdsManagerBase implements Q
public ListResponse<BackupServiceJobResponse>
listBackupServiceJobs(ListBackupServiceJobsCmd cmd) {
ListResponse<BackupServiceJobResponse> responses = new
ListResponse<>();
Pair<List<InternalBackupServiceJobVO>, Integer> result =
listBackupServiceJobsInternal(cmd);
- List<BackupServiceJobResponse> compressionJobResponses = new
ArrayList<>();
+ List<BackupServiceJobResponse> backupServiceJobResponses = new
ArrayList<>();
for (InternalBackupServiceJobVO jobVO : result.first()) {
BackupVO backup =
backupDao.findByIdIncludingRemoved(jobVO.getBackupId());
@@ -6448,16 +6447,16 @@ public class QueryManagerImpl extends
MutualExclusiveIdsManagerBase implements Q
if (jobVO.getHostId() != null) {
response.setHostId(hostDao.findByIdIncludingRemoved(jobVO.getHostId()).getUuid());
}
- compressionJobResponses.add(response);
+ backupServiceJobResponses.add(response);
}
- responses.setResponses(compressionJobResponses, result.second());
+ responses.setResponses(backupServiceJobResponses, result.second());
return responses;
}
private Pair<List<InternalBackupServiceJobVO>, Integer>
listBackupServiceJobsInternal(ListBackupServiceJobsCmd cmd) {
return
internalBackupServiceJobDao.searchAndCountForListApi(cmd.getId(),
cmd.getBackupId(), cmd.getHostId(), cmd.getZoneId(),
- InternalBackupServiceJobType.valueOf(cmd.getType()),
cmd.getExecuting(), cmd.getScheduled(), cmd.getStartIndex(),
cmd.getPageSizeVal());
+ cmd.getType(), cmd.getExecuting(), cmd.getScheduled(),
cmd.getStartIndex(), cmd.getPageSizeVal());
}
@Override