Struct aws_sdk_ec2::model::OnDemandOptions
source · #[non_exhaustive]pub struct OnDemandOptions { /* private fields */ }
Expand description
Describes the configuration of On-Demand Instances in an EC2 Fleet.
Implementations§
source§impl OnDemandOptions
impl OnDemandOptions
sourcepub fn allocation_strategy(&self) -> Option<&FleetOnDemandAllocationStrategy>
pub fn allocation_strategy(&self) -> Option<&FleetOnDemandAllocationStrategy>
The strategy that determines the order of the launch template overrides to use in fulfilling On-Demand capacity.
lowest-price
- EC2 Fleet uses price to determine the order, launching the lowest price first.
prioritized
- EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first.
Default: lowest-price
sourcepub fn capacity_reservation_options(
&self
) -> Option<&CapacityReservationOptions>
pub fn capacity_reservation_options(
&self
) -> Option<&CapacityReservationOptions>
The strategy for using unused Capacity Reservations for fulfilling On-Demand capacity.
Supported only for fleets of type instant
.
sourcepub fn single_instance_type(&self) -> Option<bool>
pub fn single_instance_type(&self) -> Option<bool>
Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet.
Supported only for fleets of type instant
.
sourcepub fn single_availability_zone(&self) -> Option<bool>
pub fn single_availability_zone(&self) -> Option<bool>
Indicates that the fleet launches all On-Demand Instances into a single Availability Zone.
Supported only for fleets of type instant
.
sourcepub fn min_target_capacity(&self) -> Option<i32>
pub fn min_target_capacity(&self) -> Option<i32>
The minimum target capacity for On-Demand Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.
Supported only for fleets of type instant
.
At least one of the following must be specified: SingleAvailabilityZone
| SingleInstanceType
sourcepub fn max_total_price(&self) -> Option<&str>
pub fn max_total_price(&self) -> Option<&str>
The maximum amount per hour for On-Demand Instances that you're willing to pay.
source§impl OnDemandOptions
impl OnDemandOptions
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture OnDemandOptions
.
Examples found in repository?
58725 58726 58727 58728 58729 58730 58731 58732 58733 58734 58735 58736 58737 58738 58739 58740 58741 58742 58743 58744 58745 58746 58747 58748 58749 58750 58751 58752 58753 58754 58755 58756 58757 58758 58759 58760 58761 58762 58763 58764 58765 58766 58767 58768 58769 58770 58771 58772 58773 58774 58775 58776 58777 58778 58779 58780 58781 58782 58783 58784 58785 58786 58787 58788 58789 58790 58791 58792 58793 58794 58795 58796 58797 58798 58799 58800 58801 58802 58803 58804 58805 58806 58807 58808 58809 58810 58811 58812 58813 58814 58815 58816 58817 58818
pub fn deser_structure_crate_model_on_demand_options(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::OnDemandOptions, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::OnDemandOptions::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("allocationStrategy") /* AllocationStrategy com.amazonaws.ec2#OnDemandOptions$AllocationStrategy */ => {
let var_2861 =
Some(
Result::<crate::model::FleetOnDemandAllocationStrategy, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::FleetOnDemandAllocationStrategy::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_allocation_strategy(var_2861);
}
,
s if s.matches("capacityReservationOptions") /* CapacityReservationOptions com.amazonaws.ec2#OnDemandOptions$CapacityReservationOptions */ => {
let var_2862 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_options(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_options(var_2862);
}
,
s if s.matches("singleInstanceType") /* SingleInstanceType com.amazonaws.ec2#OnDemandOptions$SingleInstanceType */ => {
let var_2863 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
}
?
)
;
builder = builder.set_single_instance_type(var_2863);
}
,
s if s.matches("singleAvailabilityZone") /* SingleAvailabilityZone com.amazonaws.ec2#OnDemandOptions$SingleAvailabilityZone */ => {
let var_2864 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
}
?
)
;
builder = builder.set_single_availability_zone(var_2864);
}
,
s if s.matches("minTargetCapacity") /* MinTargetCapacity com.amazonaws.ec2#OnDemandOptions$MinTargetCapacity */ => {
let var_2865 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
}
?
)
;
builder = builder.set_min_target_capacity(var_2865);
}
,
s if s.matches("maxTotalPrice") /* MaxTotalPrice com.amazonaws.ec2#OnDemandOptions$MaxTotalPrice */ => {
let var_2866 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_max_total_price(var_2866);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for OnDemandOptions
impl Clone for OnDemandOptions
source§fn clone(&self) -> OnDemandOptions
fn clone(&self) -> OnDemandOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more