aws_sdk_ec2/operation/delete_fleets/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_fleets::_delete_fleets_output::DeleteFleetsOutputBuilder;
3
4pub use crate::operation::delete_fleets::_delete_fleets_input::DeleteFleetsInputBuilder;
5
6impl crate::operation::delete_fleets::builders::DeleteFleetsInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::delete_fleets::DeleteFleetsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_fleets::DeleteFleetsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_fleets();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteFleets`.
24///
25/// <p>Deletes the specified EC2 Fleet request.</p>
26/// <p>After you delete an EC2 Fleet request, it launches no new instances.</p>
27/// <p>You must also specify whether a deleted EC2 Fleet request should terminate its instances. If you choose to terminate the instances, the EC2 Fleet request enters the <code>deleted_terminating</code> state. Otherwise, it enters the <code>deleted_running</code> state, and the instances continue to run until they are interrupted or you terminate them manually.</p>
28/// <p>A deleted <code>instant</code> fleet with running instances is not supported. When you delete an <code>instant</code> fleet, Amazon EC2 automatically terminates all its instances. For fleets with more than 1000 instances, the deletion request might fail. If your fleet has more than 1000 instances, first terminate most of the instances manually, leaving 1000 or fewer. Then delete the fleet, and the remaining instances will be terminated automatically.</p><important>
29/// <p><b>Terminating an instance is permanent and irreversible.</b></p>
30/// <p>After you terminate an instance, you can no longer connect to it, and it can't be recovered. All attached Amazon EBS volumes that are configured to be deleted on termination are also permanently deleted and can't be recovered. All data stored on instance store volumes is permanently lost. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-ec2-instance-termination-works.html"> How instance termination works</a>.</p>
31/// <p>Before you terminate an instance, ensure that you have backed up all data that you need to retain after the termination to persistent storage.</p>
32/// </important>
33/// <p class="title"><b>Restrictions</b></p>
34/// <ul>
35/// <li>
36/// <p>You can delete up to 25 fleets of type <code>instant</code> in a single request.</p></li>
37/// <li>
38/// <p>You can delete up to 100 fleets of type <code>maintain</code> or <code>request</code> in a single request.</p></li>
39/// <li>
40/// <p>You can delete up to 125 fleets in a single request, provided you do not exceed the quota for each fleet type, as specified above.</p></li>
41/// <li>
42/// <p>If you exceed the specified number of fleets to delete, no fleets are deleted.</p></li>
43/// </ul>
44/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/delete-fleet.html">Delete an EC2 Fleet request and the instances in the fleet</a> in the <i>Amazon EC2 User Guide</i>.</p>
45#[derive(::std::clone::Clone, ::std::fmt::Debug)]
46pub struct DeleteFleetsFluentBuilder {
47 handle: ::std::sync::Arc<crate::client::Handle>,
48 inner: crate::operation::delete_fleets::builders::DeleteFleetsInputBuilder,
49 config_override: ::std::option::Option<crate::config::Builder>,
50}
51impl
52 crate::client::customize::internal::CustomizableSend<
53 crate::operation::delete_fleets::DeleteFleetsOutput,
54 crate::operation::delete_fleets::DeleteFleetsError,
55 > for DeleteFleetsFluentBuilder
56{
57 fn send(
58 self,
59 config_override: crate::config::Builder,
60 ) -> crate::client::customize::internal::BoxFuture<
61 crate::client::customize::internal::SendResult<
62 crate::operation::delete_fleets::DeleteFleetsOutput,
63 crate::operation::delete_fleets::DeleteFleetsError,
64 >,
65 > {
66 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67 }
68}
69impl DeleteFleetsFluentBuilder {
70 /// Creates a new `DeleteFleetsFluentBuilder`.
71 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72 Self {
73 handle,
74 inner: ::std::default::Default::default(),
75 config_override: ::std::option::Option::None,
76 }
77 }
78 /// Access the DeleteFleets as a reference.
79 pub fn as_input(&self) -> &crate::operation::delete_fleets::builders::DeleteFleetsInputBuilder {
80 &self.inner
81 }
82 /// Sends the request and returns the response.
83 ///
84 /// If an error occurs, an `SdkError` will be returned with additional details that
85 /// can be matched against.
86 ///
87 /// By default, any retryable failures will be retried twice. Retry behavior
88 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89 /// set when configuring the client.
90 pub async fn send(
91 self,
92 ) -> ::std::result::Result<
93 crate::operation::delete_fleets::DeleteFleetsOutput,
94 ::aws_smithy_runtime_api::client::result::SdkError<
95 crate::operation::delete_fleets::DeleteFleetsError,
96 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97 >,
98 > {
99 let input = self
100 .inner
101 .build()
102 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103 let runtime_plugins = crate::operation::delete_fleets::DeleteFleets::operation_runtime_plugins(
104 self.handle.runtime_plugins.clone(),
105 &self.handle.conf,
106 self.config_override,
107 );
108 crate::operation::delete_fleets::DeleteFleets::orchestrate(&runtime_plugins, input).await
109 }
110
111 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112 pub fn customize(
113 self,
114 ) -> crate::client::customize::CustomizableOperation<
115 crate::operation::delete_fleets::DeleteFleetsOutput,
116 crate::operation::delete_fleets::DeleteFleetsError,
117 Self,
118 > {
119 crate::client::customize::CustomizableOperation::new(self)
120 }
121 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122 self.set_config_override(::std::option::Option::Some(config_override.into()));
123 self
124 }
125
126 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127 self.config_override = config_override;
128 self
129 }
130 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
131 pub fn dry_run(mut self, input: bool) -> Self {
132 self.inner = self.inner.dry_run(input);
133 self
134 }
135 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
136 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
137 self.inner = self.inner.set_dry_run(input);
138 self
139 }
140 /// <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
141 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
142 self.inner.get_dry_run()
143 }
144 ///
145 /// Appends an item to `FleetIds`.
146 ///
147 /// To override the contents of this collection use [`set_fleet_ids`](Self::set_fleet_ids).
148 ///
149 /// <p>The IDs of the EC2 Fleets.</p>
150 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
151 pub fn fleet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.inner = self.inner.fleet_ids(input.into());
153 self
154 }
155 /// <p>The IDs of the EC2 Fleets.</p>
156 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
157 pub fn set_fleet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158 self.inner = self.inner.set_fleet_ids(input);
159 self
160 }
161 /// <p>The IDs of the EC2 Fleets.</p>
162 /// <p>Constraints: In a single request, you can specify up to 25 <code>instant</code> fleet IDs and up to 100 <code>maintain</code> or <code>request</code> fleet IDs.</p>
163 pub fn get_fleet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
164 self.inner.get_fleet_ids()
165 }
166 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
167 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
168 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
169 pub fn terminate_instances(mut self, input: bool) -> Self {
170 self.inner = self.inner.terminate_instances(input);
171 self
172 }
173 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
174 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
175 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
176 pub fn set_terminate_instances(mut self, input: ::std::option::Option<bool>) -> Self {
177 self.inner = self.inner.set_terminate_instances(input);
178 self
179 }
180 /// <p>Indicates whether to terminate the associated instances when the EC2 Fleet is deleted. The default is to terminate the instances.</p>
181 /// <p>To let the instances continue to run after the EC2 Fleet is deleted, specify <code>no-terminate-instances</code>. Supported only for fleets of type <code>maintain</code> and <code>request</code>.</p>
182 /// <p>For <code>instant</code> fleets, you cannot specify <code>NoTerminateInstances</code>. A deleted <code>instant</code> fleet with running instances is not supported.</p>
183 pub fn get_terminate_instances(&self) -> &::std::option::Option<bool> {
184 self.inner.get_terminate_instances()
185 }
186}