aws_sdk_sagemaker/operation/update_cluster/
_update_cluster_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateClusterInput {
6    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
7    pub cluster_name: ::std::option::Option<::std::string::String>,
8    /// <p>Specify the instance groups to update.</p>
9    pub instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
10    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
11    pub restricted_instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>>,
12    /// <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>
13    pub tiered_storage_config: ::std::option::Option<crate::types::ClusterTieredStorageConfig>,
14    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
15    pub node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
16    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
17    pub instance_groups_to_delete: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18    /// <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>
19    pub cluster_role: ::std::option::Option<::std::string::String>,
20    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
21    pub auto_scaling: ::std::option::Option<crate::types::ClusterAutoScalingConfig>,
22}
23impl UpdateClusterInput {
24    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
25    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
26        self.cluster_name.as_deref()
27    }
28    /// <p>Specify the instance groups to update.</p>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_groups.is_none()`.
31    pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
32        self.instance_groups.as_deref().unwrap_or_default()
33    }
34    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
35    ///
36    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.restricted_instance_groups.is_none()`.
37    pub fn restricted_instance_groups(&self) -> &[crate::types::ClusterRestrictedInstanceGroupSpecification] {
38        self.restricted_instance_groups.as_deref().unwrap_or_default()
39    }
40    /// <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>
41    pub fn tiered_storage_config(&self) -> ::std::option::Option<&crate::types::ClusterTieredStorageConfig> {
42        self.tiered_storage_config.as_ref()
43    }
44    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
45    pub fn node_recovery(&self) -> ::std::option::Option<&crate::types::ClusterNodeRecovery> {
46        self.node_recovery.as_ref()
47    }
48    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_groups_to_delete.is_none()`.
51    pub fn instance_groups_to_delete(&self) -> &[::std::string::String] {
52        self.instance_groups_to_delete.as_deref().unwrap_or_default()
53    }
54    /// <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>
55    pub fn cluster_role(&self) -> ::std::option::Option<&str> {
56        self.cluster_role.as_deref()
57    }
58    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
59    pub fn auto_scaling(&self) -> ::std::option::Option<&crate::types::ClusterAutoScalingConfig> {
60        self.auto_scaling.as_ref()
61    }
62}
63impl UpdateClusterInput {
64    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
65    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
66        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
67    }
68}
69
70/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct UpdateClusterInputBuilder {
74    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
75    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
76    pub(crate) restricted_instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>>,
77    pub(crate) tiered_storage_config: ::std::option::Option<crate::types::ClusterTieredStorageConfig>,
78    pub(crate) node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
79    pub(crate) instance_groups_to_delete: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
80    pub(crate) cluster_role: ::std::option::Option<::std::string::String>,
81    pub(crate) auto_scaling: ::std::option::Option<crate::types::ClusterAutoScalingConfig>,
82}
83impl UpdateClusterInputBuilder {
84    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
85    /// This field is required.
86    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.cluster_name = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
91    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.cluster_name = input;
93        self
94    }
95    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
96    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
97        &self.cluster_name
98    }
99    /// Appends an item to `instance_groups`.
100    ///
101    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
102    ///
103    /// <p>Specify the instance groups to update.</p>
104    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
105        let mut v = self.instance_groups.unwrap_or_default();
106        v.push(input);
107        self.instance_groups = ::std::option::Option::Some(v);
108        self
109    }
110    /// <p>Specify the instance groups to update.</p>
111    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
112        self.instance_groups = input;
113        self
114    }
115    /// <p>Specify the instance groups to update.</p>
116    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
117        &self.instance_groups
118    }
119    /// Appends an item to `restricted_instance_groups`.
120    ///
121    /// To override the contents of this collection use [`set_restricted_instance_groups`](Self::set_restricted_instance_groups).
122    ///
123    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
124    pub fn restricted_instance_groups(mut self, input: crate::types::ClusterRestrictedInstanceGroupSpecification) -> Self {
125        let mut v = self.restricted_instance_groups.unwrap_or_default();
126        v.push(input);
127        self.restricted_instance_groups = ::std::option::Option::Some(v);
128        self
129    }
130    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
131    pub fn set_restricted_instance_groups(
132        mut self,
133        input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>>,
134    ) -> Self {
135        self.restricted_instance_groups = input;
136        self
137    }
138    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
139    pub fn get_restricted_instance_groups(
140        &self,
141    ) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>> {
142        &self.restricted_instance_groups
143    }
144    /// <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>
145    pub fn tiered_storage_config(mut self, input: crate::types::ClusterTieredStorageConfig) -> Self {
146        self.tiered_storage_config = ::std::option::Option::Some(input);
147        self
148    }
149    /// <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>
150    pub fn set_tiered_storage_config(mut self, input: ::std::option::Option<crate::types::ClusterTieredStorageConfig>) -> Self {
151        self.tiered_storage_config = input;
152        self
153    }
154    /// <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>
155    pub fn get_tiered_storage_config(&self) -> &::std::option::Option<crate::types::ClusterTieredStorageConfig> {
156        &self.tiered_storage_config
157    }
158    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
159    pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
160        self.node_recovery = ::std::option::Option::Some(input);
161        self
162    }
163    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
164    pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
165        self.node_recovery = input;
166        self
167    }
168    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
169    pub fn get_node_recovery(&self) -> &::std::option::Option<crate::types::ClusterNodeRecovery> {
170        &self.node_recovery
171    }
172    /// Appends an item to `instance_groups_to_delete`.
173    ///
174    /// To override the contents of this collection use [`set_instance_groups_to_delete`](Self::set_instance_groups_to_delete).
175    ///
176    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
177    pub fn instance_groups_to_delete(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        let mut v = self.instance_groups_to_delete.unwrap_or_default();
179        v.push(input.into());
180        self.instance_groups_to_delete = ::std::option::Option::Some(v);
181        self
182    }
183    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
184    pub fn set_instance_groups_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
185        self.instance_groups_to_delete = input;
186        self
187    }
188    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
189    pub fn get_instance_groups_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
190        &self.instance_groups_to_delete
191    }
192    /// <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>
193    pub fn cluster_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.cluster_role = ::std::option::Option::Some(input.into());
195        self
196    }
197    /// <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>
198    pub fn set_cluster_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.cluster_role = input;
200        self
201    }
202    /// <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>
203    pub fn get_cluster_role(&self) -> &::std::option::Option<::std::string::String> {
204        &self.cluster_role
205    }
206    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
207    pub fn auto_scaling(mut self, input: crate::types::ClusterAutoScalingConfig) -> Self {
208        self.auto_scaling = ::std::option::Option::Some(input);
209        self
210    }
211    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
212    pub fn set_auto_scaling(mut self, input: ::std::option::Option<crate::types::ClusterAutoScalingConfig>) -> Self {
213        self.auto_scaling = input;
214        self
215    }
216    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
217    pub fn get_auto_scaling(&self) -> &::std::option::Option<crate::types::ClusterAutoScalingConfig> {
218        &self.auto_scaling
219    }
220    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
221    pub fn build(
222        self,
223    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
224        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
225            cluster_name: self.cluster_name,
226            instance_groups: self.instance_groups,
227            restricted_instance_groups: self.restricted_instance_groups,
228            tiered_storage_config: self.tiered_storage_config,
229            node_recovery: self.node_recovery,
230            instance_groups_to_delete: self.instance_groups_to_delete,
231            cluster_role: self.cluster_role,
232            auto_scaling: self.auto_scaling,
233        })
234    }
235}