/* * Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.ec2.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.ImportInstanceRequestMarshaller; /** * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#importInstance(ImportInstanceRequest) ImportInstance operation}. *
* Creates an import instance task using metadata from the specified disk
* image. ImportInstance
only supports single-volume VMs. To
* import multi-volume VMs, use ImportImage. After importing the image,
* you then upload it using the ec2-import-volume
command in
* the EC2 command line tools. For more information, see
* Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2
* in the Amazon Elastic Compute Cloud User Guide .
*
* For information about the import manifest referenced by this API * action, see * VM Import Manifest * . *
* * @see com.amazonaws.services.ec2.AmazonEC2#importInstance(ImportInstanceRequest) */ public class ImportInstanceRequest extends AmazonWebServiceRequest implements Serializable, DryRunSupportedRequest
* Constraints:
* Allowed Values: Windows
*/
private String platform;
/**
* A description for the instance being imported.
*
* @return A description for the instance being imported.
*/
public String getDescription() {
return description;
}
/**
* A description for the instance being imported.
*
* @param description A description for the instance being imported.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* A description for the instance being imported.
*
* Returns a reference to this object so that method calls can be chained together. * * @param description A description for the instance being imported. * * @return A reference to this updated object so that method calls can be chained * together. */ public ImportInstanceRequest withDescription(String description) { this.description = description; return this; } /** * The launch specification. * * @return The launch specification. */ public ImportInstanceLaunchSpecification getLaunchSpecification() { return launchSpecification; } /** * The launch specification. * * @param launchSpecification The launch specification. */ public void setLaunchSpecification(ImportInstanceLaunchSpecification launchSpecification) { this.launchSpecification = launchSpecification; } /** * The launch specification. *
* Returns a reference to this object so that method calls can be chained together.
*
* @param launchSpecification The launch specification.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ImportInstanceRequest withLaunchSpecification(ImportInstanceLaunchSpecification launchSpecification) {
this.launchSpecification = launchSpecification;
return this;
}
/**
* The disk image.
*
* @return The disk image.
*/
public java.util.List
* Returns a reference to this object so that method calls can be chained together.
*
* @param diskImages The disk image.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ImportInstanceRequest withDiskImages(DiskImage... diskImages) {
if (getDiskImages() == null) setDiskImages(new java.util.ArrayList
* Returns a reference to this object so that method calls can be chained together.
*
* @param diskImages The disk image.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public ImportInstanceRequest withDiskImages(java.util.Collection
* Constraints:
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Constraints:
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Allowed Values: Windows
*
* @return The instance operating system.
*
* @see PlatformValues
*/
public String getPlatform() {
return platform;
}
/**
* The instance operating system.
*
* Allowed Values: Windows
*
* @param platform The instance operating system.
*
* @see PlatformValues
*/
public void setPlatform(String platform) {
this.platform = platform;
}
/**
* The instance operating system.
*
* Allowed Values: Windows
*
* @param platform The instance operating system.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see PlatformValues
*/
public ImportInstanceRequest withPlatform(String platform) {
this.platform = platform;
return this;
}
/**
* The instance operating system.
*
* Allowed Values: Windows
*
* @param platform The instance operating system.
*
* @see PlatformValues
*/
public void setPlatform(PlatformValues platform) {
this.platform = platform.toString();
}
/**
* The instance operating system.
*
* Allowed Values: Windows
*
* @param platform The instance operating system.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see PlatformValues
*/
public ImportInstanceRequest withPlatform(PlatformValues platform) {
this.platform = platform.toString();
return this;
}
/**
* This method is intended for internal use only.
* Returns the marshaled request configured with additional parameters to
* enable operation dry-run.
*/
@Override
public Request