Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.cloudstack.backup.Backup;
import org.apache.cloudstack.backup.BackupManager;
import org.apache.cloudstack.context.CallContext;
import org.apache.log4j.Logger;

import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
Expand All @@ -49,6 +50,7 @@
responseObject = BackupResponse.class, since = "4.14.0",
authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
public class ListBackupsCmd extends BaseListProjectAndAccountResourcesCmd {
private static final Logger s_logger = Logger.getLogger(ListBackupsCmd.class);

@Inject
private BackupManager backupManager;
Expand Down Expand Up @@ -116,6 +118,7 @@ public void execute() throws ResourceUnavailableException, InsufficientCapacityE
Pair<List<Backup>, Integer> result = backupManager.listBackups(this);
setupResponseBackupList(result.first(), result.second());
} catch (Exception e) {
s_logger.debug("Exception while listing backups", e);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
}
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/org/apache/cloudstack/backup/Backup.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public String toString() {
}

long getVmId();
long getBackupOfferingId();
String getExternalId();
String getType();
String getDate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public void setStatus(Status status) {
this.status = status;
}

@Override
public long getBackupOfferingId() {
return backupOfferingId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ public BackupResponse newBackupResponse(Backup backup) {
AccountVO account = accountDao.findByIdIncludingRemoved(vm.getAccountId());
DomainVO domain = domainDao.findByIdIncludingRemoved(vm.getDomainId());
DataCenterVO zone = dataCenterDao.findByIdIncludingRemoved(vm.getDataCenterId());
BackupOffering offering = backupOfferingDao.findByIdIncludingRemoved(vm.getBackupOfferingId());
Long offeringId = vm.getBackupOfferingId();
if (offeringId == null) {
offeringId = backup.getBackupOfferingId();
}
BackupOffering offering = backupOfferingDao.findByIdIncludingRemoved(offeringId);

BackupResponse response = new BackupResponse();
response.setId(backup.getUuid());
Expand Down