public class ModifyInstanceAttributeRequest extends AmazonWebServiceRequest implements java.io.Serializable, DryRunSupportedRequest<ModifyInstanceAttributeRequest>
ModifyInstanceAttribute operation
.
Modifies the specified attribute of the specified instance. You can specify only one attribute at a time.
To modify some attributes, the instance must be stopped. For more information, see Modifying Attributes of a Stopped Instance in the Amazon Elastic Compute Cloud User Guide .
Constructor and Description |
---|
ModifyInstanceAttributeRequest()
Default constructor for a new ModifyInstanceAttributeRequest object.
|
ModifyInstanceAttributeRequest(java.lang.String instanceId,
InstanceAttributeName attribute)
Constructs a new ModifyInstanceAttributeRequest object.
|
ModifyInstanceAttributeRequest(java.lang.String instanceId,
java.lang.String attribute)
Constructs a new ModifyInstanceAttributeRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAttribute()
The name of the attribute.
|
java.util.List<InstanceBlockDeviceMappingSpecification> |
getBlockDeviceMappings()
Modifies the
DeleteOnTermination attribute for volumes
that are currently attached. |
java.lang.Boolean |
getDisableApiTermination()
If the value is
true , you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. |
Request<ModifyInstanceAttributeRequest> |
getDryRunRequest()
This method is intended for internal use only.
|
java.lang.Boolean |
getEbsOptimized()
Specifies whether the instance is optimized for EBS I/O.
|
java.util.List<java.lang.String> |
getGroups()
[EC2-VPC] Changes the security groups of the instance.
|
java.lang.String |
getInstanceId()
The ID of the instance.
|
java.lang.String |
getInstanceInitiatedShutdownBehavior()
Specifies whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for
system shutdown).
|
java.lang.String |
getInstanceType()
Changes the instance type to the specified value.
|
java.lang.String |
getKernel()
Changes the instance's kernel to the specified value.
|
java.lang.String |
getRamdisk()
Changes the instance's RAM disk to the specified value.
|
java.lang.Boolean |
getSourceDestCheck()
Specifies whether source/destination checking is enabled.
|
java.lang.String |
getSriovNetSupport()
Set to
simple to enable enhanced networking for the
instance. |
java.lang.String |
getUserData()
Changes the instance's user data to the specified base64-encoded
value.
|
java.lang.String |
getValue()
A new value for the attribute.
|
int |
hashCode() |
java.lang.Boolean |
isDisableApiTermination()
If the value is
true , you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. |
java.lang.Boolean |
isEbsOptimized()
Specifies whether the instance is optimized for EBS I/O.
|
java.lang.Boolean |
isSourceDestCheck()
Specifies whether source/destination checking is enabled.
|
void |
setAttribute(InstanceAttributeName attribute)
The name of the attribute.
|
void |
setAttribute(java.lang.String attribute)
The name of the attribute.
|
void |
setBlockDeviceMappings(java.util.Collection<InstanceBlockDeviceMappingSpecification> blockDeviceMappings)
Modifies the
DeleteOnTermination attribute for volumes
that are currently attached. |
void |
setDisableApiTermination(java.lang.Boolean disableApiTermination)
If the value is
true , you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. |
void |
setEbsOptimized(java.lang.Boolean ebsOptimized)
Specifies whether the instance is optimized for EBS I/O.
|
void |
setGroups(java.util.Collection<java.lang.String> groups)
[EC2-VPC] Changes the security groups of the instance.
|
void |
setInstanceId(java.lang.String instanceId)
The ID of the instance.
|
void |
setInstanceInitiatedShutdownBehavior(java.lang.String instanceInitiatedShutdownBehavior)
Specifies whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for
system shutdown).
|
void |
setInstanceType(java.lang.String instanceType)
Changes the instance type to the specified value.
|
void |
setKernel(java.lang.String kernel)
Changes the instance's kernel to the specified value.
|
void |
setRamdisk(java.lang.String ramdisk)
Changes the instance's RAM disk to the specified value.
|
void |
setSourceDestCheck(java.lang.Boolean sourceDestCheck)
Specifies whether source/destination checking is enabled.
|
void |
setSriovNetSupport(java.lang.String sriovNetSupport)
Set to
simple to enable enhanced networking for the
instance. |
void |
setUserData(java.lang.String userData)
Changes the instance's user data to the specified base64-encoded
value.
|
void |
setValue(java.lang.String value)
A new value for the attribute.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ModifyInstanceAttributeRequest |
withAttribute(InstanceAttributeName attribute)
The name of the attribute.
|
ModifyInstanceAttributeRequest |
withAttribute(java.lang.String attribute)
The name of the attribute.
|
ModifyInstanceAttributeRequest |
withBlockDeviceMappings(java.util.Collection<InstanceBlockDeviceMappingSpecification> blockDeviceMappings)
Modifies the
DeleteOnTermination attribute for volumes
that are currently attached. |
ModifyInstanceAttributeRequest |
withBlockDeviceMappings(InstanceBlockDeviceMappingSpecification... blockDeviceMappings)
Modifies the
DeleteOnTermination attribute for volumes
that are currently attached. |
ModifyInstanceAttributeRequest |
withDisableApiTermination(java.lang.Boolean disableApiTermination)
If the value is
true , you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. |
ModifyInstanceAttributeRequest |
withEbsOptimized(java.lang.Boolean ebsOptimized)
Specifies whether the instance is optimized for EBS I/O.
|
ModifyInstanceAttributeRequest |
withGroups(java.util.Collection<java.lang.String> groups)
[EC2-VPC] Changes the security groups of the instance.
|
ModifyInstanceAttributeRequest |
withGroups(java.lang.String... groups)
[EC2-VPC] Changes the security groups of the instance.
|
ModifyInstanceAttributeRequest |
withInstanceId(java.lang.String instanceId)
The ID of the instance.
|
ModifyInstanceAttributeRequest |
withInstanceInitiatedShutdownBehavior(java.lang.String instanceInitiatedShutdownBehavior)
Specifies whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for
system shutdown).
|
ModifyInstanceAttributeRequest |
withInstanceType(java.lang.String instanceType)
Changes the instance type to the specified value.
|
ModifyInstanceAttributeRequest |
withKernel(java.lang.String kernel)
Changes the instance's kernel to the specified value.
|
ModifyInstanceAttributeRequest |
withRamdisk(java.lang.String ramdisk)
Changes the instance's RAM disk to the specified value.
|
ModifyInstanceAttributeRequest |
withSourceDestCheck(java.lang.Boolean sourceDestCheck)
Specifies whether source/destination checking is enabled.
|
ModifyInstanceAttributeRequest |
withSriovNetSupport(java.lang.String sriovNetSupport)
Set to
simple to enable enhanced networking for the
instance. |
ModifyInstanceAttributeRequest |
withUserData(java.lang.String userData)
Changes the instance's user data to the specified base64-encoded
value.
|
ModifyInstanceAttributeRequest |
withValue(java.lang.String value)
A new value for the attribute.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public ModifyInstanceAttributeRequest()
public ModifyInstanceAttributeRequest(java.lang.String instanceId, java.lang.String attribute)
instanceId
- The ID of the instance.attribute
- The name of the attribute.public ModifyInstanceAttributeRequest(java.lang.String instanceId, InstanceAttributeName attribute)
instanceId
- The ID of the instance.attribute
- The name of the attribute.public java.lang.String getInstanceId()
public void setInstanceId(java.lang.String instanceId)
instanceId
- The ID of the instance.public ModifyInstanceAttributeRequest withInstanceId(java.lang.String instanceId)
Returns a reference to this object so that method calls can be chained together.
instanceId
- The ID of the instance.public java.lang.String getAttribute()
Constraints:
Allowed Values: instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport
InstanceAttributeName
public void setAttribute(java.lang.String attribute)
Constraints:
Allowed Values: instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport
attribute
- The name of the attribute.InstanceAttributeName
public ModifyInstanceAttributeRequest withAttribute(java.lang.String attribute)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport
attribute
- The name of the attribute.InstanceAttributeName
public void setAttribute(InstanceAttributeName attribute)
Constraints:
Allowed Values: instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport
attribute
- The name of the attribute.InstanceAttributeName
public ModifyInstanceAttributeRequest withAttribute(InstanceAttributeName attribute)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimized, sriovNetSupport
attribute
- The name of the attribute.InstanceAttributeName
public java.lang.String getValue()
kernel
,
ramdisk
, userData
,
disableApiTermination
, or
instanceInitiatedShutdownBehavior
attribute.kernel
,
ramdisk
, userData
,
disableApiTermination
, or
instanceInitiatedShutdownBehavior
attribute.public void setValue(java.lang.String value)
kernel
,
ramdisk
, userData
,
disableApiTermination
, or
instanceInitiatedShutdownBehavior
attribute.value
- A new value for the attribute. Use only with the kernel
,
ramdisk
, userData
,
disableApiTermination
, or
instanceInitiatedShutdownBehavior
attribute.public ModifyInstanceAttributeRequest withValue(java.lang.String value)
kernel
,
ramdisk
, userData
,
disableApiTermination
, or
instanceInitiatedShutdownBehavior
attribute.
Returns a reference to this object so that method calls can be chained together.
value
- A new value for the attribute. Use only with the kernel
,
ramdisk
, userData
,
disableApiTermination
, or
instanceInitiatedShutdownBehavior
attribute.public java.util.List<InstanceBlockDeviceMappingSpecification> getBlockDeviceMappings()
DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
public void setBlockDeviceMappings(java.util.Collection<InstanceBlockDeviceMappingSpecification> blockDeviceMappings)
DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
blockDeviceMappings
- Modifies the DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
public ModifyInstanceAttributeRequest withBlockDeviceMappings(InstanceBlockDeviceMappingSpecification... blockDeviceMappings)
DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
Returns a reference to this object so that method calls can be chained together.
blockDeviceMappings
- Modifies the DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
public ModifyInstanceAttributeRequest withBlockDeviceMappings(java.util.Collection<InstanceBlockDeviceMappingSpecification> blockDeviceMappings)
DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
Returns a reference to this object so that method calls can be chained together.
blockDeviceMappings
- Modifies the DeleteOnTermination
attribute for volumes
that are currently attached. The volume must be owned by the caller.
If no value is specified for DeleteOnTermination
, the
default is true
and the volume is deleted when the
instance is terminated. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Updating the Block Device Mapping when Launching an Instance in the Amazon Elastic Compute Cloud User Guide.
public java.lang.Boolean isSourceDestCheck()
true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.public void setSourceDestCheck(java.lang.Boolean sourceDestCheck)
true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.sourceDestCheck
- Specifies whether source/destination checking is enabled. A value of
true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.public ModifyInstanceAttributeRequest withSourceDestCheck(java.lang.Boolean sourceDestCheck)
true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.
Returns a reference to this object so that method calls can be chained together.
sourceDestCheck
- Specifies whether source/destination checking is enabled. A value of
true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.public java.lang.Boolean getSourceDestCheck()
true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.true
means that checking is enabled, and
false
means checking is disabled. This value must be
false
for a NAT instance to perform NAT.public java.lang.Boolean isDisableApiTermination()
true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.public void setDisableApiTermination(java.lang.Boolean disableApiTermination)
true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.disableApiTermination
- If the value is true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.public ModifyInstanceAttributeRequest withDisableApiTermination(java.lang.Boolean disableApiTermination)
true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.
Returns a reference to this object so that method calls can be chained together.
disableApiTermination
- If the value is true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.public java.lang.Boolean getDisableApiTermination()
true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.true
, you can't terminate the instance
using the Amazon EC2 console, CLI, or API; otherwise, you can. You
cannot use this paramater for Spot Instances.public java.lang.String getInstanceType()
InvalidInstanceAttributeValue
.InvalidInstanceAttributeValue
.public void setInstanceType(java.lang.String instanceType)
InvalidInstanceAttributeValue
.instanceType
- Changes the instance type to the specified value. For more
information, see Instance
Types. If the instance type is not valid, the error returned is
InvalidInstanceAttributeValue
.public ModifyInstanceAttributeRequest withInstanceType(java.lang.String instanceType)
InvalidInstanceAttributeValue
.
Returns a reference to this object so that method calls can be chained together.
instanceType
- Changes the instance type to the specified value. For more
information, see Instance
Types. If the instance type is not valid, the error returned is
InvalidInstanceAttributeValue
.public java.lang.String getKernel()
public void setKernel(java.lang.String kernel)
kernel
- Changes the instance's kernel to the specified value. We recommend
that you use PV-GRUB instead of kernels and RAM disks. For more
information, see PV-GRUB.public ModifyInstanceAttributeRequest withKernel(java.lang.String kernel)
Returns a reference to this object so that method calls can be chained together.
kernel
- Changes the instance's kernel to the specified value. We recommend
that you use PV-GRUB instead of kernels and RAM disks. For more
information, see PV-GRUB.public java.lang.String getRamdisk()
public void setRamdisk(java.lang.String ramdisk)
ramdisk
- Changes the instance's RAM disk to the specified value. We recommend
that you use PV-GRUB instead of kernels and RAM disks. For more
information, see PV-GRUB.public ModifyInstanceAttributeRequest withRamdisk(java.lang.String ramdisk)
Returns a reference to this object so that method calls can be chained together.
ramdisk
- Changes the instance's RAM disk to the specified value. We recommend
that you use PV-GRUB instead of kernels and RAM disks. For more
information, see PV-GRUB.public java.lang.String getUserData()
public void setUserData(java.lang.String userData)
userData
- Changes the instance's user data to the specified base64-encoded
value. For command line tools, base64 encoding is performed for you.public ModifyInstanceAttributeRequest withUserData(java.lang.String userData)
Returns a reference to this object so that method calls can be chained together.
userData
- Changes the instance's user data to the specified base64-encoded
value. For command line tools, base64 encoding is performed for you.public java.lang.String getInstanceInitiatedShutdownBehavior()
public void setInstanceInitiatedShutdownBehavior(java.lang.String instanceInitiatedShutdownBehavior)
instanceInitiatedShutdownBehavior
- Specifies whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for
system shutdown).public ModifyInstanceAttributeRequest withInstanceInitiatedShutdownBehavior(java.lang.String instanceInitiatedShutdownBehavior)
Returns a reference to this object so that method calls can be chained together.
instanceInitiatedShutdownBehavior
- Specifies whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for
system shutdown).public java.util.List<java.lang.String> getGroups()
public void setGroups(java.util.Collection<java.lang.String> groups)
groups
- [EC2-VPC] Changes the security groups of the instance. You must
specify at least one security group, even if it's just the default
security group for the VPC. You must specify the security group ID,
not the security group name.public ModifyInstanceAttributeRequest withGroups(java.lang.String... groups)
Returns a reference to this object so that method calls can be chained together.
groups
- [EC2-VPC] Changes the security groups of the instance. You must
specify at least one security group, even if it's just the default
security group for the VPC. You must specify the security group ID,
not the security group name.public ModifyInstanceAttributeRequest withGroups(java.util.Collection<java.lang.String> groups)
Returns a reference to this object so that method calls can be chained together.
groups
- [EC2-VPC] Changes the security groups of the instance. You must
specify at least one security group, even if it's just the default
security group for the VPC. You must specify the security group ID,
not the security group name.public java.lang.Boolean isEbsOptimized()
public void setEbsOptimized(java.lang.Boolean ebsOptimized)
ebsOptimized
- Specifies whether the instance is optimized for EBS I/O. This
optimization provides dedicated throughput to Amazon EBS and an
optimized configuration stack to provide optimal EBS I/O performance.
This optimization isn't available with all instance types. Additional
usage charges apply when using an EBS Optimized instance.public ModifyInstanceAttributeRequest withEbsOptimized(java.lang.Boolean ebsOptimized)
Returns a reference to this object so that method calls can be chained together.
ebsOptimized
- Specifies whether the instance is optimized for EBS I/O. This
optimization provides dedicated throughput to Amazon EBS and an
optimized configuration stack to provide optimal EBS I/O performance.
This optimization isn't available with all instance types. Additional
usage charges apply when using an EBS Optimized instance.public java.lang.Boolean getEbsOptimized()
public java.lang.String getSriovNetSupport()
simple
to enable enhanced networking for the
instance. There is no way to disable enhanced networking at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
simple
to enable enhanced networking for the
instance. There is no way to disable enhanced networking at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
public void setSriovNetSupport(java.lang.String sriovNetSupport)
simple
to enable enhanced networking for the
instance. There is no way to disable enhanced networking at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
sriovNetSupport
- Set to simple
to enable enhanced networking for the
instance. There is no way to disable enhanced networking at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
public ModifyInstanceAttributeRequest withSriovNetSupport(java.lang.String sriovNetSupport)
simple
to enable enhanced networking for the
instance. There is no way to disable enhanced networking at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
Returns a reference to this object so that method calls can be chained together.
sriovNetSupport
- Set to simple
to enable enhanced networking for the
instance. There is no way to disable enhanced networking at this time.
This option is supported only for HVM instances. Specifying this option with a PV instance can make it unreachable.
public Request<ModifyInstanceAttributeRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<ModifyInstanceAttributeRequest>
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.