Skip to content

Commit 753cafa

Browse files
committed
bug 9782: hardcoded default page size to be 500 for listConfigurations
status 9782: resolved fixed
1 parent a6fac0d commit 753cafa

1 file changed

Lines changed: 23 additions & 15 deletions

File tree

api/src/com/cloud/api/commands/ListCfgsByCmd.java

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,25 @@
3131
import com.cloud.api.response.ListResponse;
3232
import com.cloud.configuration.Configuration;
3333

34-
@Implementation(description="Lists all configurations.", responseObject=ConfigurationResponse.class)
34+
@Implementation(description = "Lists all configurations.", responseObject = ConfigurationResponse.class)
3535
public class ListCfgsByCmd extends BaseListCmd {
3636
public static final Logger s_logger = Logger.getLogger(ListCfgsByCmd.class.getName());
3737

3838
private static final String s_name = "listconfigurationsresponse";
3939

40-
/////////////////////////////////////////////////////
41-
//////////////// API parameters /////////////////////
42-
/////////////////////////////////////////////////////
40+
// ///////////////////////////////////////////////////
41+
// ////////////// API parameters /////////////////////
42+
// ///////////////////////////////////////////////////
4343

44-
@Parameter(name=ApiConstants.CATEGORY, type=CommandType.STRING, description="lists configurations by category")
44+
@Parameter(name = ApiConstants.CATEGORY, type = CommandType.STRING, description = "lists configurations by category")
4545
private String category;
4646

47-
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="lists configuration by name")
47+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "lists configuration by name")
4848
private String configName;
4949

50-
51-
/////////////////////////////////////////////////////
52-
/////////////////// Accessors ///////////////////////
53-
/////////////////////////////////////////////////////
50+
// ///////////////////////////////////////////////////
51+
// ///////////////// Accessors ///////////////////////
52+
// ///////////////////////////////////////////////////
5453

5554
public String getCategory() {
5655
return category;
@@ -60,18 +59,27 @@ public String getConfigName() {
6059
return configName;
6160
}
6261

62+
@Override
63+
public Long getPageSizeVal() {
64+
Long pageSizeVal = 500L;
65+
Integer pageSize = getPageSize();
66+
if (pageSize != null) {
67+
pageSizeVal = pageSize.longValue();
68+
}
69+
return pageSizeVal;
70+
}
6371

64-
/////////////////////////////////////////////////////
65-
/////////////// API Implementation///////////////////
66-
/////////////////////////////////////////////////////
72+
// ///////////////////////////////////////////////////
73+
// ///////////// API Implementation///////////////////
74+
// ///////////////////////////////////////////////////
6775

6876
@Override
6977
public String getCommandName() {
7078
return s_name;
7179
}
72-
80+
7381
@Override
74-
public void execute(){
82+
public void execute() {
7583
List<? extends Configuration> result = _mgr.searchForConfigurations(this);
7684
ListResponse<ConfigurationResponse> response = new ListResponse<ConfigurationResponse>();
7785
List<ConfigurationResponse> configResponses = new ArrayList<ConfigurationResponse>();

0 commit comments

Comments
 (0)