shwstppr commented on code in PR #9925:
URL: https://github.com/apache/cloudstack/pull/9925#discussion_r1899488874
##########
plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcVmsCmd.java:
##########
@@ -82,6 +90,14 @@ public String getPassword() {
return password;
}
+ public Integer getBatchSize() {
Review Comment:
This is not used
##########
plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcVmsCmd.java:
##########
@@ -70,6 +70,14 @@ public class ListVmwareDcVmsCmd extends BaseListCmd {
@Parameter(name = ApiConstants.PASSWORD, type = CommandType.STRING,
description = "The password for specified username.")
private String password;
+ @Parameter(name = ApiConstants.BATCH_SIZE, type = CommandType.INTEGER,
description = "The maximum number of results to return.")
+ private Integer batchSize;
+
+ @Parameter(name = ApiConstants.TOKEN, type = CommandType.STRING,
+ description = "For listVmwareDcVms, if the maximum number of
results (the `pagesize`) is exceeded, " +
+ " a token is returned. This token can be used in
subsequent calls to retrieve more results")
Review Comment:
If possible, please rephrase. Not clear to me. As far as I understand, this
is a string returned by API when the actual count is more than the pagesize (by
request)?
##########
ui/src/views/tools/SelectVmwareVcenter.vue:
##########
@@ -217,6 +217,7 @@ export default {
} else {
params.existingvcenterid = this.selectedExistingVcenterId
}
+ params.batchsize = 2
Review Comment:
why 2?
##########
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java:
##########
@@ -1106,6 +1107,7 @@ public class ApiConstants {
public static final String PARAMETER_DESCRIPTION_IS_TAG_A_RULE = "Whether
the informed tag is a JS interpretable rule or not.";
public static final String NFS_MOUNT_OPTIONS = "nfsmountopts";
+ public static final String MAX_NUMBER = "maxnumber";
Review Comment:
Not used
##########
ui/src/views/tools/ManageInstances.vue:
##########
@@ -1408,11 +1408,31 @@ export default {
})
}
},
+ async fetchMoreVms (obj) {
+ var params = obj.params
+ params.token = obj.response.token
+ api('listVmwareDcVms', params).then(json => {
+ const obj = {
+ params: params,
+ response: json.listvmwaredcvmsresponse
+ }
+ this.unmanagedInstances.append(obj.response.unmanagedinstance)
+ this.checkForMoreVms(obj)
Review Comment:
If we only need existing params and token, why not just set params.token
here and pass params
##########
ui/src/views/tools/ManageInstances.vue:
##########
@@ -1408,11 +1408,31 @@ export default {
})
}
},
+ async fetchMoreVms (obj) {
+ var params = obj.params
+ params.token = obj.response.token
+ api('listVmwareDcVms', params).then(json => {
+ const obj = {
+ params: params,
+ response: json.listvmwaredcvmsresponse
+ }
+ this.unmanagedInstances.append(obj.response.unmanagedinstance)
+ this.checkForMoreVms(obj)
+ })
+ },
onListUnmanagedInstancesFromVmware (obj) {
this.selectedVmwareVcenter = obj.params
this.unmanagedInstances = obj.response.unmanagedinstance
this.itemCount.unmanaged = obj.response.count
- this.unmanagedInstancesLoading = false
+ this.checkForMoreVms(obj)
+ },
+ checkForMoreVms (obj) {
Review Comment:
Is it better to let user control loading more objects or not? Currently, if
there are 1000 VMware VMs and user opens this view, user's intended VM is
returned in the first request itself, will it continue calling API for more
results?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]