#[non_exhaustive]pub struct LaunchTemplateSpotMarketOptions { /* private fields */ }
Expand description
The options for Spot Instances.
Implementations§
source§impl LaunchTemplateSpotMarketOptions
impl LaunchTemplateSpotMarketOptions
sourcepub fn max_price(&self) -> Option<&str>
pub fn max_price(&self) -> Option<&str>
The maximum hourly price you're willing to pay for the Spot Instances. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.
If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.
sourcepub fn spot_instance_type(&self) -> Option<&SpotInstanceType>
pub fn spot_instance_type(&self) -> Option<&SpotInstanceType>
The Spot Instance request type.
sourcepub fn block_duration_minutes(&self) -> Option<i32>
pub fn block_duration_minutes(&self) -> Option<i32>
The required duration for the Spot Instances (also known as Spot blocks), in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
sourcepub fn valid_until(&self) -> Option<&DateTime>
pub fn valid_until(&self) -> Option<&DateTime>
The end date of the request. For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
sourcepub fn instance_interruption_behavior(
&self
) -> Option<&InstanceInterruptionBehavior>
pub fn instance_interruption_behavior(
&self
) -> Option<&InstanceInterruptionBehavior>
The behavior when a Spot Instance is interrupted.
source§impl LaunchTemplateSpotMarketOptions
impl LaunchTemplateSpotMarketOptions
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture LaunchTemplateSpotMarketOptions
.
Examples found in repository?
61690 61691 61692 61693 61694 61695 61696 61697 61698 61699 61700 61701 61702 61703 61704 61705 61706 61707 61708 61709 61710 61711 61712 61713 61714 61715 61716 61717 61718 61719 61720 61721 61722 61723 61724 61725 61726 61727 61728 61729 61730 61731 61732 61733 61734 61735 61736 61737 61738 61739 61740 61741 61742 61743 61744 61745 61746 61747 61748 61749 61750 61751 61752 61753 61754 61755 61756 61757 61758 61759 61760 61761 61762 61763 61764 61765 61766 61767 61768 61769 61770 61771
pub fn deser_structure_crate_model_launch_template_spot_market_options(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::LaunchTemplateSpotMarketOptions, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::LaunchTemplateSpotMarketOptions::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("maxPrice") /* MaxPrice com.amazonaws.ec2#LaunchTemplateSpotMarketOptions$MaxPrice */ => {
let var_3017 =
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_price(var_3017);
}
,
s if s.matches("spotInstanceType") /* SpotInstanceType com.amazonaws.ec2#LaunchTemplateSpotMarketOptions$SpotInstanceType */ => {
let var_3018 =
Some(
Result::<crate::model::SpotInstanceType, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::SpotInstanceType::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_spot_instance_type(var_3018);
}
,
s if s.matches("blockDurationMinutes") /* BlockDurationMinutes com.amazonaws.ec2#LaunchTemplateSpotMarketOptions$BlockDurationMinutes */ => {
let var_3019 =
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_block_duration_minutes(var_3019);
}
,
s if s.matches("validUntil") /* ValidUntil com.amazonaws.ec2#LaunchTemplateSpotMarketOptions$ValidUntil */ => {
let var_3020 =
Some(
aws_smithy_types::DateTime::from_str(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
, aws_smithy_types::date_time::Format::DateTime
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (timestamp: `com.amazonaws.ec2#DateTime`)"))
?
)
;
builder = builder.set_valid_until(var_3020);
}
,
s if s.matches("instanceInterruptionBehavior") /* InstanceInterruptionBehavior com.amazonaws.ec2#LaunchTemplateSpotMarketOptions$InstanceInterruptionBehavior */ => {
let var_3021 =
Some(
Result::<crate::model::InstanceInterruptionBehavior, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceInterruptionBehavior::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_instance_interruption_behavior(var_3021);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for LaunchTemplateSpotMarketOptions
impl Clone for LaunchTemplateSpotMarketOptions
source§fn clone(&self) -> LaunchTemplateSpotMarketOptions
fn clone(&self) -> LaunchTemplateSpotMarketOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more