aws_sdk_fsx/operation/delete_file_system/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_file_system::_delete_file_system_output::DeleteFileSystemOutputBuilder;
3
4pub use crate::operation::delete_file_system::_delete_file_system_input::DeleteFileSystemInputBuilder;
5
6impl crate::operation::delete_file_system::builders::DeleteFileSystemInputBuilder {
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_file_system::DeleteFileSystemOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_file_system::DeleteFileSystemError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_file_system();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteFileSystem`.
24///
25/// <p>Deletes a file system. After deletion, the file system no longer exists, and its data is gone. Any existing automatic backups and snapshots are also deleted.</p>
26/// <p>To delete an Amazon FSx for NetApp ONTAP file system, first delete all the volumes and storage virtual machines (SVMs) on the file system. Then provide a <code>FileSystemId</code> value to the <code>DeleteFileSystem</code> operation.</p>
27/// <p>Before deleting an Amazon FSx for OpenZFS file system, make sure that there aren't any Amazon S3 access points attached to any volume. For more information on how to list S3 access points that are attached to volumes, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/access-points-list.html">Listing S3 access point attachments</a>. For more information on how to delete S3 access points, see <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/delete-access-point.html">Deleting an S3 access point attachment</a>.</p>
28/// <p>By default, when you delete an Amazon FSx for Windows File Server file system, a final backup is created upon deletion. This final backup isn't subject to the file system's retention policy, and must be manually deleted.</p>
29/// <p>To delete an Amazon FSx for Lustre file system, first <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/unmounting-fs.html">unmount</a> it from every connected Amazon EC2 instance, then provide a <code>FileSystemId</code> value to the <code>DeleteFileSystem</code> operation. By default, Amazon FSx will not take a final backup when the <code>DeleteFileSystem</code> operation is invoked. On file systems not linked to an Amazon S3 bucket, set <code>SkipFinalBackup</code> to <code>false</code> to take a final backup of the file system you are deleting. Backups cannot be enabled on S3-linked file systems. To ensure all of your data is written back to S3 before deleting your file system, you can either monitor for the <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/monitoring-cloudwatch.html#auto-import-export-metrics">AgeOfOldestQueuedMessage</a> metric to be zero (if using automatic export) or you can run an <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/export-data-repo-task-dra.html">export data repository task</a>. If you have automatic export enabled and want to use an export data repository task, you have to disable automatic export before executing the export data repository task.</p>
30/// <p>The <code>DeleteFileSystem</code> operation returns while the file system has the <code>DELETING</code> status. You can check the file system deletion status by calling the <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileSystems.html">DescribeFileSystems</a> operation, which returns a list of file systems in your account. If you pass the file system ID for a deleted file system, the <code>DescribeFileSystems</code> operation returns a <code>FileSystemNotFound</code> error.</p><note>
31/// <p>If a data repository task is in a <code>PENDING</code> or <code>EXECUTING</code> state, deleting an Amazon FSx for Lustre file system will fail with an HTTP status code 400 (Bad Request).</p>
32/// </note> <important>
33/// <p>The data in a deleted file system is also deleted and can't be recovered by any means.</p>
34/// </important>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct DeleteFileSystemFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::delete_file_system::builders::DeleteFileSystemInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::delete_file_system::DeleteFileSystemOutput,
44        crate::operation::delete_file_system::DeleteFileSystemError,
45    > for DeleteFileSystemFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::delete_file_system::DeleteFileSystemOutput,
53            crate::operation::delete_file_system::DeleteFileSystemError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl DeleteFileSystemFluentBuilder {
60    /// Creates a new `DeleteFileSystemFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the DeleteFileSystem as a reference.
69    pub fn as_input(&self) -> &crate::operation::delete_file_system::builders::DeleteFileSystemInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::delete_file_system::DeleteFileSystemOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::delete_file_system::DeleteFileSystemError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::delete_file_system::DeleteFileSystem::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::delete_file_system::DeleteFileSystem::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::delete_file_system::DeleteFileSystemOutput,
106        crate::operation::delete_file_system::DeleteFileSystemError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The ID of the file system that you want to delete.</p>
121    pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.file_system_id(input.into());
123        self
124    }
125    /// <p>The ID of the file system that you want to delete.</p>
126    pub fn set_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_file_system_id(input);
128        self
129    }
130    /// <p>The ID of the file system that you want to delete.</p>
131    pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_file_system_id()
133    }
134    /// <p>A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent deletion. This token is automatically filled on your behalf when using the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
135    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.client_request_token(input.into());
137        self
138    }
139    /// <p>A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent deletion. This token is automatically filled on your behalf when using the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
140    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_client_request_token(input);
142        self
143    }
144    /// <p>A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent deletion. This token is automatically filled on your behalf when using the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
145    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_client_request_token()
147    }
148    /// <p>The configuration object for the Microsoft Windows file system used in the <code>DeleteFileSystem</code> operation.</p>
149    pub fn windows_configuration(mut self, input: crate::types::DeleteFileSystemWindowsConfiguration) -> Self {
150        self.inner = self.inner.windows_configuration(input);
151        self
152    }
153    /// <p>The configuration object for the Microsoft Windows file system used in the <code>DeleteFileSystem</code> operation.</p>
154    pub fn set_windows_configuration(mut self, input: ::std::option::Option<crate::types::DeleteFileSystemWindowsConfiguration>) -> Self {
155        self.inner = self.inner.set_windows_configuration(input);
156        self
157    }
158    /// <p>The configuration object for the Microsoft Windows file system used in the <code>DeleteFileSystem</code> operation.</p>
159    pub fn get_windows_configuration(&self) -> &::std::option::Option<crate::types::DeleteFileSystemWindowsConfiguration> {
160        self.inner.get_windows_configuration()
161    }
162    /// <p>The configuration object for the Amazon FSx for Lustre file system being deleted in the <code>DeleteFileSystem</code> operation.</p>
163    pub fn lustre_configuration(mut self, input: crate::types::DeleteFileSystemLustreConfiguration) -> Self {
164        self.inner = self.inner.lustre_configuration(input);
165        self
166    }
167    /// <p>The configuration object for the Amazon FSx for Lustre file system being deleted in the <code>DeleteFileSystem</code> operation.</p>
168    pub fn set_lustre_configuration(mut self, input: ::std::option::Option<crate::types::DeleteFileSystemLustreConfiguration>) -> Self {
169        self.inner = self.inner.set_lustre_configuration(input);
170        self
171    }
172    /// <p>The configuration object for the Amazon FSx for Lustre file system being deleted in the <code>DeleteFileSystem</code> operation.</p>
173    pub fn get_lustre_configuration(&self) -> &::std::option::Option<crate::types::DeleteFileSystemLustreConfiguration> {
174        self.inner.get_lustre_configuration()
175    }
176    /// <p>The configuration object for the OpenZFS file system used in the <code>DeleteFileSystem</code> operation.</p>
177    pub fn open_zfs_configuration(mut self, input: crate::types::DeleteFileSystemOpenZfsConfiguration) -> Self {
178        self.inner = self.inner.open_zfs_configuration(input);
179        self
180    }
181    /// <p>The configuration object for the OpenZFS file system used in the <code>DeleteFileSystem</code> operation.</p>
182    pub fn set_open_zfs_configuration(mut self, input: ::std::option::Option<crate::types::DeleteFileSystemOpenZfsConfiguration>) -> Self {
183        self.inner = self.inner.set_open_zfs_configuration(input);
184        self
185    }
186    /// <p>The configuration object for the OpenZFS file system used in the <code>DeleteFileSystem</code> operation.</p>
187    pub fn get_open_zfs_configuration(&self) -> &::std::option::Option<crate::types::DeleteFileSystemOpenZfsConfiguration> {
188        self.inner.get_open_zfs_configuration()
189    }
190}