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>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>
28/// <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>
29/// <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>
30/// <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>
31/// </note> <important>
32/// <p>The data in a deleted file system is also deleted and can't be recovered by any means.</p>
33/// </important>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct DeleteFileSystemFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::delete_file_system::builders::DeleteFileSystemInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::delete_file_system::DeleteFileSystemOutput,
43        crate::operation::delete_file_system::DeleteFileSystemError,
44    > for DeleteFileSystemFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::delete_file_system::DeleteFileSystemOutput,
52            crate::operation::delete_file_system::DeleteFileSystemError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl DeleteFileSystemFluentBuilder {
59    /// Creates a new `DeleteFileSystemFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the DeleteFileSystem as a reference.
68    pub fn as_input(&self) -> &crate::operation::delete_file_system::builders::DeleteFileSystemInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::delete_file_system::DeleteFileSystemOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::delete_file_system::DeleteFileSystemError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::delete_file_system::DeleteFileSystem::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::delete_file_system::DeleteFileSystem::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::delete_file_system::DeleteFileSystemOutput,
105        crate::operation::delete_file_system::DeleteFileSystemError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The ID of the file system that you want to delete.</p>
120    pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.file_system_id(input.into());
122        self
123    }
124    /// <p>The ID of the file system that you want to delete.</p>
125    pub fn set_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_file_system_id(input);
127        self
128    }
129    /// <p>The ID of the file system that you want to delete.</p>
130    pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_file_system_id()
132    }
133    /// <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>
134    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.client_request_token(input.into());
136        self
137    }
138    /// <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>
139    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_client_request_token(input);
141        self
142    }
143    /// <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>
144    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_client_request_token()
146    }
147    /// <p>The configuration object for the Microsoft Windows file system used in the <code>DeleteFileSystem</code> operation.</p>
148    pub fn windows_configuration(mut self, input: crate::types::DeleteFileSystemWindowsConfiguration) -> Self {
149        self.inner = self.inner.windows_configuration(input);
150        self
151    }
152    /// <p>The configuration object for the Microsoft Windows file system used in the <code>DeleteFileSystem</code> operation.</p>
153    pub fn set_windows_configuration(mut self, input: ::std::option::Option<crate::types::DeleteFileSystemWindowsConfiguration>) -> Self {
154        self.inner = self.inner.set_windows_configuration(input);
155        self
156    }
157    /// <p>The configuration object for the Microsoft Windows file system used in the <code>DeleteFileSystem</code> operation.</p>
158    pub fn get_windows_configuration(&self) -> &::std::option::Option<crate::types::DeleteFileSystemWindowsConfiguration> {
159        self.inner.get_windows_configuration()
160    }
161    /// <p>The configuration object for the Amazon FSx for Lustre file system being deleted in the <code>DeleteFileSystem</code> operation.</p>
162    pub fn lustre_configuration(mut self, input: crate::types::DeleteFileSystemLustreConfiguration) -> Self {
163        self.inner = self.inner.lustre_configuration(input);
164        self
165    }
166    /// <p>The configuration object for the Amazon FSx for Lustre file system being deleted in the <code>DeleteFileSystem</code> operation.</p>
167    pub fn set_lustre_configuration(mut self, input: ::std::option::Option<crate::types::DeleteFileSystemLustreConfiguration>) -> Self {
168        self.inner = self.inner.set_lustre_configuration(input);
169        self
170    }
171    /// <p>The configuration object for the Amazon FSx for Lustre file system being deleted in the <code>DeleteFileSystem</code> operation.</p>
172    pub fn get_lustre_configuration(&self) -> &::std::option::Option<crate::types::DeleteFileSystemLustreConfiguration> {
173        self.inner.get_lustre_configuration()
174    }
175    /// <p>The configuration object for the OpenZFS file system used in the <code>DeleteFileSystem</code> operation.</p>
176    pub fn open_zfs_configuration(mut self, input: crate::types::DeleteFileSystemOpenZfsConfiguration) -> Self {
177        self.inner = self.inner.open_zfs_configuration(input);
178        self
179    }
180    /// <p>The configuration object for the OpenZFS file system used in the <code>DeleteFileSystem</code> operation.</p>
181    pub fn set_open_zfs_configuration(mut self, input: ::std::option::Option<crate::types::DeleteFileSystemOpenZfsConfiguration>) -> Self {
182        self.inner = self.inner.set_open_zfs_configuration(input);
183        self
184    }
185    /// <p>The configuration object for the OpenZFS file system used in the <code>DeleteFileSystem</code> operation.</p>
186    pub fn get_open_zfs_configuration(&self) -> &::std::option::Option<crate::types::DeleteFileSystemOpenZfsConfiguration> {
187        self.inner.get_open_zfs_configuration()
188    }
189}