Skip to content

Commit 6f2d2d4

Browse files
committed
Merge remote-tracking branch 'apache/4.20' into add-boot-options-importvm
2 parents d6f63ab + 82396b6 commit 6f2d2d4

File tree

127 files changed

+2156
-1679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2156
-1679
lines changed

.github/workflows/ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
npm run test:unit
5757
5858
- uses: codecov/codecov-action@v4
59+
if: github.repository == 'apache/cloudstack'
5960
with:
6061
working-directory: ui
6162
files: ./coverage/lcov.info

agent/src/main/java/com/cloud/agent/properties/AgentProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ public static class Property <T>{
823823
private T defaultValue;
824824
private Class<T> typeClass;
825825

826-
Property(String name, T value) {
826+
public Property(String name, T value) {
827827
init(name, value);
828828
}
829829

api/src/main/java/com/cloud/user/AccountService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ User createUser(String userName, String password, String firstName, String lastN
8787

8888
boolean isDomainAdmin(Long accountId);
8989

90+
boolean isResourceDomainAdmin(Long accountId);
91+
9092
boolean isNormalUser(long accountId);
9193

9294
User getActiveUserByRegistrationToken(String registrationToken);

api/src/main/java/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,19 @@ public CPU.CPUArch getArch() {
128128

129129
protected Pair<List<ClusterResponse>, Integer> getClusterResponses() {
130130
Pair<List<? extends Cluster>, Integer> result = _mgr.searchForClusters(this);
131-
List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
131+
List<ClusterResponse> clusterResponses = new ArrayList<>();
132132
for (Cluster cluster : result.first()) {
133133
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, showCapacities);
134134
clusterResponse.setObjectName("cluster");
135135
clusterResponses.add(clusterResponse);
136136
}
137-
return new Pair<List<ClusterResponse>, Integer>(clusterResponses, result.second());
137+
return new Pair<>(clusterResponses, result.second());
138138
}
139139

140140
@Override
141141
public void execute() {
142142
Pair<List<ClusterResponse>, Integer> clusterResponses = getClusterResponses();
143-
ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
143+
ListResponse<ClusterResponse> response = new ListResponse<>();
144144
response.setResponses(clusterResponses.first(), clusterResponses.second());
145145
response.setResponseName(getCommandName());
146146
this.setResponseObject(response);

api/src/main/java/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public Boolean getShowCapacities() {
8686
@Override
8787
public void execute() {
8888
Pair<List<? extends Pod>, Integer> result = _mgr.searchForPods(this);
89-
ListResponse<PodResponse> response = new ListResponse<PodResponse>();
90-
List<PodResponse> podResponses = new ArrayList<PodResponse>();
89+
ListResponse<PodResponse> response = new ListResponse<>();
90+
List<PodResponse> podResponses = new ArrayList<>();
9191
for (Pod pod : result.first()) {
9292
PodResponse podResponse = _responseGenerator.createPodResponse(pod, showCapacities);
9393
podResponse.setObjectName("pod");

api/src/main/java/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public void execute() {
7272
response.setInstancesDisksStatsRetentionTime((Integer) capabilities.get(ApiConstants.INSTANCES_DISKS_STATS_RETENTION_TIME));
7373
response.setSharedFsVmMinCpuCount((Integer)capabilities.get(ApiConstants.SHAREDFSVM_MIN_CPU_COUNT));
7474
response.setSharedFsVmMinRamSize((Integer)capabilities.get(ApiConstants.SHAREDFSVM_MIN_RAM_SIZE));
75+
response.setDynamicScalingEnabled((Boolean) capabilities.get(ApiConstants.DYNAMIC_SCALING_ENABLED));
7576
response.setObjectName("capability");
7677
response.setResponseName(getCommandName());
7778
this.setResponseObject(response);

api/src/main/java/org/apache/cloudstack/api/command/user/userdata/RegisterUserDataCmd.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import com.cloud.user.UserData;
4444

4545
@APICommand(name = "registerUserData",
46-
description = "Register a new userdata.",
46+
description = "Register a new User Data.",
4747
since = "4.18",
4848
responseObject = SuccessResponse.class,
4949
requestHasSensitiveInfo = false,
@@ -56,33 +56,33 @@ public class RegisterUserDataCmd extends BaseCmd {
5656
//////////////// API parameters /////////////////////
5757
/////////////////////////////////////////////////////
5858

59-
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "Name of the userdata")
59+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "Name of the User Data")
6060
private String name;
6161

6262
//Owner information
63-
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an optional account for the userdata. Must be used with domainId.")
63+
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "an optional account for the User Data. Must be used with domainId.")
6464
private String accountName;
6565

6666
@Parameter(name = ApiConstants.DOMAIN_ID,
6767
type = CommandType.UUID,
6868
entityType = DomainResponse.class,
69-
description = "an optional domainId for the userdata. If the account parameter is used, domainId must also be used.")
69+
description = "an optional domainId for the User Data. If the account parameter is used, domainId must also be used.")
7070
private Long domainId;
7171

72-
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the userdata")
72+
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the User Data")
7373
private Long projectId;
7474

7575
@Parameter(name = ApiConstants.USER_DATA,
7676
type = CommandType.STRING,
7777
required = true,
78-
description = "Base64 encoded userdata content. " +
78+
description = "Base64 encoded User Data content. " +
7979
"Using HTTP GET (via querystring), you can send up to 4KB of data after base64 encoding. " +
80-
"Using HTTP POST (via POST body), you can send up to 1MB of data after base64 encoding. " +
81-
"You also need to change vm.userdata.max.length value",
80+
"Using HTTP POST (via POST body), you can send up to 32KB of data after base64 encoding, " +
81+
"which can be increased upto 1MB using the vm.userdata.max.length setting",
8282
length = 1048576)
8383
private String userData;
8484

85-
@Parameter(name = ApiConstants.PARAMS, type = CommandType.STRING, description = "comma separated list of variables declared in userdata content")
85+
@Parameter(name = ApiConstants.PARAMS, type = CommandType.STRING, description = "comma separated list of variables declared in the User Data content")
8686
private String params;
8787

8888

api/src/main/java/org/apache/cloudstack/api/command/user/zone/ListZonesCmd.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
3535
public class ListZonesCmd extends BaseListCmd implements UserCmd {
3636

37-
private static final String s_name = "listzonesresponse";
38-
3937
/////////////////////////////////////////////////////
4038
//////////////// API parameters /////////////////////
4139
/////////////////////////////////////////////////////
@@ -113,11 +111,6 @@ public Boolean getShowIcon () {
113111
/////////////// API Implementation///////////////////
114112
/////////////////////////////////////////////////////
115113

116-
@Override
117-
public String getCommandName() {
118-
return s_name;
119-
}
120-
121114
@Override
122115
public void execute() {
123116
ListResponse<ZoneResponse> response = _queryService.listDataCenters(this);

api/src/main/java/org/apache/cloudstack/api/response/CapabilitiesResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ public class CapabilitiesResponse extends BaseResponse {
136136
@Param(description = "the min Ram size for the service offering used by the shared filesystem instance", since = "4.20.0")
137137
private Integer sharedFsVmMinRamSize;
138138

139+
@SerializedName(ApiConstants.DYNAMIC_SCALING_ENABLED)
140+
@Param(description = "true if dynamically scaling for instances is enabled", since = "4.21.0")
141+
private Boolean dynamicScalingEnabled;
142+
139143
public void setSecurityGroupsEnabled(boolean securityGroupsEnabled) {
140144
this.securityGroupsEnabled = securityGroupsEnabled;
141145
}
@@ -247,4 +251,8 @@ public void setSharedFsVmMinCpuCount(Integer sharedFsVmMinCpuCount) {
247251
public void setSharedFsVmMinRamSize(Integer sharedFsVmMinRamSize) {
248252
this.sharedFsVmMinRamSize = sharedFsVmMinRamSize;
249253
}
254+
255+
public void setDynamicScalingEnabled(Boolean dynamicScalingEnabled) {
256+
this.dynamicScalingEnabled = dynamicScalingEnabled;
257+
}
250258
}

api/src/main/java/org/apache/cloudstack/api/response/UserDataResponse.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,41 @@
2727
public class UserDataResponse extends BaseResponseWithAnnotations implements ControlledEntityResponse {
2828

2929
@SerializedName(ApiConstants.ID)
30-
@Param(description = "ID of the ssh keypair")
30+
@Param(description = "ID of the User Data")
3131
private String id;
3232

3333
@SerializedName(ApiConstants.NAME)
34-
@Param(description = "Name of the userdata")
34+
@Param(description = "Name of the User Data")
3535
private String name;
3636

37-
@SerializedName(ApiConstants.ACCOUNT_ID) @Param(description="the owner id of the userdata")
37+
@SerializedName(ApiConstants.ACCOUNT_ID) @Param(description="the owner id of the User Data")
3838
private String accountId;
3939

40-
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the owner of the userdata")
40+
@SerializedName(ApiConstants.ACCOUNT) @Param(description="the owner of the User Data")
4141
private String accountName;
4242

4343
@SerializedName(ApiConstants.PROJECT_ID)
44-
@Param(description = "the project id of the userdata", since = "4.19.1")
44+
@Param(description = "the project id of the User Data", since = "4.19.1")
4545
private String projectId;
4646

4747
@SerializedName(ApiConstants.PROJECT)
48-
@Param(description = "the project name of the userdata", since = "4.19.1")
48+
@Param(description = "the project name of the User Data", since = "4.19.1")
4949
private String projectName;
5050

51-
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the userdata owner")
51+
@SerializedName(ApiConstants.DOMAIN_ID) @Param(description="the domain id of the User Data owner")
5252
private String domainId;
5353

54-
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the userdata owner")
54+
@SerializedName(ApiConstants.DOMAIN) @Param(description="the domain name of the User Data owner")
5555
private String domain;
5656

5757
@SerializedName(ApiConstants.DOMAIN_PATH)
58-
@Param(description = "path of the domain to which the userdata owner belongs", since = "4.19.2.0")
58+
@Param(description = "path of the domain to which the User Data owner belongs", since = "4.19.2.0")
5959
private String domainPath;
6060

61-
@SerializedName(ApiConstants.USER_DATA) @Param(description="base64 encoded userdata content")
61+
@SerializedName(ApiConstants.USER_DATA) @Param(description="base64 encoded User Data content")
6262
private String userData;
6363

64-
@SerializedName(ApiConstants.PARAMS) @Param(description="list of parameters which contains the list of keys or string parameters that are needed to be passed for any variables declared in userdata")
64+
@SerializedName(ApiConstants.PARAMS) @Param(description="list of parameters which contains the list of keys or string parameters that are needed to be passed for any variables declared in the User Data")
6565
private String params;
6666

6767
public UserDataResponse() {

0 commit comments

Comments
 (0)