Class CapacityReservationSpecification
- java.lang.Object
-
- software.amazon.awssdk.services.ec2.model.CapacityReservationSpecification
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<CapacityReservationSpecification.Builder,CapacityReservationSpecification>
@Generated("software.amazon.awssdk:codegen") public final class CapacityReservationSpecification extends Object implements SdkPojo, Serializable, ToCopyableBuilder<CapacityReservationSpecification.Builder,CapacityReservationSpecification>
Describes an instance's Capacity Reservation targeting option.
Use the
CapacityReservationPreference
parameter to configure the instance to run as an On-Demand Instance, to run in anyopen
Capacity Reservation that has matching attributes, or to run only in a Capacity Reservation or Capacity Reservation group. Use theCapacityReservationTarget
parameter to explicitly target a specific Capacity Reservation or a Capacity Reservation group.You can only specify
CapacityReservationPreference
andCapacityReservationTarget
if theCapacityReservationPreference
iscapacity-reservations-only
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CapacityReservationSpecification.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CapacityReservationSpecification.Builder
builder()
CapacityReservationPreference
capacityReservationPreference()
Indicates the instance's Capacity Reservation preferences.String
capacityReservationPreferenceAsString()
Indicates the instance's Capacity Reservation preferences.CapacityReservationTarget
capacityReservationTarget()
Information about the target Capacity Reservation or Capacity Reservation group.boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
int
hashCode()
Map<String,SdkField<?>>
sdkFieldNameToField()
List<SdkField<?>>
sdkFields()
static Class<? extends CapacityReservationSpecification.Builder>
serializableBuilderClass()
CapacityReservationSpecification.Builder
toBuilder()
String
toString()
Returns a string representation of this object.-
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
-
capacityReservationPreference
public final CapacityReservationPreference capacityReservationPreference()
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
-
capacity-reservations-only
- The instance will only run in a Capacity Reservation or Capacity Reservation group. If capacity isn't available, the instance will fail to launch. -
open
- The instance can run in anyopen
Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy). If capacity isn't available, the instance runs as an On-Demand Instance. -
none
- The instance doesn't run in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
If the service returns an enum value that is not available in the current SDK version,
capacityReservationPreference
will returnCapacityReservationPreference.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromcapacityReservationPreferenceAsString()
.- Returns:
- Indicates the instance's Capacity Reservation preferences. Possible preferences include:
-
capacity-reservations-only
- The instance will only run in a Capacity Reservation or Capacity Reservation group. If capacity isn't available, the instance will fail to launch. -
open
- The instance can run in anyopen
Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy). If capacity isn't available, the instance runs as an On-Demand Instance. -
none
- The instance doesn't run in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
-
- See Also:
CapacityReservationPreference
-
-
capacityReservationPreferenceAsString
public final String capacityReservationPreferenceAsString()
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
-
capacity-reservations-only
- The instance will only run in a Capacity Reservation or Capacity Reservation group. If capacity isn't available, the instance will fail to launch. -
open
- The instance can run in anyopen
Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy). If capacity isn't available, the instance runs as an On-Demand Instance. -
none
- The instance doesn't run in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
If the service returns an enum value that is not available in the current SDK version,
capacityReservationPreference
will returnCapacityReservationPreference.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromcapacityReservationPreferenceAsString()
.- Returns:
- Indicates the instance's Capacity Reservation preferences. Possible preferences include:
-
capacity-reservations-only
- The instance will only run in a Capacity Reservation or Capacity Reservation group. If capacity isn't available, the instance will fail to launch. -
open
- The instance can run in anyopen
Capacity Reservation that has matching attributes (instance type, platform, Availability Zone, and tenancy). If capacity isn't available, the instance runs as an On-Demand Instance. -
none
- The instance doesn't run in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
-
- See Also:
CapacityReservationPreference
-
-
capacityReservationTarget
public final CapacityReservationTarget capacityReservationTarget()
Information about the target Capacity Reservation or Capacity Reservation group.
- Returns:
- Information about the target Capacity Reservation or Capacity Reservation group.
-
toBuilder
public CapacityReservationSpecification.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<CapacityReservationSpecification.Builder,CapacityReservationSpecification>
-
builder
public static CapacityReservationSpecification.Builder builder()
-
serializableBuilderClass
public static Class<? extends CapacityReservationSpecification.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in 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.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToField
in interfaceSdkPojo
-
-