Struct aws_sdk_ec2::client::fluent_builders::ModifySpotFleetRequest
source · pub struct ModifySpotFleetRequest { /* private fields */ }
Expand description
Fluent builder constructing a request to ModifySpotFleetRequest
.
Modifies the specified Spot Fleet request.
You can only modify a Spot Fleet request of type maintain
.
While the Spot Fleet request is being modified, it is in the modifying
state.
To scale up your Spot Fleet, increase its target capacity. The Spot Fleet launches the additional Spot Instances according to the allocation strategy for the Spot Fleet request. If the allocation strategy is lowestPrice
, the Spot Fleet launches instances using the Spot Instance pool with the lowest price. If the allocation strategy is diversified
, the Spot Fleet distributes the instances across the Spot Instance pools. If the allocation strategy is capacityOptimized
, Spot Fleet launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
To scale down your Spot Fleet, decrease its target capacity. First, the Spot Fleet cancels any open requests that exceed the new target capacity. You can request that the Spot Fleet terminate Spot Instances until the size of the fleet no longer exceeds the new target capacity. If the allocation strategy is lowestPrice
, the Spot Fleet terminates the instances with the highest price per unit. If the allocation strategy is capacityOptimized
, the Spot Fleet terminates the instances in the Spot Instance pools that have the least available Spot Instance capacity. If the allocation strategy is diversified
, the Spot Fleet terminates instances across the Spot Instance pools. Alternatively, you can request that the Spot Fleet keep the fleet at its current size, but not replace any Spot Instances that are interrupted or that you terminate manually.
If you are finished with your Spot Fleet for now, but will use it again later, you can set the target capacity to 0.
Implementations§
source§impl ModifySpotFleetRequest
impl ModifySpotFleetRequest
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<ModifySpotFleetRequest, AwsResponseRetryClassifier>, SdkError<ModifySpotFleetRequestError>>
pub async fn customize(
self
) -> Result<CustomizableOperation<ModifySpotFleetRequest, AwsResponseRetryClassifier>, SdkError<ModifySpotFleetRequestError>>
Consume this builder, creating a customizable operation that can be modified before being sent. The operation’s inner http::Request can be modified as well.
sourcepub async fn send(
self
) -> Result<ModifySpotFleetRequestOutput, SdkError<ModifySpotFleetRequestError>>
pub async fn send(
self
) -> Result<ModifySpotFleetRequestOutput, SdkError<ModifySpotFleetRequestError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn excess_capacity_termination_policy(
self,
input: ExcessCapacityTerminationPolicy
) -> Self
pub fn excess_capacity_termination_policy(
self,
input: ExcessCapacityTerminationPolicy
) -> Self
Indicates whether running Spot Instances should be terminated if the target capacity of the Spot Fleet request is decreased below the current size of the Spot Fleet.
sourcepub fn set_excess_capacity_termination_policy(
self,
input: Option<ExcessCapacityTerminationPolicy>
) -> Self
pub fn set_excess_capacity_termination_policy(
self,
input: Option<ExcessCapacityTerminationPolicy>
) -> Self
Indicates whether running Spot Instances should be terminated if the target capacity of the Spot Fleet request is decreased below the current size of the Spot Fleet.
sourcepub fn launch_template_configs(self, input: LaunchTemplateConfig) -> Self
pub fn launch_template_configs(self, input: LaunchTemplateConfig) -> Self
Appends an item to LaunchTemplateConfigs
.
To override the contents of this collection use set_launch_template_configs
.
The launch template and overrides. You can only use this parameter if you specified a launch template (LaunchTemplateConfigs
) in your Spot Fleet request. If you specified LaunchSpecifications
in your Spot Fleet request, then omit this parameter.
sourcepub fn set_launch_template_configs(
self,
input: Option<Vec<LaunchTemplateConfig>>
) -> Self
pub fn set_launch_template_configs(
self,
input: Option<Vec<LaunchTemplateConfig>>
) -> Self
The launch template and overrides. You can only use this parameter if you specified a launch template (LaunchTemplateConfigs
) in your Spot Fleet request. If you specified LaunchSpecifications
in your Spot Fleet request, then omit this parameter.
sourcepub fn spot_fleet_request_id(self, input: impl Into<String>) -> Self
pub fn spot_fleet_request_id(self, input: impl Into<String>) -> Self
The ID of the Spot Fleet request.
sourcepub fn set_spot_fleet_request_id(self, input: Option<String>) -> Self
pub fn set_spot_fleet_request_id(self, input: Option<String>) -> Self
The ID of the Spot Fleet request.
sourcepub fn target_capacity(self, input: i32) -> Self
pub fn target_capacity(self, input: i32) -> Self
The size of the fleet.
sourcepub fn set_target_capacity(self, input: Option<i32>) -> Self
pub fn set_target_capacity(self, input: Option<i32>) -> Self
The size of the fleet.
sourcepub fn on_demand_target_capacity(self, input: i32) -> Self
pub fn on_demand_target_capacity(self, input: i32) -> Self
The number of On-Demand Instances in the fleet.
sourcepub fn set_on_demand_target_capacity(self, input: Option<i32>) -> Self
pub fn set_on_demand_target_capacity(self, input: Option<i32>) -> Self
The number of On-Demand Instances in the fleet.
sourcepub fn set_context(self, input: Option<String>) -> Self
pub fn set_context(self, input: Option<String>) -> Self
Reserved.
Trait Implementations§
source§impl Clone for ModifySpotFleetRequest
impl Clone for ModifySpotFleetRequest
source§fn clone(&self) -> ModifySpotFleetRequest
fn clone(&self) -> ModifySpotFleetRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more