@Generated(value="software.amazon.awssdk:codegen") public final class RequestSpotInstancesRequest extends Ec2Request implements ToCopyableBuilder<RequestSpotInstancesRequest.Builder,RequestSpotInstancesRequest>
Contains the parameters for RequestSpotInstances.
| Modifier and Type | Class and Description |
|---|---|
static interface |
RequestSpotInstancesRequest.Builder |
| Modifier and Type | Method and Description |
|---|---|
String |
availabilityZoneGroup()
The user-specified name for a logical grouping of requests.
|
Integer |
blockDurationMinutes()
The required duration for the Spot Instances (also known as Spot blocks), in minutes.
|
static RequestSpotInstancesRequest.Builder |
builder() |
String |
clientToken()
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
int |
hashCode() |
boolean |
hasTagSpecifications()
Returns true if the TagSpecifications property was specified by the sender (it may be empty), or false if the
sender did not specify the value (it will be empty).
|
Integer |
instanceCount()
The maximum number of Spot Instances to launch.
|
InstanceInterruptionBehavior |
instanceInterruptionBehavior()
The behavior when a Spot Instance is interrupted.
|
String |
instanceInterruptionBehaviorAsString()
The behavior when a Spot Instance is interrupted.
|
String |
launchGroup()
The instance launch group.
|
RequestSpotLaunchSpecification |
launchSpecification()
The launch specification.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends RequestSpotInstancesRequest.Builder> |
serializableBuilderClass() |
String |
spotPrice()
The maximum price per hour that you are willing to pay for a Spot Instance.
|
List<TagSpecification> |
tagSpecifications()
The key-value pair for tagging the Spot Instance request on creation.
|
RequestSpotInstancesRequest.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
SpotInstanceType |
type()
The Spot Instance request type.
|
String |
typeAsString()
The Spot Instance request type.
|
Instant |
validFrom()
The start date of the request.
|
Instant |
validUntil()
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
|
overrideConfigurationclone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic final String availabilityZoneGroup()
The user-specified name for a logical grouping of requests.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
public final Integer blockDurationMinutes()
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
The duration period starts as soon as your Spot Instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
You can't specify an Availability Zone group or a launch group if you specify a duration.
New accounts or accounts with no previous billing history with AWS are not eligible for Spot Instances with a defined duration (also known as Spot blocks).
The duration period starts as soon as your Spot Instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
You can't specify an Availability Zone group or a launch group if you specify a duration.
New accounts or accounts with no previous billing history with AWS are not eligible for Spot Instances with a defined duration (also known as Spot blocks).
public final String clientToken()
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.
public final Integer instanceCount()
The maximum number of Spot Instances to launch.
Default: 1
Default: 1
public final String launchGroup()
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
Default: Instances are launched and terminated individually
Default: Instances are launched and terminated individually
public final RequestSpotLaunchSpecification launchSpecification()
The launch specification.
public final String spotPrice()
The maximum price per hour that you are willing to pay for a Spot Instance. The default is the On-Demand price.
public final SpotInstanceType type()
The Spot Instance request type.
Default: one-time
If the service returns an enum value that is not available in the current SDK version, type will return
SpotInstanceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
typeAsString().
Default: one-time
SpotInstanceTypepublic final String typeAsString()
The Spot Instance request type.
Default: one-time
If the service returns an enum value that is not available in the current SDK version, type will return
SpotInstanceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
typeAsString().
Default: one-time
SpotInstanceTypepublic final Instant validFrom()
The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.
The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
public final Instant validUntil()
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
For a persistent request, the request remains active until the ValidUntil date and time is reached.
Otherwise, the request remains active until you cancel it.
For a one-time request, the request remains active until all instances launch, the request is canceled, or the
ValidUntil date and time is reached. By default, the request is valid for 7 days from the date the
request was created.
For a persistent request, the request remains active until the ValidUntil date and time is
reached. Otherwise, the request remains active until you cancel it.
For a one-time request, the request remains active until all instances launch, the request is canceled,
or the ValidUntil date and time is reached. By default, the request is valid for 7 days from
the date the request was created.
public final boolean hasTagSpecifications()
public final List<TagSpecification> tagSpecifications()
The key-value pair for tagging the Spot Instance request on creation. The value for ResourceType
must be spot-instances-request, otherwise the Spot Instance request fails. To tag the Spot Instance
request after it has been created, see CreateTags.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
You can use hasTagSpecifications() to see if a value was sent in this field.
ResourceType must be spot-instances-request, otherwise the Spot Instance
request fails. To tag the Spot Instance request after it has been created, see CreateTags.public final InstanceInterruptionBehavior instanceInterruptionBehavior()
The behavior when a Spot Instance is interrupted. The default is terminate.
If the service returns an enum value that is not available in the current SDK version,
instanceInterruptionBehavior will return InstanceInterruptionBehavior.UNKNOWN_TO_SDK_VERSION.
The raw value returned by the service is available from instanceInterruptionBehaviorAsString().
terminate.InstanceInterruptionBehaviorpublic final String instanceInterruptionBehaviorAsString()
The behavior when a Spot Instance is interrupted. The default is terminate.
If the service returns an enum value that is not available in the current SDK version,
instanceInterruptionBehavior will return InstanceInterruptionBehavior.UNKNOWN_TO_SDK_VERSION.
The raw value returned by the service is available from instanceInterruptionBehaviorAsString().
terminate.InstanceInterruptionBehaviorpublic RequestSpotInstancesRequest.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<RequestSpotInstancesRequest.Builder,RequestSpotInstancesRequest>toBuilder in class Ec2Requestpublic static RequestSpotInstancesRequest.Builder builder()
public static Class<? extends RequestSpotInstancesRequest.Builder> serializableBuilderClass()
public final int hashCode()
hashCode in class AwsRequestpublic final boolean equals(Object obj)
equals in class AwsRequestpublic final boolean equalsBySdkFields(Object obj)
equalsBySdkFields in interface SdkPojopublic final String toString()
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
getValueForField in class SdkRequestCopyright © 2021. All rights reserved.