All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.ImportInstanceLaunchSpecification Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 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;

/**
 * 

* Describes the launch specification for VM import. *

*/ public class ImportInstanceLaunchSpecification implements Serializable, Cloneable { /** *

* The architecture of the instance. *

*/ private String architecture; /** *

* One or more security group names. *

*/ private com.amazonaws.internal.SdkInternalList groupNames; /** *

* One or more security group IDs. *

*/ private com.amazonaws.internal.SdkInternalList groupIds; /** *

* Reserved. *

*/ private String additionalInfo; /** *

* The user data to make available to the instance. If you are using an AWS * SDK or command line tool, Base64-encoding is performed for you, and you * can load the text from a file. Otherwise, you must provide Base64-encoded * text. *

*/ private UserData userData; /** *

* The instance type. For more information about the instance types that you * can import, see Before You Get Started in the Amazon Elastic Compute Cloud User * Guide. *

*/ private String instanceType; /** *

* The placement information for the instance. *

*/ private Placement placement; /** *

* Indicates whether monitoring is enabled. *

*/ private Boolean monitoring; /** *

* [EC2-VPC] The ID of the subnet in which to launch the instance. *

*/ private String subnetId; /** *

* Indicates whether an instance stops or terminates when you initiate * shutdown from the instance (using the operating system command for system * shutdown). *

*/ private String instanceInitiatedShutdownBehavior; /** *

* [EC2-VPC] An available IP address from the IP address range of the * subnet. *

*/ private String privateIpAddress; /** *

* The architecture of the instance. *

* * @param architecture * The architecture of the instance. * @see ArchitectureValues */ public void setArchitecture(String architecture) { this.architecture = architecture; } /** *

* The architecture of the instance. *

* * @return The architecture of the instance. * @see ArchitectureValues */ public String getArchitecture() { return this.architecture; } /** *

* The architecture of the instance. *

* * @param architecture * The architecture of the instance. * @return Returns a reference to this object so that method calls can be * chained together. * @see ArchitectureValues */ public ImportInstanceLaunchSpecification withArchitecture( String architecture) { setArchitecture(architecture); return this; } /** *

* The architecture of the instance. *

* * @param architecture * The architecture of the instance. * @see ArchitectureValues */ public void setArchitecture(ArchitectureValues architecture) { this.architecture = architecture.toString(); } /** *

* The architecture of the instance. *

* * @param architecture * The architecture of the instance. * @return Returns a reference to this object so that method calls can be * chained together. * @see ArchitectureValues */ public ImportInstanceLaunchSpecification withArchitecture( ArchitectureValues architecture) { setArchitecture(architecture); return this; } /** *

* One or more security group names. *

* * @return One or more security group names. */ public java.util.List getGroupNames() { if (groupNames == null) { groupNames = new com.amazonaws.internal.SdkInternalList(); } return groupNames; } /** *

* One or more security group names. *

* * @param groupNames * One or more security group names. */ public void setGroupNames(java.util.Collection groupNames) { if (groupNames == null) { this.groupNames = null; return; } this.groupNames = new com.amazonaws.internal.SdkInternalList( groupNames); } /** *

* One or more security group names. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setGroupNames(java.util.Collection)} or * {@link #withGroupNames(java.util.Collection)} if you want to override the * existing values. *

* * @param groupNames * One or more security group names. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withGroupNames( String... groupNames) { if (this.groupNames == null) { setGroupNames(new com.amazonaws.internal.SdkInternalList( groupNames.length)); } for (String ele : groupNames) { this.groupNames.add(ele); } return this; } /** *

* One or more security group names. *

* * @param groupNames * One or more security group names. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withGroupNames( java.util.Collection groupNames) { setGroupNames(groupNames); return this; } /** *

* One or more security group IDs. *

* * @return One or more security group IDs. */ public java.util.List getGroupIds() { if (groupIds == null) { groupIds = new com.amazonaws.internal.SdkInternalList(); } return groupIds; } /** *

* One or more security group IDs. *

* * @param groupIds * One or more security group IDs. */ public void setGroupIds(java.util.Collection groupIds) { if (groupIds == null) { this.groupIds = null; return; } this.groupIds = new com.amazonaws.internal.SdkInternalList( groupIds); } /** *

* One or more security group IDs. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setGroupIds(java.util.Collection)} or * {@link #withGroupIds(java.util.Collection)} if you want to override the * existing values. *

* * @param groupIds * One or more security group IDs. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withGroupIds(String... groupIds) { if (this.groupIds == null) { setGroupIds(new com.amazonaws.internal.SdkInternalList( groupIds.length)); } for (String ele : groupIds) { this.groupIds.add(ele); } return this; } /** *

* One or more security group IDs. *

* * @param groupIds * One or more security group IDs. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withGroupIds( java.util.Collection groupIds) { setGroupIds(groupIds); return this; } /** *

* Reserved. *

* * @param additionalInfo * Reserved. */ public void setAdditionalInfo(String additionalInfo) { this.additionalInfo = additionalInfo; } /** *

* Reserved. *

* * @return Reserved. */ public String getAdditionalInfo() { return this.additionalInfo; } /** *

* Reserved. *

* * @param additionalInfo * Reserved. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withAdditionalInfo( String additionalInfo) { setAdditionalInfo(additionalInfo); return this; } /** *

* The user data to make available to the instance. If you are using an AWS * SDK or command line tool, Base64-encoding is performed for you, and you * can load the text from a file. Otherwise, you must provide Base64-encoded * text. *

* * @param userData * The user data to make available to the instance. If you are using * an AWS SDK or command line tool, Base64-encoding is performed for * you, and you can load the text from a file. Otherwise, you must * provide Base64-encoded text. */ public void setUserData(UserData userData) { this.userData = userData; } /** *

* The user data to make available to the instance. If you are using an AWS * SDK or command line tool, Base64-encoding is performed for you, and you * can load the text from a file. Otherwise, you must provide Base64-encoded * text. *

* * @return The user data to make available to the instance. If you are using * an AWS SDK or command line tool, Base64-encoding is performed for * you, and you can load the text from a file. Otherwise, you must * provide Base64-encoded text. */ public UserData getUserData() { return this.userData; } /** *

* The user data to make available to the instance. If you are using an AWS * SDK or command line tool, Base64-encoding is performed for you, and you * can load the text from a file. Otherwise, you must provide Base64-encoded * text. *

* * @param userData * The user data to make available to the instance. If you are using * an AWS SDK or command line tool, Base64-encoding is performed for * you, and you can load the text from a file. Otherwise, you must * provide Base64-encoded text. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withUserData(UserData userData) { setUserData(userData); return this; } /** *

* The instance type. For more information about the instance types that you * can import, see Before You Get Started in the Amazon Elastic Compute Cloud User * Guide. *

* * @param instanceType * The instance type. For more information about the instance types * that you can import, see Before You Get Started in the Amazon Elastic Compute Cloud * User Guide. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** *

* The instance type. For more information about the instance types that you * can import, see Before You Get Started in the Amazon Elastic Compute Cloud User * Guide. *

* * @return The instance type. For more information about the instance types * that you can import, see Before You Get Started in the Amazon Elastic Compute Cloud * User Guide. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** *

* The instance type. For more information about the instance types that you * can import, see Before You Get Started in the Amazon Elastic Compute Cloud User * Guide. *

* * @param instanceType * The instance type. For more information about the instance types * that you can import, see Before You Get Started in the Amazon Elastic Compute Cloud * User Guide. * @return Returns a reference to this object so that method calls can be * chained together. * @see InstanceType */ public ImportInstanceLaunchSpecification withInstanceType( String instanceType) { setInstanceType(instanceType); return this; } /** *

* The instance type. For more information about the instance types that you * can import, see Before You Get Started in the Amazon Elastic Compute Cloud User * Guide. *

* * @param instanceType * The instance type. For more information about the instance types * that you can import, see Before You Get Started in the Amazon Elastic Compute Cloud * User Guide. * @see InstanceType */ public void setInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); } /** *

* The instance type. For more information about the instance types that you * can import, see Before You Get Started in the Amazon Elastic Compute Cloud User * Guide. *

* * @param instanceType * The instance type. For more information about the instance types * that you can import, see Before You Get Started in the Amazon Elastic Compute Cloud * User Guide. * @return Returns a reference to this object so that method calls can be * chained together. * @see InstanceType */ public ImportInstanceLaunchSpecification withInstanceType( InstanceType instanceType) { setInstanceType(instanceType); return this; } /** *

* The placement information for the instance. *

* * @param placement * The placement information for the instance. */ public void setPlacement(Placement placement) { this.placement = placement; } /** *

* The placement information for the instance. *

* * @return The placement information for the instance. */ public Placement getPlacement() { return this.placement; } /** *

* The placement information for the instance. *

* * @param placement * The placement information for the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withPlacement(Placement placement) { setPlacement(placement); return this; } /** *

* Indicates whether monitoring is enabled. *

* * @param monitoring * Indicates whether monitoring is enabled. */ public void setMonitoring(Boolean monitoring) { this.monitoring = monitoring; } /** *

* Indicates whether monitoring is enabled. *

* * @return Indicates whether monitoring is enabled. */ public Boolean getMonitoring() { return this.monitoring; } /** *

* Indicates whether monitoring is enabled. *

* * @param monitoring * Indicates whether monitoring is enabled. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withMonitoring(Boolean monitoring) { setMonitoring(monitoring); return this; } /** *

* Indicates whether monitoring is enabled. *

* * @return Indicates whether monitoring is enabled. */ public Boolean isMonitoring() { return this.monitoring; } /** *

* [EC2-VPC] The ID of the subnet in which to launch the instance. *

* * @param subnetId * [EC2-VPC] The ID of the subnet in which to launch the instance. */ public void setSubnetId(String subnetId) { this.subnetId = subnetId; } /** *

* [EC2-VPC] The ID of the subnet in which to launch the instance. *

* * @return [EC2-VPC] The ID of the subnet in which to launch the instance. */ public String getSubnetId() { return this.subnetId; } /** *

* [EC2-VPC] The ID of the subnet in which to launch the instance. *

* * @param subnetId * [EC2-VPC] The ID of the subnet in which to launch the instance. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withSubnetId(String subnetId) { setSubnetId(subnetId); return this; } /** *

* Indicates whether an instance stops or terminates when you initiate * shutdown from the instance (using the operating system command for system * shutdown). *

* * @param instanceInitiatedShutdownBehavior * Indicates whether an instance stops or terminates when you * initiate shutdown from the instance (using the operating system * command for system shutdown). * @see ShutdownBehavior */ public void setInstanceInitiatedShutdownBehavior( String instanceInitiatedShutdownBehavior) { this.instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior; } /** *

* Indicates whether an instance stops or terminates when you initiate * shutdown from the instance (using the operating system command for system * shutdown). *

* * @return Indicates whether an instance stops or terminates when you * initiate shutdown from the instance (using the operating system * command for system shutdown). * @see ShutdownBehavior */ public String getInstanceInitiatedShutdownBehavior() { return this.instanceInitiatedShutdownBehavior; } /** *

* Indicates whether an instance stops or terminates when you initiate * shutdown from the instance (using the operating system command for system * shutdown). *

* * @param instanceInitiatedShutdownBehavior * Indicates whether an instance stops or terminates when you * initiate shutdown from the instance (using the operating system * command for system shutdown). * @return Returns a reference to this object so that method calls can be * chained together. * @see ShutdownBehavior */ public ImportInstanceLaunchSpecification withInstanceInitiatedShutdownBehavior( String instanceInitiatedShutdownBehavior) { setInstanceInitiatedShutdownBehavior(instanceInitiatedShutdownBehavior); return this; } /** *

* Indicates whether an instance stops or terminates when you initiate * shutdown from the instance (using the operating system command for system * shutdown). *

* * @param instanceInitiatedShutdownBehavior * Indicates whether an instance stops or terminates when you * initiate shutdown from the instance (using the operating system * command for system shutdown). * @see ShutdownBehavior */ public void setInstanceInitiatedShutdownBehavior( ShutdownBehavior instanceInitiatedShutdownBehavior) { this.instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior .toString(); } /** *

* Indicates whether an instance stops or terminates when you initiate * shutdown from the instance (using the operating system command for system * shutdown). *

* * @param instanceInitiatedShutdownBehavior * Indicates whether an instance stops or terminates when you * initiate shutdown from the instance (using the operating system * command for system shutdown). * @return Returns a reference to this object so that method calls can be * chained together. * @see ShutdownBehavior */ public ImportInstanceLaunchSpecification withInstanceInitiatedShutdownBehavior( ShutdownBehavior instanceInitiatedShutdownBehavior) { setInstanceInitiatedShutdownBehavior(instanceInitiatedShutdownBehavior); return this; } /** *

* [EC2-VPC] An available IP address from the IP address range of the * subnet. *

* * @param privateIpAddress * [EC2-VPC] An available IP address from the IP address range of the * subnet. */ public void setPrivateIpAddress(String privateIpAddress) { this.privateIpAddress = privateIpAddress; } /** *

* [EC2-VPC] An available IP address from the IP address range of the * subnet. *

* * @return [EC2-VPC] An available IP address from the IP address range of * the subnet. */ public String getPrivateIpAddress() { return this.privateIpAddress; } /** *

* [EC2-VPC] An available IP address from the IP address range of the * subnet. *

* * @param privateIpAddress * [EC2-VPC] An available IP address from the IP address range of the * subnet. * @return Returns a reference to this object so that method calls can be * chained together. */ public ImportInstanceLaunchSpecification withPrivateIpAddress( String privateIpAddress) { setPrivateIpAddress(privateIpAddress); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getArchitecture() != null) sb.append("Architecture: " + getArchitecture() + ","); if (getGroupNames() != null) sb.append("GroupNames: " + getGroupNames() + ","); if (getGroupIds() != null) sb.append("GroupIds: " + getGroupIds() + ","); if (getAdditionalInfo() != null) sb.append("AdditionalInfo: " + getAdditionalInfo() + ","); if (getUserData() != null) sb.append("UserData: " + getUserData() + ","); if (getInstanceType() != null) sb.append("InstanceType: " + getInstanceType() + ","); if (getPlacement() != null) sb.append("Placement: " + getPlacement() + ","); if (getMonitoring() != null) sb.append("Monitoring: " + getMonitoring() + ","); if (getSubnetId() != null) sb.append("SubnetId: " + getSubnetId() + ","); if (getInstanceInitiatedShutdownBehavior() != null) sb.append("InstanceInitiatedShutdownBehavior: " + getInstanceInitiatedShutdownBehavior() + ","); if (getPrivateIpAddress() != null) sb.append("PrivateIpAddress: " + getPrivateIpAddress()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ImportInstanceLaunchSpecification == false) return false; ImportInstanceLaunchSpecification other = (ImportInstanceLaunchSpecification) obj; if (other.getArchitecture() == null ^ this.getArchitecture() == null) return false; if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false) return false; if (other.getGroupNames() == null ^ this.getGroupNames() == null) return false; if (other.getGroupNames() != null && other.getGroupNames().equals(this.getGroupNames()) == false) return false; if (other.getGroupIds() == null ^ this.getGroupIds() == null) return false; if (other.getGroupIds() != null && other.getGroupIds().equals(this.getGroupIds()) == false) return false; if (other.getAdditionalInfo() == null ^ this.getAdditionalInfo() == null) return false; if (other.getAdditionalInfo() != null && other.getAdditionalInfo().equals(this.getAdditionalInfo()) == false) return false; if (other.getUserData() == null ^ this.getUserData() == null) return false; if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == false) return false; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false; if (other.getPlacement() == null ^ this.getPlacement() == null) return false; if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false) return false; if (other.getMonitoring() == null ^ this.getMonitoring() == null) return false; if (other.getMonitoring() != null && other.getMonitoring().equals(this.getMonitoring()) == false) return false; if (other.getSubnetId() == null ^ this.getSubnetId() == null) return false; if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == false) return false; if (other.getInstanceInitiatedShutdownBehavior() == null ^ this.getInstanceInitiatedShutdownBehavior() == null) return false; if (other.getInstanceInitiatedShutdownBehavior() != null && other.getInstanceInitiatedShutdownBehavior().equals( this.getInstanceInitiatedShutdownBehavior()) == false) return false; if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == null) return false; if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals( this.getPrivateIpAddress()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture() .hashCode()); hashCode = prime * hashCode + ((getGroupNames() == null) ? 0 : getGroupNames().hashCode()); hashCode = prime * hashCode + ((getGroupIds() == null) ? 0 : getGroupIds().hashCode()); hashCode = prime * hashCode + ((getAdditionalInfo() == null) ? 0 : getAdditionalInfo() .hashCode()); hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType() .hashCode()); hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode()); hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); hashCode = prime * hashCode + ((getInstanceInitiatedShutdownBehavior() == null) ? 0 : getInstanceInitiatedShutdownBehavior().hashCode()); hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress() .hashCode()); return hashCode; } @Override public ImportInstanceLaunchSpecification clone() { try { return (ImportInstanceLaunchSpecification) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy