mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
conflict
This commit is contained in:
parent
1d752b1508
commit
2f70032972
39
server/src/com/cloud/api/commands/DeployVMCmd.java
Executable file → Normal file
39
server/src/com/cloud/api/commands/DeployVMCmd.java
Executable file → Normal file
@ -16,8 +16,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.cloud.api.commands;
|
package com.cloud.api.commands;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
@ -25,6 +25,7 @@ import org.apache.log4j.Logger;
|
|||||||
import com.cloud.api.ApiDBUtils;
|
import com.cloud.api.ApiDBUtils;
|
||||||
import com.cloud.api.BaseAsyncCmd;
|
import com.cloud.api.BaseAsyncCmd;
|
||||||
import com.cloud.api.BaseCmd;
|
import com.cloud.api.BaseCmd;
|
||||||
|
import com.cloud.api.BaseCmd.Manager;
|
||||||
import com.cloud.api.Implementation;
|
import com.cloud.api.Implementation;
|
||||||
import com.cloud.api.Parameter;
|
import com.cloud.api.Parameter;
|
||||||
import com.cloud.api.response.UserVmResponse;
|
import com.cloud.api.response.UserVmResponse;
|
||||||
@ -37,12 +38,12 @@ import com.cloud.user.UserContext;
|
|||||||
import com.cloud.uservm.UserVm;
|
import com.cloud.uservm.UserVm;
|
||||||
import com.cloud.vm.InstanceGroupVO;
|
import com.cloud.vm.InstanceGroupVO;
|
||||||
|
|
||||||
@Implementation(method="deployVirtualMachine", description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.")
|
@Implementation(createMethod="createVirtualMachine", method="startVirtualMachine", manager=Manager.UserVmManager, description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.")
|
||||||
public class DeployVMCmd extends BaseAsyncCmd {
|
public class DeployVmCmd extends BaseAsyncCmd {
|
||||||
public static final Logger s_logger = Logger.getLogger(DeployVMCmd.class.getName());
|
public static final Logger s_logger = Logger.getLogger(DeployVMCmd.class.getName());
|
||||||
|
|
||||||
private static final String s_name = "deployvirtualmachineresponse";
|
private static final String s_name = "deployvirtualmachineresponse";
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
//////////////// API parameters /////////////////////
|
//////////////// API parameters /////////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -153,17 +154,17 @@ public class DeployVMCmd extends BaseAsyncCmd {
|
|||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return s_name;
|
return s_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getResultObjectName() {
|
public static String getResultObjectName() {
|
||||||
return "virtualmachine";
|
return "virtualmachine";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getAccountId() {
|
public long getAccountId() {
|
||||||
Account account = (Account)UserContext.current().getAccount();
|
Account account = UserContext.current().getAccount();
|
||||||
if ((account == null) || isAdmin(account.getType())) {
|
if ((account == null) || isAdmin(account.getType())) {
|
||||||
if ((domainId != null) && (accountName != null)) {
|
if ((domainId != null) && (accountName != null)) {
|
||||||
Account userAccount = ApiDBUtils.findAccountByNameDomain(accountName, domainId);
|
Account userAccount = ApiDBUtils.findAccountByNameDomain(accountName, domainId);
|
||||||
@ -195,7 +196,6 @@ public class DeployVMCmd extends BaseAsyncCmd {
|
|||||||
UserVm userVm = (UserVm)getResponseObject();
|
UserVm userVm = (UserVm)getResponseObject();
|
||||||
|
|
||||||
UserVmResponse response = new UserVmResponse();
|
UserVmResponse response = new UserVmResponse();
|
||||||
response.setResponseName(getResultObjectName());
|
|
||||||
response.setId(userVm.getId());
|
response.setId(userVm.getId());
|
||||||
response.setName(userVm.getName());
|
response.setName(userVm.getName());
|
||||||
response.setCreated(userVm.getCreated());
|
response.setCreated(userVm.getCreated());
|
||||||
@ -293,6 +293,7 @@ public class DeployVMCmd extends BaseAsyncCmd {
|
|||||||
|
|
||||||
response.setNetworkGroupList(ApiDBUtils.getNetworkGroupsNamesForVm(userVm.getId()));
|
response.setNetworkGroupList(ApiDBUtils.getNetworkGroupsNamesForVm(userVm.getId()));
|
||||||
|
|
||||||
|
response.setResponseName(getName());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user