Class TargetCapacitySpecification
- java.lang.Object
-
- software.amazon.awssdk.services.ec2.model.TargetCapacitySpecification
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<TargetCapacitySpecification.Builder,TargetCapacitySpecification>
@Generated("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
MaxTotalPriceparameter, the Spot InstanceMaxTotalPrice, 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. TheMaxTotalPriceparameters are located in OnDemandOptions and SpotOptions.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTargetCapacitySpecification.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TargetCapacitySpecification.Builderbuilder()DefaultTargetCapacityTypedefaultTargetCapacityType()The defaultTotalTargetCapacity, which is eitherSpotorOn-Demand.StringdefaultTargetCapacityTypeAsString()The defaultTotalTargetCapacity, which is eitherSpotorOn-Demand.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()IntegeronDemandTargetCapacity()The number of On-Demand units to request.List<SdkField<?>>sdkFields()static Class<? extends TargetCapacitySpecification.Builder>serializableBuilderClass()IntegerspotTargetCapacity()The maximum number of Spot units to launch.TargetCapacityUnitTypetargetCapacityUnitType()The unit for the target capacity.StringtargetCapacityUnitTypeAsString()The unit for the target capacity.TargetCapacitySpecification.BuildertoBuilder()StringtoString()Returns a string representation of this object.IntegertotalTargetCapacity()The number of units to request, filled usingDefaultTargetCapacityType.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
totalTargetCapacity
public final Integer totalTargetCapacity()
The number of units to request, filled using
DefaultTargetCapacityType.- Returns:
- The number of units to request, filled using
DefaultTargetCapacityType.
-
onDemandTargetCapacity
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.
- Returns:
- 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.
-
spotTargetCapacity
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.
- Returns:
- 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.
-
defaultTargetCapacityType
public final DefaultTargetCapacityType defaultTargetCapacityType()
The default
TotalTargetCapacity, which is eitherSpotorOn-Demand.If the service returns an enum value that is not available in the current SDK version,
defaultTargetCapacityTypewill returnDefaultTargetCapacityType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromdefaultTargetCapacityTypeAsString().- Returns:
- The default
TotalTargetCapacity, which is eitherSpotorOn-Demand. - See Also:
DefaultTargetCapacityType
-
defaultTargetCapacityTypeAsString
public final String defaultTargetCapacityTypeAsString()
The default
TotalTargetCapacity, which is eitherSpotorOn-Demand.If the service returns an enum value that is not available in the current SDK version,
defaultTargetCapacityTypewill returnDefaultTargetCapacityType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromdefaultTargetCapacityTypeAsString().- Returns:
- The default
TotalTargetCapacity, which is eitherSpotorOn-Demand. - See Also:
DefaultTargetCapacityType
-
targetCapacityUnitType
public final TargetCapacityUnitType targetCapacityUnitType()
The unit for the target capacity.
TargetCapacityUnitTypecan only be specified whenInstanceRequirementsis specified.Default:
units(translates to number of instances)If the service returns an enum value that is not available in the current SDK version,
targetCapacityUnitTypewill returnTargetCapacityUnitType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromtargetCapacityUnitTypeAsString().- Returns:
- The unit for the target capacity.
TargetCapacityUnitTypecan only be specified whenInstanceRequirementsis specified.Default:
units(translates to number of instances) - See Also:
TargetCapacityUnitType
-
targetCapacityUnitTypeAsString
public final String targetCapacityUnitTypeAsString()
The unit for the target capacity.
TargetCapacityUnitTypecan only be specified whenInstanceRequirementsis specified.Default:
units(translates to number of instances)If the service returns an enum value that is not available in the current SDK version,
targetCapacityUnitTypewill returnTargetCapacityUnitType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromtargetCapacityUnitTypeAsString().- Returns:
- The unit for the target capacity.
TargetCapacityUnitTypecan only be specified whenInstanceRequirementsis specified.Default:
units(translates to number of instances) - See Also:
TargetCapacityUnitType
-
toBuilder
public TargetCapacitySpecification.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<TargetCapacitySpecification.Builder,TargetCapacitySpecification>
-
builder
public static TargetCapacitySpecification.Builder builder()
-
serializableBuilderClass
public static Class<? extends TargetCapacitySpecification.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
-