|
28 | 28 | import org.apache.cloudstack.api.APICommand; |
29 | 29 | import org.apache.cloudstack.api.ApiConstants; |
30 | 30 | import org.apache.cloudstack.api.ApiErrorCode; |
31 | | -import org.apache.cloudstack.api.BaseListCmd; |
| 31 | +import org.apache.cloudstack.api.BaseCmd; |
32 | 32 | import org.apache.cloudstack.api.BaseResponse; |
33 | 33 | import org.apache.cloudstack.api.Parameter; |
34 | 34 | import org.apache.cloudstack.api.ServerApiException; |
|
45 | 45 | @APICommand(name = "listVmwareDcVms", responseObject = UnmanagedInstanceResponse.class, |
46 | 46 | description = "Lists the VMs in a VMware Datacenter", |
47 | 47 | requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) |
48 | | -public class ListVmwareDcVmsCmd extends BaseListCmd { |
| 48 | +public class ListVmwareDcVmsCmd extends BaseCmd { |
49 | 49 |
|
50 | 50 | @Inject |
51 | 51 | public VmwareDatacenterService _vmwareDatacenterService; |
@@ -74,8 +74,9 @@ public class ListVmwareDcVmsCmd extends BaseListCmd { |
74 | 74 | private Integer batchSize; |
75 | 75 |
|
76 | 76 | @Parameter(name = ApiConstants.TOKEN, type = CommandType.STRING, |
77 | | - description = "For listVmwareDcVms, if the maximum number of results (the `pagesize`) is exceeded, " + |
78 | | - " a token is returned. This token can be used in subsequent calls to retrieve more results") |
| 77 | + description = "For listVmwareDcVms, if the maximum number of results (the `batchsize`) is exceeded, " + |
| 78 | + " a token is returned. This token can be used in subsequent calls to retrieve more results." + |
| 79 | + " As long as a token is returned, more results can be retrieved.") |
79 | 80 | private String token; |
80 | 81 |
|
81 | 82 | public String getVcenter() { |
@@ -119,12 +120,8 @@ public void execute() throws ResourceUnavailableException, InsufficientCapacityE |
119 | 120 | baseResponseList.add(resp); |
120 | 121 | } |
121 | 122 | } |
122 | | - List<BaseResponse> pagingList = com.cloud.utils.StringUtils.applyPagination(baseResponseList, this.getStartIndex(), this.getPageSizeVal()); |
123 | | - if (CollectionUtils.isEmpty(pagingList)) { |
124 | | - pagingList = baseResponseList; |
125 | | - } |
126 | 123 | VmwareRequestReponse<BaseResponse> response = new VmwareRequestReponse<>(); |
127 | | - response.setResponses(pagingList, baseResponseList.size()); |
| 124 | + response.setResponses(baseResponseList, baseResponseList.size()); |
128 | 125 | response.setResponseName(getCommandName()); |
129 | 126 | response.setToken(results.first()); |
130 | 127 | setResponseObject(response); |
|
0 commit comments