aws_sdk_sagemaker/operation/batch_delete_cluster_nodes/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_delete_cluster_nodes::_batch_delete_cluster_nodes_output::BatchDeleteClusterNodesOutputBuilder;
3
4pub use crate::operation::batch_delete_cluster_nodes::_batch_delete_cluster_nodes_input::BatchDeleteClusterNodesInputBuilder;
5
6impl crate::operation::batch_delete_cluster_nodes::builders::BatchDeleteClusterNodesInputBuilder {
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::batch_delete_cluster_nodes::BatchDeleteClusterNodesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.batch_delete_cluster_nodes();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `BatchDeleteClusterNodes`.
24///
25/// <p>Deletes specific nodes within a SageMaker HyperPod cluster. <code>BatchDeleteClusterNodes</code> accepts a cluster name and a list of node IDs.</p><important>
26/// <ul>
27/// <li>
28/// <p>To safeguard your work, back up your data to Amazon S3 or an FSx for Lustre file system before invoking the API on a worker node group. This will help prevent any potential data loss from the instance root volume. For more information about backup, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate-cli-command.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software-backup">Use the backup script provided by SageMaker HyperPod</a>.</p></li>
29/// <li>
30/// <p>If you want to invoke this API on an existing cluster, you'll first need to patch the cluster by running the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateClusterSoftware.html">UpdateClusterSoftware API</a>. For more information about patching a cluster, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate-cli-command.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software">Update the SageMaker HyperPod platform software of a cluster</a>.</p></li>
31/// </ul>
32/// </important>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct BatchDeleteClusterNodesFluentBuilder {
35 handle: ::std::sync::Arc<crate::client::Handle>,
36 inner: crate::operation::batch_delete_cluster_nodes::builders::BatchDeleteClusterNodesInputBuilder,
37 config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40 crate::client::customize::internal::CustomizableSend<
41 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesOutput,
42 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesError,
43 > for BatchDeleteClusterNodesFluentBuilder
44{
45 fn send(
46 self,
47 config_override: crate::config::Builder,
48 ) -> crate::client::customize::internal::BoxFuture<
49 crate::client::customize::internal::SendResult<
50 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesOutput,
51 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesError,
52 >,
53 > {
54 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55 }
56}
57impl BatchDeleteClusterNodesFluentBuilder {
58 /// Creates a new `BatchDeleteClusterNodesFluentBuilder`.
59 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60 Self {
61 handle,
62 inner: ::std::default::Default::default(),
63 config_override: ::std::option::Option::None,
64 }
65 }
66 /// Access the BatchDeleteClusterNodes as a reference.
67 pub fn as_input(&self) -> &crate::operation::batch_delete_cluster_nodes::builders::BatchDeleteClusterNodesInputBuilder {
68 &self.inner
69 }
70 /// Sends the request and returns the response.
71 ///
72 /// If an error occurs, an `SdkError` will be returned with additional details that
73 /// can be matched against.
74 ///
75 /// By default, any retryable failures will be retried twice. Retry behavior
76 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77 /// set when configuring the client.
78 pub async fn send(
79 self,
80 ) -> ::std::result::Result<
81 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesOutput,
82 ::aws_smithy_runtime_api::client::result::SdkError<
83 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesError,
84 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85 >,
86 > {
87 let input = self
88 .inner
89 .build()
90 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91 let runtime_plugins = crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodes::operation_runtime_plugins(
92 self.handle.runtime_plugins.clone(),
93 &self.handle.conf,
94 self.config_override,
95 );
96 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodes::orchestrate(&runtime_plugins, input).await
97 }
98
99 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100 pub fn customize(
101 self,
102 ) -> crate::client::customize::CustomizableOperation<
103 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesOutput,
104 crate::operation::batch_delete_cluster_nodes::BatchDeleteClusterNodesError,
105 Self,
106 > {
107 crate::client::customize::CustomizableOperation::new(self)
108 }
109 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110 self.set_config_override(::std::option::Option::Some(config_override.into()));
111 self
112 }
113
114 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115 self.config_override = config_override;
116 self
117 }
118 /// <p>The name of the SageMaker HyperPod cluster from which to delete the specified nodes.</p>
119 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.inner = self.inner.cluster_name(input.into());
121 self
122 }
123 /// <p>The name of the SageMaker HyperPod cluster from which to delete the specified nodes.</p>
124 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.inner = self.inner.set_cluster_name(input);
126 self
127 }
128 /// <p>The name of the SageMaker HyperPod cluster from which to delete the specified nodes.</p>
129 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
130 self.inner.get_cluster_name()
131 }
132 ///
133 /// Appends an item to `NodeIds`.
134 ///
135 /// To override the contents of this collection use [`set_node_ids`](Self::set_node_ids).
136 ///
137 /// <p>A list of node IDs to be deleted from the specified cluster.</p><note>
138 /// <ul>
139 /// <li>
140 /// <p>For SageMaker HyperPod clusters using the Slurm workload manager, you cannot remove instances that are configured as Slurm controller nodes.</p></li>
141 /// <li>
142 /// <p>If you need to delete more than 99 instances, contact <a href="http://aws.amazon.com/contact-us/">Support</a> for assistance.</p></li>
143 /// </ul>
144 /// </note>
145 pub fn node_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.node_ids(input.into());
147 self
148 }
149 /// <p>A list of node IDs to be deleted from the specified cluster.</p><note>
150 /// <ul>
151 /// <li>
152 /// <p>For SageMaker HyperPod clusters using the Slurm workload manager, you cannot remove instances that are configured as Slurm controller nodes.</p></li>
153 /// <li>
154 /// <p>If you need to delete more than 99 instances, contact <a href="http://aws.amazon.com/contact-us/">Support</a> for assistance.</p></li>
155 /// </ul>
156 /// </note>
157 pub fn set_node_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158 self.inner = self.inner.set_node_ids(input);
159 self
160 }
161 /// <p>A list of node IDs to be deleted from the specified cluster.</p><note>
162 /// <ul>
163 /// <li>
164 /// <p>For SageMaker HyperPod clusters using the Slurm workload manager, you cannot remove instances that are configured as Slurm controller nodes.</p></li>
165 /// <li>
166 /// <p>If you need to delete more than 99 instances, contact <a href="http://aws.amazon.com/contact-us/">Support</a> for assistance.</p></li>
167 /// </ul>
168 /// </note>
169 pub fn get_node_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
170 self.inner.get_node_ids()
171 }
172 ///
173 /// Appends an item to `NodeLogicalIds`.
174 ///
175 /// To override the contents of this collection use [`set_node_logical_ids`](Self::set_node_logical_ids).
176 ///
177 /// <p>A list of <code>NodeLogicalIds</code> identifying the nodes to be deleted. You can specify up to 50 <code>NodeLogicalIds</code>. You must specify either <code>NodeLogicalIds</code>, <code>InstanceIds</code>, or both, with a combined maximum of 50 identifiers.</p>
178 pub fn node_logical_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.inner = self.inner.node_logical_ids(input.into());
180 self
181 }
182 /// <p>A list of <code>NodeLogicalIds</code> identifying the nodes to be deleted. You can specify up to 50 <code>NodeLogicalIds</code>. You must specify either <code>NodeLogicalIds</code>, <code>InstanceIds</code>, or both, with a combined maximum of 50 identifiers.</p>
183 pub fn set_node_logical_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
184 self.inner = self.inner.set_node_logical_ids(input);
185 self
186 }
187 /// <p>A list of <code>NodeLogicalIds</code> identifying the nodes to be deleted. You can specify up to 50 <code>NodeLogicalIds</code>. You must specify either <code>NodeLogicalIds</code>, <code>InstanceIds</code>, or both, with a combined maximum of 50 identifiers.</p>
188 pub fn get_node_logical_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
189 self.inner.get_node_logical_ids()
190 }
191}