@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 bids.
|
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) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz)
Used to retrieve the value of a field from any class that extends
SdkRequest . |
int |
hashCode() |
Integer |
instanceCount()
The maximum number of Spot instances to launch.
|
InstanceInterruptionBehavior |
instanceInterruptionBehavior()
Indicates whether a Spot instance stops or terminates when it is interrupted.
|
String |
instanceInterruptionBehaviorAsString()
Indicates whether a Spot instance stops or terminates when it is interrupted.
|
String |
launchGroup()
The instance launch group.
|
LaunchSpecification |
launchSpecification()
The launch specification.
|
static Class<? extends RequestSpotInstancesRequest.Builder> |
serializableBuilderClass() |
String |
spotPrice()
The maximum hourly price (bid) for any Spot instance launched to fulfill the request.
|
RequestSpotInstancesRequest.Builder |
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.
|
String |
toString() |
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.
|
overrideConfiguration
copy
public String availabilityZoneGroup()
The user-specified name for a logical grouping of bids.
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 bids 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 bid is expired, or the bid falls below current market), 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 bids 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 bid is expired, or the bid falls below current market), 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 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.
Note that you can't specify an Availability Zone group or a launch group if you specify a duration.
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.
Note that you can't specify an Availability Zone group or a launch group if you specify a duration.
public 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 Elastic Compute Cloud User Guide.
public Integer instanceCount()
The maximum number of Spot instances to launch.
Default: 1
Default: 1
public 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 LaunchSpecification launchSpecification()
The launch specification.
public String spotPrice()
The maximum hourly price (bid) for any Spot instance launched to fulfill the request.
public 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
SpotInstanceType
public 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
SpotInstanceType
public 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.
Default: The request is effective indefinitely.
Default: The request is effective indefinitely.
public Instant validUntil()
The end date of the request. If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
Default: The request is effective indefinitely.
Default: The request is effective indefinitely.
public InstanceInterruptionBehavior instanceInterruptionBehavior()
Indicates whether a Spot instance stops or terminates when it is interrupted.
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()
.
InstanceInterruptionBehavior
public String instanceInterruptionBehaviorAsString()
Indicates whether a Spot instance stops or terminates when it is interrupted.
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()
.
InstanceInterruptionBehavior
public RequestSpotInstancesRequest.Builder toBuilder()
ToCopyableBuilder
toBuilder
in interface ToCopyableBuilder<RequestSpotInstancesRequest.Builder,RequestSpotInstancesRequest>
toBuilder
in class Ec2Request
public static RequestSpotInstancesRequest.Builder builder()
public static Class<? extends RequestSpotInstancesRequest.Builder> serializableBuilderClass()
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
SdkRequest
SdkRequest
. The field name
specified should match the member name from the corresponding service-2.json model specified in the
codegen-resources folder for a given service. The class specifies what class to cast the returned value to.
If the returned value is also a modeled class, the SdkRequest.getValueForField(String, Class)
method will
again be available.getValueForField
in class SdkRequest
fieldName
- The name of the member to be retrieved.clazz
- The class to cast the returned object to.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.