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>Determines how instance provisioning is handled during cluster operations. In <code>Continuous</code> mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use <code>CurrentCount</code> and <code>TargetCount</code> in <code>DescribeCluster</code> to track provisioning progress.</p>
19    pub node_provisioning_mode: ::std::option::Option<crate::types::ClusterNodeProvisioningMode>,
20    /// <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>
21    pub cluster_role: ::std::option::Option<::std::string::String>,
22    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
23    pub auto_scaling: ::std::option::Option<crate::types::ClusterAutoScalingConfig>,
24}
25impl UpdateClusterInput {
26    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
27    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
28        self.cluster_name.as_deref()
29    }
30    /// <p>Specify the instance groups to update.</p>
31    ///
32    /// 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()`.
33    pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
34        self.instance_groups.as_deref().unwrap_or_default()
35    }
36    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
37    ///
38    /// 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()`.
39    pub fn restricted_instance_groups(&self) -> &[crate::types::ClusterRestrictedInstanceGroupSpecification] {
40        self.restricted_instance_groups.as_deref().unwrap_or_default()
41    }
42    /// <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>
43    pub fn tiered_storage_config(&self) -> ::std::option::Option<&crate::types::ClusterTieredStorageConfig> {
44        self.tiered_storage_config.as_ref()
45    }
46    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
47    pub fn node_recovery(&self) -> ::std::option::Option<&crate::types::ClusterNodeRecovery> {
48        self.node_recovery.as_ref()
49    }
50    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
51    ///
52    /// 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()`.
53    pub fn instance_groups_to_delete(&self) -> &[::std::string::String] {
54        self.instance_groups_to_delete.as_deref().unwrap_or_default()
55    }
56    /// <p>Determines how instance provisioning is handled during cluster operations. In <code>Continuous</code> mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use <code>CurrentCount</code> and <code>TargetCount</code> in <code>DescribeCluster</code> to track provisioning progress.</p>
57    pub fn node_provisioning_mode(&self) -> ::std::option::Option<&crate::types::ClusterNodeProvisioningMode> {
58        self.node_provisioning_mode.as_ref()
59    }
60    /// <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>
61    pub fn cluster_role(&self) -> ::std::option::Option<&str> {
62        self.cluster_role.as_deref()
63    }
64    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
65    pub fn auto_scaling(&self) -> ::std::option::Option<&crate::types::ClusterAutoScalingConfig> {
66        self.auto_scaling.as_ref()
67    }
68}
69impl UpdateClusterInput {
70    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
71    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
72        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
73    }
74}
75
76/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
77#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
78#[non_exhaustive]
79pub struct UpdateClusterInputBuilder {
80    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
81    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
82    pub(crate) restricted_instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>>,
83    pub(crate) tiered_storage_config: ::std::option::Option<crate::types::ClusterTieredStorageConfig>,
84    pub(crate) node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
85    pub(crate) instance_groups_to_delete: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
86    pub(crate) node_provisioning_mode: ::std::option::Option<crate::types::ClusterNodeProvisioningMode>,
87    pub(crate) cluster_role: ::std::option::Option<::std::string::String>,
88    pub(crate) auto_scaling: ::std::option::Option<crate::types::ClusterAutoScalingConfig>,
89}
90impl UpdateClusterInputBuilder {
91    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
92    /// This field is required.
93    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.cluster_name = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
98    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.cluster_name = input;
100        self
101    }
102    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
103    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
104        &self.cluster_name
105    }
106    /// Appends an item to `instance_groups`.
107    ///
108    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
109    ///
110    /// <p>Specify the instance groups to update.</p>
111    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
112        let mut v = self.instance_groups.unwrap_or_default();
113        v.push(input);
114        self.instance_groups = ::std::option::Option::Some(v);
115        self
116    }
117    /// <p>Specify the instance groups to update.</p>
118    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
119        self.instance_groups = input;
120        self
121    }
122    /// <p>Specify the instance groups to update.</p>
123    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
124        &self.instance_groups
125    }
126    /// Appends an item to `restricted_instance_groups`.
127    ///
128    /// To override the contents of this collection use [`set_restricted_instance_groups`](Self::set_restricted_instance_groups).
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 restricted_instance_groups(mut self, input: crate::types::ClusterRestrictedInstanceGroupSpecification) -> Self {
132        let mut v = self.restricted_instance_groups.unwrap_or_default();
133        v.push(input);
134        self.restricted_instance_groups = ::std::option::Option::Some(v);
135        self
136    }
137    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
138    pub fn set_restricted_instance_groups(
139        mut self,
140        input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>>,
141    ) -> Self {
142        self.restricted_instance_groups = input;
143        self
144    }
145    /// <p>The specialized instance groups for training models like Amazon Nova to be created in the SageMaker HyperPod cluster.</p>
146    pub fn get_restricted_instance_groups(
147        &self,
148    ) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterRestrictedInstanceGroupSpecification>> {
149        &self.restricted_instance_groups
150    }
151    /// <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>
152    pub fn tiered_storage_config(mut self, input: crate::types::ClusterTieredStorageConfig) -> Self {
153        self.tiered_storage_config = ::std::option::Option::Some(input);
154        self
155    }
156    /// <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>
157    pub fn set_tiered_storage_config(mut self, input: ::std::option::Option<crate::types::ClusterTieredStorageConfig>) -> Self {
158        self.tiered_storage_config = input;
159        self
160    }
161    /// <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>
162    pub fn get_tiered_storage_config(&self) -> &::std::option::Option<crate::types::ClusterTieredStorageConfig> {
163        &self.tiered_storage_config
164    }
165    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
166    pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
167        self.node_recovery = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
171    pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
172        self.node_recovery = input;
173        self
174    }
175    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
176    pub fn get_node_recovery(&self) -> &::std::option::Option<crate::types::ClusterNodeRecovery> {
177        &self.node_recovery
178    }
179    /// Appends an item to `instance_groups_to_delete`.
180    ///
181    /// To override the contents of this collection use [`set_instance_groups_to_delete`](Self::set_instance_groups_to_delete).
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 instance_groups_to_delete(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        let mut v = self.instance_groups_to_delete.unwrap_or_default();
186        v.push(input.into());
187        self.instance_groups_to_delete = ::std::option::Option::Some(v);
188        self
189    }
190    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
191    pub fn set_instance_groups_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
192        self.instance_groups_to_delete = input;
193        self
194    }
195    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
196    pub fn get_instance_groups_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
197        &self.instance_groups_to_delete
198    }
199    /// <p>Determines how instance provisioning is handled during cluster operations. In <code>Continuous</code> mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use <code>CurrentCount</code> and <code>TargetCount</code> in <code>DescribeCluster</code> to track provisioning progress.</p>
200    pub fn node_provisioning_mode(mut self, input: crate::types::ClusterNodeProvisioningMode) -> Self {
201        self.node_provisioning_mode = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>Determines how instance provisioning is handled during cluster operations. In <code>Continuous</code> mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use <code>CurrentCount</code> and <code>TargetCount</code> in <code>DescribeCluster</code> to track provisioning progress.</p>
205    pub fn set_node_provisioning_mode(mut self, input: ::std::option::Option<crate::types::ClusterNodeProvisioningMode>) -> Self {
206        self.node_provisioning_mode = input;
207        self
208    }
209    /// <p>Determines how instance provisioning is handled during cluster operations. In <code>Continuous</code> mode, the cluster provisions available instances incrementally and retries until the target count is reached. The cluster becomes operational once cluster-level resources are ready. Use <code>CurrentCount</code> and <code>TargetCount</code> in <code>DescribeCluster</code> to track provisioning progress.</p>
210    pub fn get_node_provisioning_mode(&self) -> &::std::option::Option<crate::types::ClusterNodeProvisioningMode> {
211        &self.node_provisioning_mode
212    }
213    /// <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>
214    pub fn cluster_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.cluster_role = ::std::option::Option::Some(input.into());
216        self
217    }
218    /// <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>
219    pub fn set_cluster_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220        self.cluster_role = input;
221        self
222    }
223    /// <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>
224    pub fn get_cluster_role(&self) -> &::std::option::Option<::std::string::String> {
225        &self.cluster_role
226    }
227    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
228    pub fn auto_scaling(mut self, input: crate::types::ClusterAutoScalingConfig) -> Self {
229        self.auto_scaling = ::std::option::Option::Some(input);
230        self
231    }
232    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
233    pub fn set_auto_scaling(mut self, input: ::std::option::Option<crate::types::ClusterAutoScalingConfig>) -> Self {
234        self.auto_scaling = input;
235        self
236    }
237    /// <p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>
238    pub fn get_auto_scaling(&self) -> &::std::option::Option<crate::types::ClusterAutoScalingConfig> {
239        &self.auto_scaling
240    }
241    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
242    pub fn build(
243        self,
244    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
245        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
246            cluster_name: self.cluster_name,
247            instance_groups: self.instance_groups,
248            restricted_instance_groups: self.restricted_instance_groups,
249            tiered_storage_config: self.tiered_storage_config,
250            node_recovery: self.node_recovery,
251            instance_groups_to_delete: self.instance_groups_to_delete,
252            node_provisioning_mode: self.node_provisioning_mode,
253            cluster_role: self.cluster_role,
254            auto_scaling: self.auto_scaling,
255        })
256    }
257}