@Generated(value="software.amazon.awssdk:codegen") public final class TargetCapacitySpecification extends Object implements SdkPojo, Serializable, ToCopyableBuilder<TargetCapacitySpecification.Builder,TargetCapacitySpecification>
The number of units to request. You can choose to set the target capacity in terms of instances or a performance
characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is
maintain
, you can specify a target capacity of 0 and add capacity later.
You can use the On-Demand Instance MaxTotalPrice
parameter, the Spot Instance MaxTotalPrice
, or both to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the
On-Demand Instances and Spot Instances in your request, EC2 Fleet will launch instances until it reaches the maximum
amount that you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops
launching instances even if it hasn’t met the target capacity. The MaxTotalPrice
parameters are located
in OnDemandOptions and
SpotOptions.
Modifier and Type | Class and Description |
---|---|
static interface |
TargetCapacitySpecification.Builder |
Modifier and Type | Method and Description |
---|---|
static TargetCapacitySpecification.Builder |
builder() |
DefaultTargetCapacityType |
defaultTargetCapacityType()
The default
TotalTargetCapacity , which is either Spot or On-Demand . |
String |
defaultTargetCapacityTypeAsString()
The default
TotalTargetCapacity , which is either Spot or On-Demand . |
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
int |
hashCode() |
Integer |
onDemandTargetCapacity()
The number of On-Demand units to request.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends TargetCapacitySpecification.Builder> |
serializableBuilderClass() |
Integer |
spotTargetCapacity()
The maximum number of Spot units to launch.
|
TargetCapacityUnitType |
targetCapacityUnitType()
The unit for the target capacity.
|
String |
targetCapacityUnitTypeAsString()
The unit for the target capacity.
|
TargetCapacitySpecification.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
Integer |
totalTargetCapacity()
The number of units to request, filled using
DefaultTargetCapacityType . |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copy
public final Integer totalTargetCapacity()
The number of units to request, filled using DefaultTargetCapacityType
.
DefaultTargetCapacityType
.public final Integer onDemandTargetCapacity()
The number of On-Demand units to request. If you specify a target capacity for Spot units, you cannot specify a target capacity for On-Demand units.
public final Integer spotTargetCapacity()
The maximum number of Spot units to launch. If you specify a target capacity for On-Demand units, you cannot specify a target capacity for Spot units.
public final DefaultTargetCapacityType defaultTargetCapacityType()
The default TotalTargetCapacity
, which is either Spot
or On-Demand
.
If the service returns an enum value that is not available in the current SDK version,
defaultTargetCapacityType
will return DefaultTargetCapacityType.UNKNOWN_TO_SDK_VERSION
. The raw
value returned by the service is available from defaultTargetCapacityTypeAsString()
.
TotalTargetCapacity
, which is either Spot
or On-Demand
.DefaultTargetCapacityType
public final String defaultTargetCapacityTypeAsString()
The default TotalTargetCapacity
, which is either Spot
or On-Demand
.
If the service returns an enum value that is not available in the current SDK version,
defaultTargetCapacityType
will return DefaultTargetCapacityType.UNKNOWN_TO_SDK_VERSION
. The raw
value returned by the service is available from defaultTargetCapacityTypeAsString()
.
TotalTargetCapacity
, which is either Spot
or On-Demand
.DefaultTargetCapacityType
public final TargetCapacityUnitType targetCapacityUnitType()
The unit for the target capacity. TargetCapacityUnitType
can only be specified when
InstanceRequirements
is specified.
Default: units
(translates to number of instances)
If the service returns an enum value that is not available in the current SDK version,
targetCapacityUnitType
will return TargetCapacityUnitType.UNKNOWN_TO_SDK_VERSION
. The raw value
returned by the service is available from targetCapacityUnitTypeAsString()
.
TargetCapacityUnitType
can only be specified when
InstanceRequirements
is specified.
Default: units
(translates to number of instances)
TargetCapacityUnitType
public final String targetCapacityUnitTypeAsString()
The unit for the target capacity. TargetCapacityUnitType
can only be specified when
InstanceRequirements
is specified.
Default: units
(translates to number of instances)
If the service returns an enum value that is not available in the current SDK version,
targetCapacityUnitType
will return TargetCapacityUnitType.UNKNOWN_TO_SDK_VERSION
. The raw value
returned by the service is available from targetCapacityUnitTypeAsString()
.
TargetCapacityUnitType
can only be specified when
InstanceRequirements
is specified.
Default: units
(translates to number of instances)
TargetCapacityUnitType
public TargetCapacitySpecification.Builder toBuilder()
toBuilder
in interface ToCopyableBuilder<TargetCapacitySpecification.Builder,TargetCapacitySpecification>
public static TargetCapacitySpecification.Builder builder()
public static Class<? extends TargetCapacitySpecification.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields
in interface SdkPojo
public final String toString()
Copyright © 2023. All rights reserved.