aws_sdk_sagemaker/operation/batch_reboot_cluster_nodes/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_reboot_cluster_nodes::_batch_reboot_cluster_nodes_output::BatchRebootClusterNodesOutputBuilder;
3
4pub use crate::operation::batch_reboot_cluster_nodes::_batch_reboot_cluster_nodes_input::BatchRebootClusterNodesInputBuilder;
5
6impl crate::operation::batch_reboot_cluster_nodes::builders::BatchRebootClusterNodesInputBuilder {
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_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.batch_reboot_cluster_nodes();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `BatchRebootClusterNodes`.
24///
25/// <p>Reboots specific nodes within a SageMaker HyperPod cluster using a soft recovery mechanism. <code>BatchRebootClusterNodes</code> performs a graceful reboot of the specified nodes by calling the Amazon Elastic Compute Cloud <code>RebootInstances</code> API, which attempts to cleanly shut down the operating system before restarting the instance.</p>
26/// <p>This operation is useful for recovering from transient issues or applying certain configuration changes that require a restart.</p><note>
27/// <ul>
28/// <li>
29/// <p>Rebooting a node may cause temporary service interruption for workloads running on that node. Ensure your workloads can handle node restarts or use appropriate scheduling to minimize impact.</p></li>
30/// <li>
31/// <p>You can reboot up to 25 nodes in a single request.</p></li>
32/// <li>
33/// <p>For SageMaker HyperPod clusters using the Slurm workload manager, ensure rebooting nodes will not disrupt critical cluster operations.</p></li>
34/// </ul>
35/// </note>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct BatchRebootClusterNodesFluentBuilder {
38 handle: ::std::sync::Arc<crate::client::Handle>,
39 inner: crate::operation::batch_reboot_cluster_nodes::builders::BatchRebootClusterNodesInputBuilder,
40 config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43 crate::client::customize::internal::CustomizableSend<
44 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
45 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
46 > for BatchRebootClusterNodesFluentBuilder
47{
48 fn send(
49 self,
50 config_override: crate::config::Builder,
51 ) -> crate::client::customize::internal::BoxFuture<
52 crate::client::customize::internal::SendResult<
53 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
54 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
55 >,
56 > {
57 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58 }
59}
60impl BatchRebootClusterNodesFluentBuilder {
61 /// Creates a new `BatchRebootClusterNodesFluentBuilder`.
62 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63 Self {
64 handle,
65 inner: ::std::default::Default::default(),
66 config_override: ::std::option::Option::None,
67 }
68 }
69 /// Access the BatchRebootClusterNodes as a reference.
70 pub fn as_input(&self) -> &crate::operation::batch_reboot_cluster_nodes::builders::BatchRebootClusterNodesInputBuilder {
71 &self.inner
72 }
73 /// Sends the request and returns the response.
74 ///
75 /// If an error occurs, an `SdkError` will be returned with additional details that
76 /// can be matched against.
77 ///
78 /// By default, any retryable failures will be retried twice. Retry behavior
79 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80 /// set when configuring the client.
81 pub async fn send(
82 self,
83 ) -> ::std::result::Result<
84 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
85 ::aws_smithy_runtime_api::client::result::SdkError<
86 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
87 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88 >,
89 > {
90 let input = self
91 .inner
92 .build()
93 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94 let runtime_plugins = crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodes::operation_runtime_plugins(
95 self.handle.runtime_plugins.clone(),
96 &self.handle.conf,
97 self.config_override,
98 );
99 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodes::orchestrate(&runtime_plugins, input).await
100 }
101
102 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103 pub fn customize(
104 self,
105 ) -> crate::client::customize::CustomizableOperation<
106 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
107 crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
108 Self,
109 > {
110 crate::client::customize::CustomizableOperation::new(self)
111 }
112 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113 self.set_config_override(::std::option::Option::Some(config_override.into()));
114 self
115 }
116
117 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118 self.config_override = config_override;
119 self
120 }
121 /// <p>The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster containing the nodes to reboot.</p>
122 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.inner = self.inner.cluster_name(input.into());
124 self
125 }
126 /// <p>The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster containing the nodes to reboot.</p>
127 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_cluster_name(input);
129 self
130 }
131 /// <p>The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster containing the nodes to reboot.</p>
132 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
133 self.inner.get_cluster_name()
134 }
135 ///
136 /// Appends an item to `NodeIds`.
137 ///
138 /// To override the contents of this collection use [`set_node_ids`](Self::set_node_ids).
139 ///
140 /// <p>A list of EC2 instance IDs to reboot using soft recovery. You can specify between 1 and 25 instance IDs.</p><note>
141 /// <ul>
142 /// <li>
143 /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
144 /// <li>
145 /// <p>Each instance ID must follow the pattern <code>i-</code> followed by 17 hexadecimal characters (for example, <code>i-0123456789abcdef0</code>).</p></li>
146 /// </ul>
147 /// </note>
148 pub fn node_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.inner = self.inner.node_ids(input.into());
150 self
151 }
152 /// <p>A list of EC2 instance IDs to reboot using soft recovery. You can specify between 1 and 25 instance IDs.</p><note>
153 /// <ul>
154 /// <li>
155 /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
156 /// <li>
157 /// <p>Each instance ID must follow the pattern <code>i-</code> followed by 17 hexadecimal characters (for example, <code>i-0123456789abcdef0</code>).</p></li>
158 /// </ul>
159 /// </note>
160 pub fn set_node_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
161 self.inner = self.inner.set_node_ids(input);
162 self
163 }
164 /// <p>A list of EC2 instance IDs to reboot using soft recovery. You can specify between 1 and 25 instance IDs.</p><note>
165 /// <ul>
166 /// <li>
167 /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
168 /// <li>
169 /// <p>Each instance ID must follow the pattern <code>i-</code> followed by 17 hexadecimal characters (for example, <code>i-0123456789abcdef0</code>).</p></li>
170 /// </ul>
171 /// </note>
172 pub fn get_node_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
173 self.inner.get_node_ids()
174 }
175 ///
176 /// Appends an item to `NodeLogicalIds`.
177 ///
178 /// To override the contents of this collection use [`set_node_logical_ids`](Self::set_node_logical_ids).
179 ///
180 /// <p>A list of logical node IDs to reboot using soft recovery. You can specify between 1 and 25 logical node IDs.</p>
181 /// <p>The <code>NodeLogicalId</code> is a unique identifier that persists throughout the node's lifecycle and can be used to track nodes that are still being provisioned and don't yet have an EC2 instance ID assigned.</p><important>
182 /// <ul>
183 /// <li>
184 /// <p>This parameter is only supported for clusters using <code>Continuous</code> as the <code>NodeProvisioningMode</code>. For clusters using the default provisioning mode, use <code>NodeIds</code> instead.</p></li>
185 /// <li>
186 /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
187 /// </ul>
188 /// </important>
189 pub fn node_logical_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.inner = self.inner.node_logical_ids(input.into());
191 self
192 }
193 /// <p>A list of logical node IDs to reboot using soft recovery. You can specify between 1 and 25 logical node IDs.</p>
194 /// <p>The <code>NodeLogicalId</code> is a unique identifier that persists throughout the node's lifecycle and can be used to track nodes that are still being provisioned and don't yet have an EC2 instance ID assigned.</p><important>
195 /// <ul>
196 /// <li>
197 /// <p>This parameter is only supported for clusters using <code>Continuous</code> as the <code>NodeProvisioningMode</code>. For clusters using the default provisioning mode, use <code>NodeIds</code> instead.</p></li>
198 /// <li>
199 /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
200 /// </ul>
201 /// </important>
202 pub fn set_node_logical_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
203 self.inner = self.inner.set_node_logical_ids(input);
204 self
205 }
206 /// <p>A list of logical node IDs to reboot using soft recovery. You can specify between 1 and 25 logical node IDs.</p>
207 /// <p>The <code>NodeLogicalId</code> is a unique identifier that persists throughout the node's lifecycle and can be used to track nodes that are still being provisioned and don't yet have an EC2 instance ID assigned.</p><important>
208 /// <ul>
209 /// <li>
210 /// <p>This parameter is only supported for clusters using <code>Continuous</code> as the <code>NodeProvisioningMode</code>. For clusters using the default provisioning mode, use <code>NodeIds</code> instead.</p></li>
211 /// <li>
212 /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
213 /// </ul>
214 /// </important>
215 pub fn get_node_logical_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
216 self.inner.get_node_logical_ids()
217 }
218}