Struct aws_sdk_ec2::model::TargetCapacitySpecification
source · #[non_exhaustive]pub struct TargetCapacitySpecification { /* private fields */ }
Expand description
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.
Implementations§
source§impl TargetCapacitySpecification
impl TargetCapacitySpecification
sourcepub fn total_target_capacity(&self) -> Option<i32>
pub fn total_target_capacity(&self) -> Option<i32>
The number of units to request, filled using DefaultTargetCapacityType
.
sourcepub fn on_demand_target_capacity(&self) -> Option<i32>
pub fn on_demand_target_capacity(&self) -> Option<i32>
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.
sourcepub fn spot_target_capacity(&self) -> Option<i32>
pub fn spot_target_capacity(&self) -> Option<i32>
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.
sourcepub fn default_target_capacity_type(&self) -> Option<&DefaultTargetCapacityType>
pub fn default_target_capacity_type(&self) -> Option<&DefaultTargetCapacityType>
The default TotalTargetCapacity
, which is either Spot
or On-Demand
.
sourcepub fn target_capacity_unit_type(&self) -> Option<&TargetCapacityUnitType>
pub fn target_capacity_unit_type(&self) -> Option<&TargetCapacityUnitType>
The unit for the target capacity.
Default: units
(translates to number of instances)
source§impl TargetCapacitySpecification
impl TargetCapacitySpecification
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture TargetCapacitySpecification
.
Examples found in repository?
58515 58516 58517 58518 58519 58520 58521 58522 58523 58524 58525 58526 58527 58528 58529 58530 58531 58532 58533 58534 58535 58536 58537 58538 58539 58540 58541 58542 58543 58544 58545 58546 58547 58548 58549 58550 58551 58552 58553 58554 58555 58556 58557 58558 58559 58560 58561 58562 58563 58564 58565 58566 58567 58568 58569 58570 58571 58572 58573 58574 58575 58576 58577 58578 58579 58580 58581 58582 58583 58584 58585 58586 58587 58588 58589 58590 58591 58592 58593 58594 58595 58596 58597 58598 58599
pub fn deser_structure_crate_model_target_capacity_specification(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::TargetCapacitySpecification, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::TargetCapacitySpecification::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("totalTargetCapacity") /* TotalTargetCapacity com.amazonaws.ec2#TargetCapacitySpecification$TotalTargetCapacity */ => {
let var_2848 =
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_total_target_capacity(var_2848);
}
,
s if s.matches("onDemandTargetCapacity") /* OnDemandTargetCapacity com.amazonaws.ec2#TargetCapacitySpecification$OnDemandTargetCapacity */ => {
let var_2849 =
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_on_demand_target_capacity(var_2849);
}
,
s if s.matches("spotTargetCapacity") /* SpotTargetCapacity com.amazonaws.ec2#TargetCapacitySpecification$SpotTargetCapacity */ => {
let var_2850 =
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_spot_target_capacity(var_2850);
}
,
s if s.matches("defaultTargetCapacityType") /* DefaultTargetCapacityType com.amazonaws.ec2#TargetCapacitySpecification$DefaultTargetCapacityType */ => {
let var_2851 =
Some(
Result::<crate::model::DefaultTargetCapacityType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::DefaultTargetCapacityType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_default_target_capacity_type(var_2851);
}
,
s if s.matches("targetCapacityUnitType") /* TargetCapacityUnitType com.amazonaws.ec2#TargetCapacitySpecification$TargetCapacityUnitType */ => {
let var_2852 =
Some(
Result::<crate::model::TargetCapacityUnitType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::TargetCapacityUnitType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_target_capacity_unit_type(var_2852);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for TargetCapacitySpecification
impl Clone for TargetCapacitySpecification
source§fn clone(&self) -> TargetCapacitySpecification
fn clone(&self) -> TargetCapacitySpecification
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more