aws_sdk_fsx/operation/create_data_repository_task/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_data_repository_task::_create_data_repository_task_output::CreateDataRepositoryTaskOutputBuilder;
3
4pub use crate::operation::create_data_repository_task::_create_data_repository_task_input::CreateDataRepositoryTaskInputBuilder;
5
6impl crate::operation::create_data_repository_task::builders::CreateDataRepositoryTaskInputBuilder {
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::create_data_repository_task::CreateDataRepositoryTaskOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_data_repository_task::CreateDataRepositoryTaskError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_data_repository_task();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDataRepositoryTask`.
24///
25/// <p>Creates an Amazon FSx for Lustre data repository task. A <code>CreateDataRepositoryTask</code> operation will fail if a data repository is not linked to the FSx file system.</p>
26/// <p>You use import and export data repository tasks to perform bulk operations between your FSx for Lustre file system and its linked data repositories. An example of a data repository task is exporting any data and metadata changes, including POSIX metadata, to files, directories, and symbolic links (symlinks) from your FSx file system to a linked data repository.</p>
27/// <p>You use release data repository tasks to release data from your file system for files that are exported to S3. The metadata of released files remains on the file system so users or applications can still access released files by reading the files again, which will restore data from Amazon S3 to the FSx for Lustre file system.</p>
28/// <p>To learn more about data repository tasks, see <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/data-repository-tasks.html">Data Repository Tasks</a>. To learn more about linking a data repository to your file system, see <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/create-dra-linked-data-repo.html">Linking your file system to an S3 bucket</a>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateDataRepositoryTaskFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_data_repository_task::builders::CreateDataRepositoryTaskInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_data_repository_task::CreateDataRepositoryTaskOutput,
38 crate::operation::create_data_repository_task::CreateDataRepositoryTaskError,
39 > for CreateDataRepositoryTaskFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_data_repository_task::CreateDataRepositoryTaskOutput,
47 crate::operation::create_data_repository_task::CreateDataRepositoryTaskError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateDataRepositoryTaskFluentBuilder {
54 /// Creates a new `CreateDataRepositoryTaskFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateDataRepositoryTask as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_data_repository_task::builders::CreateDataRepositoryTaskInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_data_repository_task::CreateDataRepositoryTaskOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_data_repository_task::CreateDataRepositoryTaskError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_data_repository_task::CreateDataRepositoryTask::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_data_repository_task::CreateDataRepositoryTask::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_data_repository_task::CreateDataRepositoryTaskOutput,
100 crate::operation::create_data_repository_task::CreateDataRepositoryTaskError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>Specifies the type of data repository task to create.</p>
115 /// <ul>
116 /// <li>
117 /// <p><code>EXPORT_TO_REPOSITORY</code> tasks export from your Amazon FSx for Lustre file system to a linked data repository.</p></li>
118 /// <li>
119 /// <p><code>IMPORT_METADATA_FROM_REPOSITORY</code> tasks import metadata changes from a linked S3 bucket to your Amazon FSx for Lustre file system.</p></li>
120 /// <li>
121 /// <p><code>RELEASE_DATA_FROM_FILESYSTEM</code> tasks release files in your Amazon FSx for Lustre file system that have been exported to a linked S3 bucket and that meet your specified release criteria.</p></li>
122 /// <li>
123 /// <p><code>AUTO_RELEASE_DATA</code> tasks automatically release files from an Amazon File Cache resource.</p></li>
124 /// </ul>
125 pub fn r#type(mut self, input: crate::types::DataRepositoryTaskType) -> Self {
126 self.inner = self.inner.r#type(input);
127 self
128 }
129 /// <p>Specifies the type of data repository task to create.</p>
130 /// <ul>
131 /// <li>
132 /// <p><code>EXPORT_TO_REPOSITORY</code> tasks export from your Amazon FSx for Lustre file system to a linked data repository.</p></li>
133 /// <li>
134 /// <p><code>IMPORT_METADATA_FROM_REPOSITORY</code> tasks import metadata changes from a linked S3 bucket to your Amazon FSx for Lustre file system.</p></li>
135 /// <li>
136 /// <p><code>RELEASE_DATA_FROM_FILESYSTEM</code> tasks release files in your Amazon FSx for Lustre file system that have been exported to a linked S3 bucket and that meet your specified release criteria.</p></li>
137 /// <li>
138 /// <p><code>AUTO_RELEASE_DATA</code> tasks automatically release files from an Amazon File Cache resource.</p></li>
139 /// </ul>
140 pub fn set_type(mut self, input: ::std::option::Option<crate::types::DataRepositoryTaskType>) -> Self {
141 self.inner = self.inner.set_type(input);
142 self
143 }
144 /// <p>Specifies the type of data repository task to create.</p>
145 /// <ul>
146 /// <li>
147 /// <p><code>EXPORT_TO_REPOSITORY</code> tasks export from your Amazon FSx for Lustre file system to a linked data repository.</p></li>
148 /// <li>
149 /// <p><code>IMPORT_METADATA_FROM_REPOSITORY</code> tasks import metadata changes from a linked S3 bucket to your Amazon FSx for Lustre file system.</p></li>
150 /// <li>
151 /// <p><code>RELEASE_DATA_FROM_FILESYSTEM</code> tasks release files in your Amazon FSx for Lustre file system that have been exported to a linked S3 bucket and that meet your specified release criteria.</p></li>
152 /// <li>
153 /// <p><code>AUTO_RELEASE_DATA</code> tasks automatically release files from an Amazon File Cache resource.</p></li>
154 /// </ul>
155 pub fn get_type(&self) -> &::std::option::Option<crate::types::DataRepositoryTaskType> {
156 self.inner.get_type()
157 }
158 ///
159 /// Appends an item to `Paths`.
160 ///
161 /// To override the contents of this collection use [`set_paths`](Self::set_paths).
162 ///
163 /// <p>A list of paths for the data repository task to use when the task is processed. If a path that you provide isn't valid, the task fails. If you don't provide paths, the default behavior is to export all files to S3 (for export tasks), import all files from S3 (for import tasks), or release all exported files that meet the last accessed time criteria (for release tasks).</p>
164 /// <ul>
165 /// <li>
166 /// <p>For export tasks, the list contains paths on the FSx for Lustre file system from which the files are exported to the Amazon S3 bucket. The default path is the file system root directory. The paths you provide need to be relative to the mount point of the file system. If the mount point is <code>/mnt/fsx</code> and <code>/mnt/fsx/path1</code> is a directory or file on the file system you want to export, then the path to provide is <code>path1</code>.</p></li>
167 /// <li>
168 /// <p>For import tasks, the list contains paths in the Amazon S3 bucket from which POSIX metadata changes are imported to the FSx for Lustre file system. The path can be an S3 bucket or prefix in the format <code>s3://bucket-name/prefix</code> (where <code>prefix</code> is optional).</p></li>
169 /// <li>
170 /// <p>For release tasks, the list contains directory or file paths on the FSx for Lustre file system from which to release exported files. If a directory is specified, files within the directory are released. If a file path is specified, only that file is released. To release all exported files in the file system, specify a forward slash (/) as the path.</p><note>
171 /// <p>A file must also meet the last accessed time criteria specified in for the file to be released.</p>
172 /// </note></li>
173 /// </ul>
174 pub fn paths(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.inner = self.inner.paths(input.into());
176 self
177 }
178 /// <p>A list of paths for the data repository task to use when the task is processed. If a path that you provide isn't valid, the task fails. If you don't provide paths, the default behavior is to export all files to S3 (for export tasks), import all files from S3 (for import tasks), or release all exported files that meet the last accessed time criteria (for release tasks).</p>
179 /// <ul>
180 /// <li>
181 /// <p>For export tasks, the list contains paths on the FSx for Lustre file system from which the files are exported to the Amazon S3 bucket. The default path is the file system root directory. The paths you provide need to be relative to the mount point of the file system. If the mount point is <code>/mnt/fsx</code> and <code>/mnt/fsx/path1</code> is a directory or file on the file system you want to export, then the path to provide is <code>path1</code>.</p></li>
182 /// <li>
183 /// <p>For import tasks, the list contains paths in the Amazon S3 bucket from which POSIX metadata changes are imported to the FSx for Lustre file system. The path can be an S3 bucket or prefix in the format <code>s3://bucket-name/prefix</code> (where <code>prefix</code> is optional).</p></li>
184 /// <li>
185 /// <p>For release tasks, the list contains directory or file paths on the FSx for Lustre file system from which to release exported files. If a directory is specified, files within the directory are released. If a file path is specified, only that file is released. To release all exported files in the file system, specify a forward slash (/) as the path.</p><note>
186 /// <p>A file must also meet the last accessed time criteria specified in for the file to be released.</p>
187 /// </note></li>
188 /// </ul>
189 pub fn set_paths(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
190 self.inner = self.inner.set_paths(input);
191 self
192 }
193 /// <p>A list of paths for the data repository task to use when the task is processed. If a path that you provide isn't valid, the task fails. If you don't provide paths, the default behavior is to export all files to S3 (for export tasks), import all files from S3 (for import tasks), or release all exported files that meet the last accessed time criteria (for release tasks).</p>
194 /// <ul>
195 /// <li>
196 /// <p>For export tasks, the list contains paths on the FSx for Lustre file system from which the files are exported to the Amazon S3 bucket. The default path is the file system root directory. The paths you provide need to be relative to the mount point of the file system. If the mount point is <code>/mnt/fsx</code> and <code>/mnt/fsx/path1</code> is a directory or file on the file system you want to export, then the path to provide is <code>path1</code>.</p></li>
197 /// <li>
198 /// <p>For import tasks, the list contains paths in the Amazon S3 bucket from which POSIX metadata changes are imported to the FSx for Lustre file system. The path can be an S3 bucket or prefix in the format <code>s3://bucket-name/prefix</code> (where <code>prefix</code> is optional).</p></li>
199 /// <li>
200 /// <p>For release tasks, the list contains directory or file paths on the FSx for Lustre file system from which to release exported files. If a directory is specified, files within the directory are released. If a file path is specified, only that file is released. To release all exported files in the file system, specify a forward slash (/) as the path.</p><note>
201 /// <p>A file must also meet the last accessed time criteria specified in for the file to be released.</p>
202 /// </note></li>
203 /// </ul>
204 pub fn get_paths(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
205 self.inner.get_paths()
206 }
207 /// <p>The globally unique ID of the file system, assigned by Amazon FSx.</p>
208 pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209 self.inner = self.inner.file_system_id(input.into());
210 self
211 }
212 /// <p>The globally unique ID of the file system, assigned by Amazon FSx.</p>
213 pub fn set_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214 self.inner = self.inner.set_file_system_id(input);
215 self
216 }
217 /// <p>The globally unique ID of the file system, assigned by Amazon FSx.</p>
218 pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
219 self.inner.get_file_system_id()
220 }
221 /// <p>Defines whether or not Amazon FSx provides a CompletionReport once the task has completed. A CompletionReport provides a detailed report on the files that Amazon FSx processed that meet the criteria specified by the <code>Scope</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/task-completion-report.html">Working with Task Completion Reports</a>.</p>
222 pub fn report(mut self, input: crate::types::CompletionReport) -> Self {
223 self.inner = self.inner.report(input);
224 self
225 }
226 /// <p>Defines whether or not Amazon FSx provides a CompletionReport once the task has completed. A CompletionReport provides a detailed report on the files that Amazon FSx processed that meet the criteria specified by the <code>Scope</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/task-completion-report.html">Working with Task Completion Reports</a>.</p>
227 pub fn set_report(mut self, input: ::std::option::Option<crate::types::CompletionReport>) -> Self {
228 self.inner = self.inner.set_report(input);
229 self
230 }
231 /// <p>Defines whether or not Amazon FSx provides a CompletionReport once the task has completed. A CompletionReport provides a detailed report on the files that Amazon FSx processed that meet the criteria specified by the <code>Scope</code> parameter. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/task-completion-report.html">Working with Task Completion Reports</a>.</p>
232 pub fn get_report(&self) -> &::std::option::Option<crate::types::CompletionReport> {
233 self.inner.get_report()
234 }
235 /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
236 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
237 self.inner = self.inner.client_request_token(input.into());
238 self
239 }
240 /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
241 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242 self.inner = self.inner.set_client_request_token(input);
243 self
244 }
245 /// <p>(Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
246 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
247 self.inner.get_client_request_token()
248 }
249 ///
250 /// Appends an item to `Tags`.
251 ///
252 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
253 ///
254 /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
255 pub fn tags(mut self, input: crate::types::Tag) -> Self {
256 self.inner = self.inner.tags(input);
257 self
258 }
259 /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
260 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
261 self.inner = self.inner.set_tags(input);
262 self
263 }
264 /// <p>A list of <code>Tag</code> values, with a maximum of 50 elements.</p>
265 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
266 self.inner.get_tags()
267 }
268 /// <p>Specifies the amount of data to release, in GiB, by an Amazon File Cache <code>AUTO_RELEASE_DATA</code> task that automatically releases files from the cache.</p>
269 pub fn capacity_to_release(mut self, input: i64) -> Self {
270 self.inner = self.inner.capacity_to_release(input);
271 self
272 }
273 /// <p>Specifies the amount of data to release, in GiB, by an Amazon File Cache <code>AUTO_RELEASE_DATA</code> task that automatically releases files from the cache.</p>
274 pub fn set_capacity_to_release(mut self, input: ::std::option::Option<i64>) -> Self {
275 self.inner = self.inner.set_capacity_to_release(input);
276 self
277 }
278 /// <p>Specifies the amount of data to release, in GiB, by an Amazon File Cache <code>AUTO_RELEASE_DATA</code> task that automatically releases files from the cache.</p>
279 pub fn get_capacity_to_release(&self) -> &::std::option::Option<i64> {
280 self.inner.get_capacity_to_release()
281 }
282 /// <p>The configuration that specifies the last accessed time criteria for files that will be released from an Amazon FSx for Lustre file system.</p>
283 pub fn release_configuration(mut self, input: crate::types::ReleaseConfiguration) -> Self {
284 self.inner = self.inner.release_configuration(input);
285 self
286 }
287 /// <p>The configuration that specifies the last accessed time criteria for files that will be released from an Amazon FSx for Lustre file system.</p>
288 pub fn set_release_configuration(mut self, input: ::std::option::Option<crate::types::ReleaseConfiguration>) -> Self {
289 self.inner = self.inner.set_release_configuration(input);
290 self
291 }
292 /// <p>The configuration that specifies the last accessed time criteria for files that will be released from an Amazon FSx for Lustre file system.</p>
293 pub fn get_release_configuration(&self) -> &::std::option::Option<crate::types::ReleaseConfiguration> {
294 self.inner.get_release_configuration()
295 }
296}