public class ModifyInstancePlacementRequest extends AmazonWebServiceRequest implements java.io.Serializable
ModifyInstancePlacement operation
.
Set the instance affinity value for a specific stopped instance and modify the instance tenancy setting.
Instance affinity is disabled by default. When instance affinity is
host
and it is not associated with a specific Dedicated
host, the next time it is launched it will automatically be associated
with the host it lands on. This relationship will persist if the
instance is stopped/started, or rebooted.
You can modify the host ID associated with a stopped instance. If a stopped instance has a new host ID association, the instance will target that host when restarted.
You can modify the tenancy of a stopped instance with a tenancy of
host
or dedicated
.
Affinity, hostID, and tenancy are not required parameters, but at least one of them must be specified in the request. Affinity and tenancy can be modified in the same request, but tenancy can only be modified on instances that are stopped.
Constructor and Description |
---|
ModifyInstancePlacementRequest() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAffinity()
The new affinity setting for the instance.
|
java.lang.String |
getHostId()
The ID of the Dedicated host that the instance will have affinity
with.
|
java.lang.String |
getInstanceId()
The ID of the instance that you are modifying.
|
java.lang.String |
getTenancy()
The tenancy of the instance that you are modifying.
|
int |
hashCode() |
void |
setAffinity(Affinity affinity)
The new affinity setting for the instance.
|
void |
setAffinity(java.lang.String affinity)
The new affinity setting for the instance.
|
void |
setHostId(java.lang.String hostId)
The ID of the Dedicated host that the instance will have affinity
with.
|
void |
setInstanceId(java.lang.String instanceId)
The ID of the instance that you are modifying.
|
void |
setTenancy(HostTenancy tenancy)
The tenancy of the instance that you are modifying.
|
void |
setTenancy(java.lang.String tenancy)
The tenancy of the instance that you are modifying.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ModifyInstancePlacementRequest |
withAffinity(Affinity affinity)
The new affinity setting for the instance.
|
ModifyInstancePlacementRequest |
withAffinity(java.lang.String affinity)
The new affinity setting for the instance.
|
ModifyInstancePlacementRequest |
withHostId(java.lang.String hostId)
The ID of the Dedicated host that the instance will have affinity
with.
|
ModifyInstancePlacementRequest |
withInstanceId(java.lang.String instanceId)
The ID of the instance that you are modifying.
|
ModifyInstancePlacementRequest |
withTenancy(HostTenancy tenancy)
The tenancy of the instance that you are modifying.
|
ModifyInstancePlacementRequest |
withTenancy(java.lang.String tenancy)
The tenancy of the instance that you are modifying.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public java.lang.String getInstanceId()
public void setInstanceId(java.lang.String instanceId)
instanceId
- The ID of the instance that you are modifying.public ModifyInstancePlacementRequest 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 that you are modifying.public java.lang.String getTenancy()
Constraints:
Allowed Values: dedicated, host
HostTenancy
public void setTenancy(java.lang.String tenancy)
Constraints:
Allowed Values: dedicated, host
tenancy
- The tenancy of the instance that you are modifying.HostTenancy
public ModifyInstancePlacementRequest withTenancy(java.lang.String tenancy)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: dedicated, host
tenancy
- The tenancy of the instance that you are modifying.HostTenancy
public void setTenancy(HostTenancy tenancy)
Constraints:
Allowed Values: dedicated, host
tenancy
- The tenancy of the instance that you are modifying.HostTenancy
public ModifyInstancePlacementRequest withTenancy(HostTenancy tenancy)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: dedicated, host
tenancy
- The tenancy of the instance that you are modifying.HostTenancy
public java.lang.String getAffinity()
Constraints:
Allowed Values: default, host
Affinity
public void setAffinity(java.lang.String affinity)
Constraints:
Allowed Values: default, host
affinity
- The new affinity setting for the instance.Affinity
public ModifyInstancePlacementRequest withAffinity(java.lang.String affinity)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: default, host
affinity
- The new affinity setting for the instance.Affinity
public void setAffinity(Affinity affinity)
Constraints:
Allowed Values: default, host
affinity
- The new affinity setting for the instance.Affinity
public ModifyInstancePlacementRequest withAffinity(Affinity affinity)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: default, host
affinity
- The new affinity setting for the instance.Affinity
public java.lang.String getHostId()
public void setHostId(java.lang.String hostId)
hostId
- The ID of the Dedicated host that the instance will have affinity
with.public ModifyInstancePlacementRequest withHostId(java.lang.String hostId)
Returns a reference to this object so that method calls can be chained together.
hostId
- The ID of the Dedicated host that the instance will have affinity
with.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.