aws_sdk_sagemaker/operation/update_cluster/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_cluster::_update_cluster_output::UpdateClusterOutputBuilder;
3
4pub use crate::operation::update_cluster::_update_cluster_input::UpdateClusterInputBuilder;
5
6impl crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
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::update_cluster::UpdateClusterOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_cluster::UpdateClusterError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_cluster();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateCluster`.
24///
25/// <p>Updates a SageMaker HyperPod cluster.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateClusterFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_cluster::builders::UpdateClusterInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_cluster::UpdateClusterOutput,
35        crate::operation::update_cluster::UpdateClusterError,
36    > for UpdateClusterFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_cluster::UpdateClusterOutput,
44            crate::operation::update_cluster::UpdateClusterError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateClusterFluentBuilder {
51    /// Creates a new `UpdateClusterFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateCluster as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_cluster::UpdateClusterOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_cluster::UpdateClusterError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_cluster::UpdateCluster::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_cluster::UpdateCluster::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_cluster::UpdateClusterOutput,
97        crate::operation::update_cluster::UpdateClusterError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
112    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.cluster_name(input.into());
114        self
115    }
116    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
117    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_cluster_name(input);
119        self
120    }
121    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
122    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_cluster_name()
124    }
125    ///
126    /// Appends an item to `InstanceGroups`.
127    ///
128    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
129    ///
130    /// <p>Specify the instance groups to update.</p>
131    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
132        self.inner = self.inner.instance_groups(input);
133        self
134    }
135    /// <p>Specify the instance groups to update.</p>
136    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
137        self.inner = self.inner.set_instance_groups(input);
138        self
139    }
140    /// <p>Specify the instance groups to update.</p>
141    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
142        self.inner.get_instance_groups()
143    }
144    ///
145    /// Appends an item to `RestrictedInstanceGroups`.
146    ///
147    /// To override the contents of this collection use [`set_restricted_instance_groups`](Self::set_restricted_instance_groups).
148    ///
149    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
150    pub fn restricted_instance_groups(mut self, input: crate::types::ClusterRestrictedInstanceGroupSpecification) -> Self {
151        self.inner = self.inner.restricted_instance_groups(input);
152        self
153    }
154    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
155    pub fn set_restricted_instance_groups(
156        mut self,
157        input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>>,
158    ) -> Self {
159        self.inner = self.inner.set_restricted_instance_groups(input);
160        self
161    }
162    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
163    pub fn get_restricted_instance_groups(
164        &self,
165    ) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>> {
166        self.inner.get_restricted_instance_groups()
167    }
168    /// <p>Updates the configuration for managed tier checkpointing on the HyperPod cluster. For example, you can enable or disable the feature and modify the percentage of cluster memory allocated for checkpoint storage.</p>
169    pub fn tiered_storage_config(mut self, input: crate::types::ClusterTieredStorageConfig) -> Self {
170        self.inner = self.inner.tiered_storage_config(input);
171        self
172    }
173    /// <p>Updates the configuration for managed tier checkpointing on the HyperPod cluster. For example, you can enable or disable the feature and modify the percentage of cluster memory allocated for checkpoint storage.</p>
174    pub fn set_tiered_storage_config(mut self, input: ::std::option::Option<crate::types::ClusterTieredStorageConfig>) -> Self {
175        self.inner = self.inner.set_tiered_storage_config(input);
176        self
177    }
178    /// <p>Updates the configuration for managed tier checkpointing on the HyperPod cluster. For example, you can enable or disable the feature and modify the percentage of cluster memory allocated for checkpoint storage.</p>
179    pub fn get_tiered_storage_config(&self) -> &::std::option::Option<crate::types::ClusterTieredStorageConfig> {
180        self.inner.get_tiered_storage_config()
181    }
182    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
183    pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
184        self.inner = self.inner.node_recovery(input);
185        self
186    }
187    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
188    pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
189        self.inner = self.inner.set_node_recovery(input);
190        self
191    }
192    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
193    pub fn get_node_recovery(&self) -> &::std::option::Option<crate::types::ClusterNodeRecovery> {
194        self.inner.get_node_recovery()
195    }
196    ///
197    /// Appends an item to `InstanceGroupsToDelete`.
198    ///
199    /// To override the contents of this collection use [`set_instance_groups_to_delete`](Self::set_instance_groups_to_delete).
200    ///
201    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
202    pub fn instance_groups_to_delete(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        self.inner = self.inner.instance_groups_to_delete(input.into());
204        self
205    }
206    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
207    pub fn set_instance_groups_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
208        self.inner = self.inner.set_instance_groups_to_delete(input);
209        self
210    }
211    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
212    pub fn get_instance_groups_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
213        self.inner.get_instance_groups_to_delete()
214    }
215    /// <p>The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes for cluster autoscaling operations. Cannot be updated while autoscaling is enabled.</p>
216    pub fn cluster_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.inner = self.inner.cluster_role(input.into());
218        self
219    }
220    /// <p>The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes for cluster autoscaling operations. Cannot be updated while autoscaling is enabled.</p>
221    pub fn set_cluster_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.inner = self.inner.set_cluster_role(input);
223        self
224    }
225    /// <p>The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes for cluster autoscaling operations. Cannot be updated while autoscaling is enabled.</p>
226    pub fn get_cluster_role(&self) -> &::std::option::Option<::std::string::String> {
227        self.inner.get_cluster_role()
228    }
229    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
230    pub fn auto_scaling(mut self, input: crate::types::ClusterAutoScalingConfig) -> Self {
231        self.inner = self.inner.auto_scaling(input);
232        self
233    }
234    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
235    pub fn set_auto_scaling(mut self, input: ::std::option::Option<crate::types::ClusterAutoScalingConfig>) -> Self {
236        self.inner = self.inner.set_auto_scaling(input);
237        self
238    }
239    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
240    pub fn get_auto_scaling(&self) -> &::std::option::Option<crate::types::ClusterAutoScalingConfig> {
241        self.inner.get_auto_scaling()
242    }
243}