Skip to content

Commit e2d3773

Browse files
author
Daan Hoogland
committed
Merge release branch 4.22 to main
* 4.22: Update templateConfig.sh to not break with directorys with space on t… (#10898) Fix VM and volume metrics listing regressions (#12284) packaging: use latest cmk release link directly (#11429) api:rename RegisterCmd.java => RegisterUserKeyCmd.java (#12259) Prioritize copying templates from other secondary storages instead of downloading them (#10363) Show time correctly in the backup schedule UI (#12012) kvm: use preallocation option for fat disk resize (#11986) Python exception processing static routes fixed (#11967) KVM memballooning requires free page reporting and autodeflate (#11932) api: create/register/upload template with empty template tag (#12234)
2 parents eb93f01 + cee330e commit e2d3773

File tree

37 files changed

+934
-254
lines changed

37 files changed

+934
-254
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
2626
import org.apache.cloudstack.api.command.admin.account.CreateAccountCmd;
2727
import org.apache.cloudstack.api.command.admin.user.GetUserKeysCmd;
28-
import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
28+
import org.apache.cloudstack.api.command.admin.user.RegisterUserKeyCmd;
2929
import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
3030

3131
import com.cloud.dc.DataCenter;
@@ -95,7 +95,7 @@ User createUser(String userName, String password, String firstName, String lastN
9595

9696
void markUserRegistered(long userId);
9797

98-
public String[] createApiKeyAndSecretKey(RegisterCmd cmd);
98+
public String[] createApiKeyAndSecretKey(RegisterUserKeyCmd cmd);
9999

100100
public String[] createApiKeyAndSecretKey(final long userId);
101101

api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
import org.apache.cloudstack.api.ApiConstants;
2727
import org.apache.cloudstack.api.BaseCmd;
2828
import org.apache.cloudstack.api.Parameter;
29-
import org.apache.cloudstack.api.response.RegisterResponse;
29+
import org.apache.cloudstack.api.response.RegisterUserKeyResponse;
3030
import org.apache.cloudstack.api.response.UserResponse;
3131

3232
import java.util.Map;
3333

3434
@APICommand(name = "getUserKeys",
3535
description = "This command allows the user to query the seceret and API keys for the account",
36-
responseObject = RegisterResponse.class,
36+
responseObject = RegisterUserKeyResponse.class,
3737
requestHasSensitiveInfo = false,
3838
responseHasSensitiveInfo = true,
3939
authorized = {RoleType.User, RoleType.Admin, RoleType.DomainAdmin, RoleType.ResourceAdmin},
@@ -57,7 +57,7 @@ public Long getID(){
5757
public void execute(){
5858
Pair<Boolean, Map<String, String>> keys = _accountService.getKeys(this);
5959

60-
RegisterResponse response = new RegisterResponse();
60+
RegisterUserKeyResponse response = new RegisterUserKeyResponse();
6161
if(keys != null){
6262
response.setApiKeyAccess(keys.first());
6363
response.setApiKey(keys.second().get("apikey"));

api/src/main/java/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java renamed to api/src/main/java/org/apache/cloudstack/api/command/admin/user/RegisterUserKeyCmd.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
import org.apache.cloudstack.api.ApiConstants;
2323
import org.apache.cloudstack.api.BaseCmd;
2424
import org.apache.cloudstack.api.Parameter;
25-
import org.apache.cloudstack.api.response.RegisterResponse;
25+
import org.apache.cloudstack.api.response.RegisterUserKeyResponse;
2626
import org.apache.cloudstack.api.response.UserResponse;
2727

2828
import com.cloud.user.Account;
2929
import com.cloud.user.User;
3030

3131
@APICommand(name = "registerUserKeys",
32-
responseObject = RegisterResponse.class,
32+
responseObject = RegisterUserKeyResponse.class,
3333
description = "This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user",
3434
requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
35-
public class RegisterCmd extends BaseCmd {
35+
public class RegisterUserKeyCmd extends BaseCmd {
3636

3737

3838
/////////////////////////////////////////////////////
@@ -81,7 +81,7 @@ public ApiCommandResourceType getApiResourceType() {
8181
@Override
8282
public void execute() {
8383
String[] keys = _accountService.createApiKeyAndSecretKey(this);
84-
RegisterResponse response = new RegisterResponse();
84+
RegisterUserKeyResponse response = new RegisterUserKeyResponse();
8585
if (keys != null) {
8686
response.setApiKey(keys[0]);
8787
response.setSecretKey(keys[1]);

api/src/main/java/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public String getUrl() {
211211
}
212212

213213
public String getTemplateTag() {
214-
return templateTag;
214+
return StringUtils.isBlank(templateTag) ? null : templateTag;
215215
}
216216

217217
public Map getDetails() {

api/src/main/java/org/apache/cloudstack/api/command/user/template/GetUploadParamsForTemplateCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public Boolean isSshKeyEnabled() {
170170
}
171171

172172
public String getTemplateTag() {
173-
return templateTag;
173+
return StringUtils.isBlank(templateTag) ? null : templateTag;
174174
}
175175

176176
public boolean isDeployAsIs() {

api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public String getChecksum() {
279279
}
280280

281281
public String getTemplateTag() {
282-
return templateTag;
282+
return StringUtils.isBlank(templateTag) ? null : templateTag;
283283
}
284284

285285
public Map getDetails() {

api/src/main/java/org/apache/cloudstack/api/response/RegisterResponse.java renamed to api/src/main/java/org/apache/cloudstack/api/response/RegisterUserKeyResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import com.cloud.serializer.Param;
2525

26-
public class RegisterResponse extends BaseResponse {
26+
public class RegisterUserKeyResponse extends BaseResponse {
2727
@SerializedName(ApiConstants.API_KEY)
2828
@Param(description = "the api key of the registered user", isSensitive = true)
2929
private String apiKey;

debian/rules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ VERSION := $(shell grep '<version>' pom.xml | head -2 | tail -1 | cut -d'>' -f2
44
PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1)
55
SYSCONFDIR = "/etc"
66
DESTDIR = "debian/tmp"
7-
CMK_REL := $(shell wget -O - "https://api.github.com/repos/apache/cloudstack-cloudmonkey/releases" 2>/dev/null | jq -r '.[0].tag_name')
87

98
%:
109
dh $@ --with systemd
@@ -90,7 +89,7 @@ override_dh_auto_install:
9089
rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/sha512sum.txt
9190

9291
# Bundle cmk in cloudstack-management
93-
wget https://github.com/apache/cloudstack-cloudmonkey/releases/download/$(CMK_REL)/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk
92+
wget https://github.com/apache/cloudstack-cloudmonkey/releases/latest/download/cmk.linux.x86-64 -O $(DESTDIR)/usr/bin/cmk
9493
chmod +x $(DESTDIR)/usr/bin/cmk
9594

9695
# nast hack for a couple of configuration files

engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/StorageOrchestrationService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@
1818
package org.apache.cloudstack.engine.orchestration.service;
1919

2020
import java.util.List;
21+
import java.util.concurrent.Future;
2122

2223
import org.apache.cloudstack.api.response.MigrationResponse;
24+
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
25+
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
26+
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateService.TemplateApiResult;
2327
import org.apache.cloudstack.storage.ImageStoreService.MigrationPolicy;
2428

2529
public interface StorageOrchestrationService {
2630
MigrationResponse migrateData(Long srcDataStoreId, List<Long> destDatastores, MigrationPolicy migrationPolicy);
2731

2832
MigrationResponse migrateResources(Long srcImgStoreId, Long destImgStoreId, List<Long> templateIdList, List<Long> snapshotIdList);
33+
34+
Future<TemplateApiResult> orchestrateTemplateCopyToImageStore(TemplateInfo source, DataStore destStore);
2935
}

engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/TemplateService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,6 @@ public TemplateInfo getTemplate() {
7878
AsyncCallFuture<TemplateApiResult> createDatadiskTemplateAsync(TemplateInfo parentTemplate, TemplateInfo dataDiskTemplate, String path, String diskId, long fileSize, boolean bootable);
7979

8080
List<DatadiskTO> getTemplateDatadisksOnImageStore(TemplateInfo templateInfo, String configurationId);
81+
82+
AsyncCallFuture<TemplateApiResult> copyTemplateToImageStore(DataObject source, DataStore destStore);
8183
}

0 commit comments

Comments
 (0)