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