Skip to content

Commit 704d7a9

Browse files
committed
Merge branch '4.19' of https://github.com/apache/cloudstack into 4.20
2 parents e091aad + 02d0dca commit 704d7a9

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.apache.cloudstack.api.response.SecurityGroupResponse;
4242
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
4343
import org.apache.cloudstack.api.response.TemplateResponse;
44+
import org.apache.cloudstack.api.response.UserDataResponse;
4445
import org.apache.cloudstack.api.response.UserResponse;
4546
import org.apache.cloudstack.api.response.UserVmResponse;
4647
import org.apache.cloudstack.api.response.VpcResponse;
@@ -149,6 +150,9 @@ public class ListVMsCmd extends BaseListRetrieveOnlyResourceCountCmd implements
149150
@Parameter(name = ApiConstants.USER_DATA, type = CommandType.BOOLEAN, description = "Whether to return the VMs' user data or not. By default, user data will not be returned.", since = "4.18.0.0")
150151
private Boolean showUserData;
151152

153+
@Parameter(name = ApiConstants.USER_DATA_ID, type = CommandType.UUID, entityType = UserDataResponse.class, required = false, description = "the instances by userdata", since = "4.20.1")
154+
private Long userdataId;
155+
152156
/////////////////////////////////////////////////////
153157
/////////////////// Accessors ///////////////////////
154158
/////////////////////////////////////////////////////
@@ -243,6 +247,10 @@ protected boolean isViewDetailsEmpty() {
243247
return CollectionUtils.isEmpty(viewDetails);
244248
}
245249

250+
public Long getUserdataId() {
251+
return userdataId;
252+
}
253+
246254
public EnumSet<VMDetails> getDetails() throws InvalidParameterValueException {
247255
if (isViewDetailsEmpty()) {
248256
if (_queryService.ReturnVmStatsOnVmList.value()) {

server/src/main/java/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ private Pair<List<Long>, Integer> searchForUserVMIdsAndCount(ListVMsCmd cmd) {
12961296
Long storageId = null;
12971297
StoragePoolVO pool = null;
12981298
Long userId = cmd.getUserId();
1299+
Long userdataId = cmd.getUserdataId();
12991300
Map<String, String> tags = cmd.getTags();
13001301

13011302
boolean isAdmin = false;
@@ -1368,6 +1369,10 @@ private Pair<List<Long>, Integer> searchForUserVMIdsAndCount(ListVMsCmd cmd) {
13681369
userVmSearchBuilder.and("templateId", userVmSearchBuilder.entity().getTemplateId(), Op.EQ);
13691370
}
13701371

1372+
if (userdataId != null) {
1373+
userVmSearchBuilder.and("userdataId", userVmSearchBuilder.entity().getUserDataId(), Op.EQ);
1374+
}
1375+
13711376
if (hypervisor != null) {
13721377
userVmSearchBuilder.and("hypervisorType", userVmSearchBuilder.entity().getHypervisorType(), Op.EQ);
13731378
}
@@ -1560,6 +1565,10 @@ private Pair<List<Long>, Integer> searchForUserVMIdsAndCount(ListVMsCmd cmd) {
15601565
userVmSearchCriteria.setParameters("templateId", templateId);
15611566
}
15621567

1568+
if (userdataId != null) {
1569+
userVmSearchCriteria.setParameters("userdataId", userdataId);
1570+
}
1571+
15631572
if (display != null) {
15641573
userVmSearchCriteria.setParameters("display", display);
15651574
}

ui/src/config/section/compute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ export default {
925925
related: [{
926926
name: 'vm',
927927
title: 'label.instances',
928-
param: 'userdata'
928+
param: 'userdataid'
929929
}],
930930
tabs: [
931931
{

0 commit comments

Comments
 (0)