Struct aws_sdk_ec2::input::RequestSpotInstancesInput
source · #[non_exhaustive]pub struct RequestSpotInstancesInput { /* private fields */ }
Expand description
Contains the parameters for RequestSpotInstances.
Implementations§
source§impl RequestSpotInstancesInput
impl RequestSpotInstancesInput
sourcepub async fn make_operation(
&self,
_config: &Config
) -> Result<Operation<RequestSpotInstances, AwsResponseRetryClassifier>, BuildError>
pub async fn make_operation(
&self,
_config: &Config
) -> Result<Operation<RequestSpotInstances, AwsResponseRetryClassifier>, BuildError>
Consumes the builder and constructs an Operation<RequestSpotInstances
>
Examples found in repository?
74549 74550 74551 74552 74553 74554 74555 74556 74557 74558 74559 74560 74561 74562 74563 74564 74565 74566 74567 74568 74569 74570 74571 74572 74573 74574 74575 74576 74577 74578 74579 74580 74581 74582 74583 74584 74585 74586 74587 74588 74589 74590 74591
pub async fn customize(
self,
) -> std::result::Result<
crate::operation::customize::CustomizableOperation<
crate::operation::RequestSpotInstances,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::result::SdkError<crate::error::RequestSpotInstancesError>,
> {
let handle = self.handle.clone();
let operation = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
Ok(crate::operation::customize::CustomizableOperation { handle, operation })
}
/// 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](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::RequestSpotInstancesOutput,
aws_smithy_http::result::SdkError<crate::error::RequestSpotInstancesError>,
> {
let op = self
.inner
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)?
.make_operation(&self.handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)?;
self.handle.client.call(op).await
}
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture RequestSpotInstancesInput
.
source§impl RequestSpotInstancesInput
impl RequestSpotInstancesInput
sourcepub fn availability_zone_group(&self) -> Option<&str>
pub fn availability_zone_group(&self) -> Option<&str>
The user-specified name for a logical grouping of requests.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
sourcepub fn block_duration_minutes(&self) -> Option<i32>
pub fn block_duration_minutes(&self) -> Option<i32>
Deprecated.
sourcepub fn client_token(&self) -> Option<&str>
pub fn client_token(&self) -> Option<&str>
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.
sourcepub fn dry_run(&self) -> Option<bool>
pub fn dry_run(&self) -> Option<bool>
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation
. Otherwise, it is UnauthorizedOperation
.
sourcepub fn instance_count(&self) -> Option<i32>
pub fn instance_count(&self) -> Option<i32>
The maximum number of Spot Instances to launch.
Default: 1
sourcepub fn launch_group(&self) -> Option<&str>
pub fn launch_group(&self) -> Option<&str>
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
Default: Instances are launched and terminated individually
sourcepub fn launch_specification(&self) -> Option<&RequestSpotLaunchSpecification>
pub fn launch_specification(&self) -> Option<&RequestSpotLaunchSpecification>
The launch specification.
sourcepub fn spot_price(&self) -> Option<&str>
pub fn spot_price(&self) -> Option<&str>
The maximum price per unit hour that you are willing to pay for a Spot Instance. 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 instances will be interrupted more frequently than if you do not specify this parameter.
sourcepub fn type(&self) -> Option<&SpotInstanceType>
pub fn type(&self) -> Option<&SpotInstanceType>
The Spot Instance request type.
Default: one-time
sourcepub fn valid_from(&self) -> Option<&DateTime>
pub fn valid_from(&self) -> Option<&DateTime>
The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.
The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
sourcepub fn valid_until(&self) -> Option<&DateTime>
pub fn valid_until(&self) -> Option<&DateTime>
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
-
For a persistent request, the request remains active until the
ValidUntil
date and time is reached. Otherwise, the request remains active until you cancel it. -
For a one-time request, the request remains active until all instances launch, the request is canceled, or the
ValidUntil
date and time is reached. By default, the request is valid for 7 days from the date the request was created.
sourcepub fn tag_specifications(&self) -> Option<&[TagSpecification]>
pub fn tag_specifications(&self) -> Option<&[TagSpecification]>
The key-value pair for tagging the Spot Instance request on creation. The value for ResourceType
must be spot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.
sourcepub fn instance_interruption_behavior(
&self
) -> Option<&InstanceInterruptionBehavior>
pub fn instance_interruption_behavior(
&self
) -> Option<&InstanceInterruptionBehavior>
The behavior when a Spot Instance is interrupted. The default is terminate
.
Trait Implementations§
source§impl Clone for RequestSpotInstancesInput
impl Clone for RequestSpotInstancesInput
source§fn clone(&self) -> RequestSpotInstancesInput
fn clone(&self) -> RequestSpotInstancesInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more