mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
reslove conflicts api/src/com/cloud/api/ApiConstants.java
This commit is contained in:
commit
5645137f9c
@ -220,4 +220,5 @@ public class ApiConstants {
|
||||
public static final String TFTP_DIR = "tftpdir";
|
||||
public static final String PING_CIFS_USERNAME = "pingcifsusername";
|
||||
public static final String PING_CIFS_PASSWORD = "pingcifspassword";
|
||||
public static final String CHECKSUM="checksum";
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ import com.cloud.api.BaseCmd;
|
||||
import com.cloud.api.Implementation;
|
||||
import com.cloud.api.Parameter;
|
||||
import com.cloud.api.ServerApiException;
|
||||
import com.cloud.api.BaseCmd.CommandType;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
@ -88,6 +89,9 @@ public class RegisterTemplateCmd extends BaseCmd {
|
||||
|
||||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional accountName. Must be used with domainId.")
|
||||
private String accountName;
|
||||
|
||||
@Parameter(name=ApiConstants.CHECKSUM, type=CommandType.STRING, description="the MD5 checksum value of this template")
|
||||
private String checksum;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
@ -153,6 +157,10 @@ public class RegisterTemplateCmd extends BaseCmd {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
public String getChecksum() {
|
||||
return checksum;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@ -1562,7 +1562,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
templateResponse.setZoneId(zone.getId());
|
||||
templateResponse.setZoneName(zone.getName());
|
||||
templateResponse.setHypervisor(template.getHypervisorType().toString());
|
||||
templateResponse.setObjectName("template");
|
||||
templateResponse.setObjectName("template");
|
||||
templateResponse.setChecksum(template.getChecksum());
|
||||
|
||||
responses.add(templateResponse);
|
||||
}
|
||||
|
||||
@ -285,6 +285,7 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
|
||||
Long domainId = cmd.getDomainId();
|
||||
Account resourceAccount = null;
|
||||
Long accountId = null;
|
||||
String chksum = cmd.getChecksum();
|
||||
|
||||
//parameters verification
|
||||
if (bits == null) {
|
||||
@ -372,7 +373,7 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
|
||||
userId = Long.valueOf(1);
|
||||
}
|
||||
|
||||
return createTemplateOrIso(userId, accountId, zoneId, name, displayText, isPublic, featured, isExtractable, format, TemplateType.USER, url, null, requiresHVM, bits, passwordEnabled, guestOSId, true, hypervisorType);
|
||||
return createTemplateOrIso(userId, accountId, zoneId, name, displayText, isPublic, featured, isExtractable, format, TemplateType.USER, url, chksum, requiresHVM, bits, passwordEnabled, guestOSId, true, hypervisorType);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user