Class InstanceNetworkInterfaceSpecification
- java.lang.Object
-
- com.amazonaws.services.ec2.model.InstanceNetworkInterfaceSpecification
-
- All Implemented Interfaces:
Serializable,Cloneable
public class InstanceNetworkInterfaceSpecification extends Object implements Serializable, Cloneable
Describes a network interface.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstanceNetworkInterfaceSpecification()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstanceNetworkInterfaceSpecificationclone()booleanequals(Object obj)BooleangetAssociatePublicIpAddress()Indicates whether to assign a public IP address to an instance you launch in a VPC.BooleangetDeleteOnTermination()If set totrue, the interface is deleted when the instance is terminated.StringgetDescription()The description of the network interface.IntegergetDeviceIndex()The index of the device on the instance for the network interface attachment.List<String>getGroups()The IDs of the security groups for the network interface.StringgetNetworkInterfaceId()The ID of the network interface.StringgetPrivateIpAddress()The private IP address of the network interface.List<PrivateIpAddressSpecification>getPrivateIpAddresses()One or more private IP addresses to assign to the network interface.IntegergetSecondaryPrivateIpAddressCount()The number of secondary private IP addresses.StringgetSubnetId()The ID of the subnet associated with the network string.inthashCode()BooleanisAssociatePublicIpAddress()Indicates whether to assign a public IP address to an instance you launch in a VPC.BooleanisDeleteOnTermination()If set totrue, the interface is deleted when the instance is terminated.voidsetAssociatePublicIpAddress(Boolean associatePublicIpAddress)Indicates whether to assign a public IP address to an instance you launch in a VPC.voidsetDeleteOnTermination(Boolean deleteOnTermination)If set totrue, the interface is deleted when the instance is terminated.voidsetDescription(String description)The description of the network interface.voidsetDeviceIndex(Integer deviceIndex)The index of the device on the instance for the network interface attachment.voidsetGroups(Collection<String> groups)The IDs of the security groups for the network interface.voidsetNetworkInterfaceId(String networkInterfaceId)The ID of the network interface.voidsetPrivateIpAddress(String privateIpAddress)The private IP address of the network interface.voidsetPrivateIpAddresses(Collection<PrivateIpAddressSpecification> privateIpAddresses)One or more private IP addresses to assign to the network interface.voidsetSecondaryPrivateIpAddressCount(Integer secondaryPrivateIpAddressCount)The number of secondary private IP addresses.voidsetSubnetId(String subnetId)The ID of the subnet associated with the network string.StringtoString()Returns a string representation of this object; useful for testing and debugging.InstanceNetworkInterfaceSpecificationwithAssociatePublicIpAddress(Boolean associatePublicIpAddress)Indicates whether to assign a public IP address to an instance you launch in a VPC.InstanceNetworkInterfaceSpecificationwithDeleteOnTermination(Boolean deleteOnTermination)If set totrue, the interface is deleted when the instance is terminated.InstanceNetworkInterfaceSpecificationwithDescription(String description)The description of the network interface.InstanceNetworkInterfaceSpecificationwithDeviceIndex(Integer deviceIndex)The index of the device on the instance for the network interface attachment.InstanceNetworkInterfaceSpecificationwithGroups(String... groups)The IDs of the security groups for the network interface.InstanceNetworkInterfaceSpecificationwithGroups(Collection<String> groups)The IDs of the security groups for the network interface.InstanceNetworkInterfaceSpecificationwithNetworkInterfaceId(String networkInterfaceId)The ID of the network interface.InstanceNetworkInterfaceSpecificationwithPrivateIpAddress(String privateIpAddress)The private IP address of the network interface.InstanceNetworkInterfaceSpecificationwithPrivateIpAddresses(PrivateIpAddressSpecification... privateIpAddresses)One or more private IP addresses to assign to the network interface.InstanceNetworkInterfaceSpecificationwithPrivateIpAddresses(Collection<PrivateIpAddressSpecification> privateIpAddresses)One or more private IP addresses to assign to the network interface.InstanceNetworkInterfaceSpecificationwithSecondaryPrivateIpAddressCount(Integer secondaryPrivateIpAddressCount)The number of secondary private IP addresses.InstanceNetworkInterfaceSpecificationwithSubnetId(String subnetId)The ID of the subnet associated with the network string.
-
-
-
Method Detail
-
setNetworkInterfaceId
public void setNetworkInterfaceId(String networkInterfaceId)
The ID of the network interface.
- Parameters:
networkInterfaceId- The ID of the network interface.
-
getNetworkInterfaceId
public String getNetworkInterfaceId()
The ID of the network interface.
- Returns:
- The ID of the network interface.
-
withNetworkInterfaceId
public InstanceNetworkInterfaceSpecification withNetworkInterfaceId(String networkInterfaceId)
The ID of the network interface.
- Parameters:
networkInterfaceId- The ID of the network interface.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDeviceIndex
public void setDeviceIndex(Integer deviceIndex)
The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.
- Parameters:
deviceIndex- The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.
-
getDeviceIndex
public Integer getDeviceIndex()
The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.
- Returns:
- The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.
-
withDeviceIndex
public InstanceNetworkInterfaceSpecification withDeviceIndex(Integer deviceIndex)
The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.
- Parameters:
deviceIndex- The index of the device on the instance for the network interface attachment. If you are specifying a network interface in a RunInstances request, you must provide the device index.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setSubnetId
public void setSubnetId(String subnetId)
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
- Parameters:
subnetId- The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
-
getSubnetId
public String getSubnetId()
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
- Returns:
- The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
-
withSubnetId
public InstanceNetworkInterfaceSpecification withSubnetId(String subnetId)
The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.
- Parameters:
subnetId- The ID of the subnet associated with the network string. Applies only if creating a network interface when launching an instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDescription
public void setDescription(String description)
The description of the network interface. Applies only if creating a network interface when launching an instance.
- Parameters:
description- The description of the network interface. Applies only if creating a network interface when launching an instance.
-
getDescription
public String getDescription()
The description of the network interface. Applies only if creating a network interface when launching an instance.
- Returns:
- The description of the network interface. Applies only if creating a network interface when launching an instance.
-
withDescription
public InstanceNetworkInterfaceSpecification withDescription(String description)
The description of the network interface. Applies only if creating a network interface when launching an instance.
- Parameters:
description- The description of the network interface. Applies only if creating a network interface when launching an instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPrivateIpAddress
public void setPrivateIpAddress(String privateIpAddress)
The private IP address of the network interface. Applies only if creating a network interface when launching an instance.
- Parameters:
privateIpAddress- The private IP address of the network interface. Applies only if creating a network interface when launching an instance.
-
getPrivateIpAddress
public String getPrivateIpAddress()
The private IP address of the network interface. Applies only if creating a network interface when launching an instance.
- Returns:
- The private IP address of the network interface. Applies only if creating a network interface when launching an instance.
-
withPrivateIpAddress
public InstanceNetworkInterfaceSpecification withPrivateIpAddress(String privateIpAddress)
The private IP address of the network interface. Applies only if creating a network interface when launching an instance.
- Parameters:
privateIpAddress- The private IP address of the network interface. Applies only if creating a network interface when launching an instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getGroups
public List<String> getGroups()
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
- Returns:
- The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
-
setGroups
public void setGroups(Collection<String> groups)
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
- Parameters:
groups- The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
-
withGroups
public InstanceNetworkInterfaceSpecification withGroups(String... groups)
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
NOTE: This method appends the values to the existing list (if any). Use
setGroups(java.util.Collection)orwithGroups(java.util.Collection)if you want to override the existing values.- Parameters:
groups- The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withGroups
public InstanceNetworkInterfaceSpecification withGroups(Collection<String> groups)
The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
- Parameters:
groups- The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setDeleteOnTermination
public void setDeleteOnTermination(Boolean deleteOnTermination)
If set to
true, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.- Parameters:
deleteOnTermination- If set totrue, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.
-
getDeleteOnTermination
public Boolean getDeleteOnTermination()
If set to
true, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.- Returns:
- If set to
true, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.
-
withDeleteOnTermination
public InstanceNetworkInterfaceSpecification withDeleteOnTermination(Boolean deleteOnTermination)
If set to
true, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.- Parameters:
deleteOnTermination- If set totrue, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isDeleteOnTermination
public Boolean isDeleteOnTermination()
If set to
true, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.- Returns:
- If set to
true, the interface is deleted when the instance is terminated. You can specifytrueonly if creating a new network interface when launching an instance.
-
getPrivateIpAddresses
public List<PrivateIpAddressSpecification> getPrivateIpAddresses()
One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.
- Returns:
- One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.
-
setPrivateIpAddresses
public void setPrivateIpAddresses(Collection<PrivateIpAddressSpecification> privateIpAddresses)
One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.
- Parameters:
privateIpAddresses- One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.
-
withPrivateIpAddresses
public InstanceNetworkInterfaceSpecification withPrivateIpAddresses(PrivateIpAddressSpecification... privateIpAddresses)
One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.
NOTE: This method appends the values to the existing list (if any). Use
setPrivateIpAddresses(java.util.Collection)orwithPrivateIpAddresses(java.util.Collection)if you want to override the existing values.- Parameters:
privateIpAddresses- One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withPrivateIpAddresses
public InstanceNetworkInterfaceSpecification withPrivateIpAddresses(Collection<PrivateIpAddressSpecification> privateIpAddresses)
One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.
- Parameters:
privateIpAddresses- One or more private IP addresses to assign to the network interface. Only one private IP address can be designated as primary.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setSecondaryPrivateIpAddressCount
public void setSecondaryPrivateIpAddressCount(Integer secondaryPrivateIpAddressCount)
The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.
- Parameters:
secondaryPrivateIpAddressCount- The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.
-
getSecondaryPrivateIpAddressCount
public Integer getSecondaryPrivateIpAddressCount()
The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.
- Returns:
- The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.
-
withSecondaryPrivateIpAddressCount
public InstanceNetworkInterfaceSpecification withSecondaryPrivateIpAddressCount(Integer secondaryPrivateIpAddressCount)
The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.
- Parameters:
secondaryPrivateIpAddressCount- The number of secondary private IP addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setAssociatePublicIpAddress
public void setAssociatePublicIpAddress(Boolean associatePublicIpAddress)
Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is
true.- Parameters:
associatePublicIpAddress- Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value istrue.
-
getAssociatePublicIpAddress
public Boolean getAssociatePublicIpAddress()
Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is
true.- Returns:
- Indicates whether to assign a public IP address to an instance
you launch in a VPC. The public IP address can only be assigned
to a network interface for eth0, and can only be assigned to a
new network interface, not an existing one. You cannot specify
more than one network interface in the request. If launching into
a default subnet, the default value is
true.
-
withAssociatePublicIpAddress
public InstanceNetworkInterfaceSpecification withAssociatePublicIpAddress(Boolean associatePublicIpAddress)
Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is
true.- Parameters:
associatePublicIpAddress- Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value istrue.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isAssociatePublicIpAddress
public Boolean isAssociatePublicIpAddress()
Indicates whether to assign a public IP address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is
true.- Returns:
- Indicates whether to assign a public IP address to an instance
you launch in a VPC. The public IP address can only be assigned
to a network interface for eth0, and can only be assigned to a
new network interface, not an existing one. You cannot specify
more than one network interface in the request. If launching into
a default subnet, the default value is
true.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public InstanceNetworkInterfaceSpecification clone()
-
-