mirror of https://github.com/apache/cloudstack.git
api: Refactoring, add the parameter annotation for user VM.
- Fix some errors in the previous deployVMCmd. modified: api/src/org/apache/cloudstack/api/user/vm/command/DeployVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/DestroyVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/GetVMPasswordCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/ListVMsCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/RebootVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/ResetVMPasswordCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/RestoreVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/StartVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/StopVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/UpdateVMCmd.java modified: api/src/org/apache/cloudstack/api/user/vm/command/UpgradeVMCmd.java Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
parent
af28c06998
commit
ad50d226cd
|
|
@ -34,7 +34,17 @@ import org.apache.cloudstack.api.IdentityMapper;
|
|||
import org.apache.cloudstack.api.Implementation;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
|
||||
import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.api.response.DomainResponse;
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.api.response.NetworkResponse;
|
||||
import com.cloud.api.response.ProjectAccountResponse;
|
||||
import com.cloud.api.response.SecurityGroupResponse;
|
||||
import com.cloud.api.response.ServiceOfferingResponse;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.DataCenter.NetworkType;
|
||||
|
|
@ -67,18 +77,18 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine")
|
||||
//@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="availability zone for the virtual machine", entityType=ZoneResponse.class)
|
||||
private Long zoneId;
|
||||
|
||||
@ACL
|
||||
@IdentityMapper(entityTableName="disk_offering")
|
||||
@Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine", resourceType=ServiceOffering.class)
|
||||
//@IdentityMapper(entityTableName="disk_offering")
|
||||
@Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the ID of the service offering for the virtual machine", resourceType=ServiceOffering.class, entityType=ServiceOfferingResponse.class)
|
||||
private Long serviceOfferingId;
|
||||
|
||||
@ACL
|
||||
@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine",resourceType=VirtualMachineTemplate.class)
|
||||
//@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, required=true, description="the ID of the template for the virtual machine", entityType=TemplateResponse.class)
|
||||
private Long templateId;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="host name for the virtual machine")
|
||||
|
|
@ -91,20 +101,20 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the virtual machine. Must be used with domainId.")
|
||||
private String accountName;
|
||||
|
||||
@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.", entityType=Domain.class)
|
||||
//@IdentityMapper(entityTableName="domain")
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.", entityType=DomainResponse.class)
|
||||
private Long domainId;
|
||||
|
||||
//Network information
|
||||
@ACL
|
||||
@IdentityMapper(entityTableName="networks")
|
||||
@Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter", resourceType=Network.class)
|
||||
//@IdentityMapper(entityTableName="networks")
|
||||
@Parameter(name=ApiConstants.NETWORK_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter", entityType=NetworkResponse.class)
|
||||
private List<Long> networkIds;
|
||||
|
||||
//DataDisk information
|
||||
@ACL
|
||||
@IdentityMapper(entityTableName="disk_offering")
|
||||
@Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.", resourceType=DiskOffering.class)
|
||||
//@IdentityMapper(entityTableName="disk_offering")
|
||||
@Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.", entityType=DiskOfferingResponse.class)
|
||||
private Long diskOfferingId;
|
||||
|
||||
@Parameter(name=ApiConstants.SIZE, type=CommandType.LONG, description="the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId")
|
||||
|
|
@ -123,13 +133,13 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
private String sshKeyPairName;
|
||||
|
||||
|
||||
@IdentityMapper(entityTableName="host")
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only")
|
||||
//@IdentityMapper(entityTableName="host")
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", entityType=HostResponse.class)
|
||||
private Long hostId;
|
||||
|
||||
@ACL
|
||||
@IdentityMapper(entityTableName="security_group")
|
||||
@Parameter(name=ApiConstants.SECURITY_GROUP_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter", resourceType=SecurityGroup.class)
|
||||
//@IdentityMapper(entityTableName="security_group")
|
||||
@Parameter(name=ApiConstants.SECURITY_GROUP_IDS, type=CommandType.LIST, collectionType=CommandType.LONG, description="comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter", resourceType=SecurityGroup.class, entityType=SecurityGroupResponse.class)
|
||||
private List<Long> securityGroupIdList;
|
||||
|
||||
@ACL
|
||||
|
|
@ -146,8 +156,8 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
|
|||
@Parameter(name=ApiConstants.KEYBOARD, type=CommandType.STRING, description="an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us")
|
||||
private String keyboard;
|
||||
|
||||
@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Deploy vm for the project")
|
||||
//@IdentityMapper(entityTableName="projects")
|
||||
@Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="Deploy vm for the project", entityType=ProjectAccountResponse.class)
|
||||
private Long projectId;
|
||||
|
||||
@Parameter(name=ApiConstants.START_VM, type=CommandType.BOOLEAN, description="true if network offering supports specifying ip ranges; defaulted to true if not specified")
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public class DestroyVMCmd extends BaseAsyncCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
|
||||
//@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.apache.cloudstack.api.IdentityMapper;
|
|||
import org.apache.cloudstack.api.Implementation;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import com.cloud.api.response.GetVMPasswordResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.uservm.UserVm;
|
||||
|
||||
|
|
@ -39,8 +40,8 @@ public class GetVMPasswordCmd extends BaseCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
|
||||
//@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,18 @@ import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
|
|||
import org.apache.cloudstack.api.IdentityMapper;
|
||||
import org.apache.cloudstack.api.Implementation;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.api.response.InstanceGroupResponse;
|
||||
import com.cloud.api.response.IsoVmResponse;
|
||||
import com.cloud.api.response.ListResponse;
|
||||
import com.cloud.api.response.NetworkResponse;
|
||||
import com.cloud.api.response.PodResponse;
|
||||
import com.cloud.api.response.StoragePoolResponse;
|
||||
import com.cloud.api.response.TemplateResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.api.response.VpcResponse;
|
||||
import com.cloud.api.response.ZoneResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.utils.Pair;
|
||||
|
|
@ -46,60 +56,60 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
|
|||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="instance_group")
|
||||
@Parameter(name=ApiConstants.GROUP_ID, type=CommandType.LONG, description="the group ID")
|
||||
//@IdentityMapper(entityTableName="instance_group")
|
||||
@Parameter(name=ApiConstants.GROUP_ID, type=CommandType.LONG, description="the group ID", entityType=InstanceGroupResponse.class)
|
||||
private Long groupId;
|
||||
|
||||
@IdentityMapper(entityTableName="host")
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID")
|
||||
//@IdentityMapper(entityTableName="host")
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="the host ID", entityType=HostResponse.class)
|
||||
private Long hostId;
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the virtual machine")
|
||||
//@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="name of the virtual machine")
|
||||
private String instanceName;
|
||||
|
||||
@IdentityMapper(entityTableName="host_pod_ref")
|
||||
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the pod ID")
|
||||
//@IdentityMapper(entityTableName="host_pod_ref")
|
||||
@Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the pod ID", entityType=PodResponse.class)
|
||||
private Long podId;
|
||||
|
||||
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="state of the virtual machine")
|
||||
private String state;
|
||||
|
||||
@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the availability zone ID")
|
||||
//@IdentityMapper(entityTableName="data_center")
|
||||
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the availability zone ID", entityType=ZoneResponse.class)
|
||||
private Long zoneId;
|
||||
|
||||
@Parameter(name=ApiConstants.FOR_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="list by network type; true if need to list vms using Virtual Network, false otherwise")
|
||||
private Boolean forVirtualNetwork;
|
||||
|
||||
@IdentityMapper(entityTableName="networks")
|
||||
@Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="list by network id")
|
||||
//@IdentityMapper(entityTableName="networks")
|
||||
@Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, description="list by network id", entityType=NetworkResponse.class)
|
||||
private Long networkId;
|
||||
|
||||
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the target hypervisor for the template")
|
||||
private String hypervisor;
|
||||
|
||||
@IdentityMapper(entityTableName="storage_pool")
|
||||
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to")
|
||||
//@IdentityMapper(entityTableName="storage_pool")
|
||||
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.LONG, description="the storage ID where vm's volumes belong to", entityType=StoragePoolResponse.class)
|
||||
private Long storageId;
|
||||
|
||||
@Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of host details requested, " +
|
||||
"value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]. If no parameter is passed in, the details will be defaulted to all" )
|
||||
private List<String> viewDetails;
|
||||
|
||||
@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="list vms by template")
|
||||
//@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.TEMPLATE_ID, type=CommandType.LONG, description="list vms by template", entityType=TemplateResponse.class)
|
||||
private Long templateId;
|
||||
|
||||
@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso")
|
||||
//@IdentityMapper(entityTableName="vm_template")
|
||||
@Parameter(name=ApiConstants.ISO_ID, type=CommandType.LONG, description="list vms by iso", entityType=IsoVmResponse.class)
|
||||
private Long isoId;
|
||||
|
||||
@IdentityMapper(entityTableName="vpc")
|
||||
@Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="list vms by vpc")
|
||||
//@IdentityMapper(entityTableName="vpc")
|
||||
@Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="list vms by vpc", entityType=VpcResponse.class)
|
||||
private Long vpcId;
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class RebootVMCmd extends BaseAsyncCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class ResetVMPasswordCmd extends BaseAsyncCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
// unexposed parameter needed for serializing/deserializing the command
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class RestoreVMCmd extends BaseAsyncCmd {
|
|||
private static final String s_name = "restorevmresponse";
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="Virtual Machine ID")
|
||||
@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="Virtual Machine ID", entityType=UserVmResponse.class)
|
||||
private Long vmId;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ import org.apache.cloudstack.api.IdentityMapper;
|
|||
import org.apache.cloudstack.api.Implementation;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
|
||||
import com.cloud.api.response.HostResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.async.AsyncJob;
|
||||
import com.cloud.event.EventTypes;
|
||||
|
|
@ -50,11 +52,11 @@ public class StartVMCmd extends BaseAsyncCmd {
|
|||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "vm_instance")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName="host")
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", since="3.0.1")
|
||||
@Parameter(name=ApiConstants.HOST_ID, type=CommandType.LONG, description="destination Host ID to deploy the VM to - parameter available for root admin only", entityType=HostResponse.class, since="3.0.1")
|
||||
private Long hostId;
|
||||
|
||||
// ///////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class StopVMCmd extends BaseAsyncCmd {
|
|||
// ///////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName = "vm_instance")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine")
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, required = false, description = "Force stop the VM " +
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import org.apache.cloudstack.api.IdentityMapper;
|
|||
import org.apache.cloudstack.api.Implementation;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
|
||||
import com.cloud.api.response.GuestOSResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
|
|
@ -53,11 +55,11 @@ public class UpdateVMCmd extends BaseCmd{
|
|||
private Boolean haEnable;
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName="guest_os")
|
||||
@Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents this VM.")
|
||||
@Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents this VM.", entityType=GuestOSResponse.class)
|
||||
private Long osTypeId;
|
||||
|
||||
@Parameter(name=ApiConstants.USER_DATA, type=CommandType.STRING, description="an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Currently only HTTP GET is supported. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding.", length=2048)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ import org.apache.cloudstack.api.IdentityMapper;
|
|||
import org.apache.cloudstack.api.Implementation;
|
||||
import org.apache.cloudstack.api.Parameter;
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
|
||||
import com.cloud.api.response.DiskOfferingResponse;
|
||||
import com.cloud.api.response.UserVmResponse;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
|
|
@ -43,11 +45,11 @@ public class UpgradeVMCmd extends BaseCmd {
|
|||
/////////////////////////////////////////////////////
|
||||
|
||||
@IdentityMapper(entityTableName="vm_instance")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
|
||||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine", entityType=UserVmResponse.class)
|
||||
private Long id;
|
||||
|
||||
@IdentityMapper(entityTableName="disk_offering")
|
||||
@Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine")
|
||||
@Parameter(name=ApiConstants.SERVICE_OFFERING_ID, type=CommandType.LONG, required=true, description="the service offering ID to apply to the virtual machine", entityType=DiskOfferingResponse.class)
|
||||
private Long serviceOfferingId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue