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