Skip to content
Open
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 @@ -95,6 +95,12 @@ public class ListBackupsCmd extends BaseListProjectAndAccountResourcesCmd {
description = "list backups by status")
private String backupStatus;

@Parameter(name = ApiConstants.TYPE,
type = CommandType.STRING,
since = "4.24.0",
description = "list backups by type")
private String backupType;
Comment thread
GeanJair marked this conversation as resolved.

@Parameter(name = ApiConstants.LIST_VM_DETAILS,
type = CommandType.BOOLEAN,
since = "4.21.0",
Expand Down Expand Up @@ -129,6 +135,10 @@ public String getBackupStatus() {
return backupStatus;
}

public String getBackupType() {
return backupType;
}

public Boolean getListVmDetails() {
return listVmDetails;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ public Pair<List<Backup>, Integer> listBackups(final ListBackupsCmd cmd) {
final Long zoneId = cmd.getZoneId();
final Long backupOfferingId = cmd.getBackupOfferingId();
final Backup.Status backupStatus = validateBackupStatus(cmd.getBackupStatus());
final String backupType = cmd.getBackupType();
final Account caller = CallContext.current().getCallingAccount();
final String keyword = cmd.getKeyword();
List<Long> permittedAccounts = new ArrayList<Long>();
Expand Down Expand Up @@ -1264,6 +1265,7 @@ public Pair<List<Backup>, Integer> listBackups(final ListBackupsCmd cmd) {
// incremental chain GC can sweep them once their last descendant is deleted.
sb.and("statusNeq", sb.entity().getStatus(), SearchCriteria.Op.NEQ);
sb.and("backupStatus", sb.entity().getStatus(), SearchCriteria.Op.EQ);
sb.and("backupType", sb.entity().getType(), SearchCriteria.Op.EQ);

if (keyword != null) {
sb.and().op("keywordName", sb.entity().getName(), SearchCriteria.Op.LIKE);
Expand Down Expand Up @@ -1299,6 +1301,8 @@ public Pair<List<Backup>, Integer> listBackups(final ListBackupsCmd cmd) {

sc.setParametersIfNotNull("backupStatus", backupStatus);

sc.setParametersIfNotNull("backupType", backupType);

if (keyword != null) {
String keywordMatch = "%" + keyword + "%";
sc.setParameters("keywordName", keywordMatch);
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/view/SearchView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export default {
}
if (['zoneid', 'domainid', 'imagestoreid', 'storageid', 'state', 'account', 'hypervisor', 'level',
'clusterid', 'podid', 'groupid', 'entitytype', 'accounttype', 'systemvmtype', 'scope', 'provider',
'type', 'scope', 'managementserverid', 'serviceofferingid',
'scope', 'managementserverid', 'serviceofferingid',
'diskofferingid', 'networkid', 'usagetype', 'restartrequired', 'gpuenabled',
'displaynetwork', 'guestiptype', 'usersource', 'arch', 'oscategoryid', 'templatetype', 'gpucardid', 'vgpuprofileid',
'extensionid', 'backupoffering', 'volumeid', 'virtualmachineid', 'hsmprofileid', 'kmskeyid', 'status'].includes(item)
Expand Down
6 changes: 2 additions & 4 deletions ui/src/config/section/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,8 @@ export default {
params: { listvmdetails: 'true' },
columns: ['name', 'status', 'compressionstatus', 'validationstatus', 'size', 'virtualsize', 'virtualmachinename', 'backupofferingname', 'intervaltype', 'type', 'created', 'account', 'domain', 'zone'],
details: ['name', 'description', 'virtualmachinename', 'id', 'intervaltype', 'type', 'externalid', 'size', 'virtualsize', 'volumes', 'backupofferingname', 'zone', 'account', 'domain', 'created'],
searchFilters: () => {
var filters = ['name', 'zoneid', 'domainid', 'account', 'backupofferingid', 'status']
return filters
},
searchFilters: ['name', 'zoneid', 'domainid', 'account', 'backupofferingid', 'status', 'type', 'virtualmachineid'],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: extra trailing blank line left after this array, before tabs:.


tabs: [
{
name: 'details',
Expand Down
Loading