aws_sdk_sagemaker/operation/update_cluster_software/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_cluster_software::_update_cluster_software_output::UpdateClusterSoftwareOutputBuilder;
3
4pub use crate::operation::update_cluster_software::_update_cluster_software_input::UpdateClusterSoftwareInputBuilder;
5
6impl crate::operation::update_cluster_software::builders::UpdateClusterSoftwareInputBuilder {
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_software::UpdateClusterSoftwareOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_cluster_software::UpdateClusterSoftwareError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_cluster_software();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateClusterSoftware`.
24///
25/// <p>Updates the platform software of a SageMaker HyperPod cluster for security patching. To learn how to use this API, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-hyperpod-operate.html#sagemaker-hyperpod-operate-cli-command-update-cluster-software">Update the SageMaker HyperPod platform software of a cluster</a>.</p><important>
26/// <p>The <code>UpgradeClusterSoftware</code> API call may impact your SageMaker HyperPod cluster uptime and availability. Plan accordingly to mitigate potential disruptions to your workloads.</p>
27/// </important>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct UpdateClusterSoftwareFluentBuilder {
30 handle: ::std::sync::Arc<crate::client::Handle>,
31 inner: crate::operation::update_cluster_software::builders::UpdateClusterSoftwareInputBuilder,
32 config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35 crate::client::customize::internal::CustomizableSend<
36 crate::operation::update_cluster_software::UpdateClusterSoftwareOutput,
37 crate::operation::update_cluster_software::UpdateClusterSoftwareError,
38 > for UpdateClusterSoftwareFluentBuilder
39{
40 fn send(
41 self,
42 config_override: crate::config::Builder,
43 ) -> crate::client::customize::internal::BoxFuture<
44 crate::client::customize::internal::SendResult<
45 crate::operation::update_cluster_software::UpdateClusterSoftwareOutput,
46 crate::operation::update_cluster_software::UpdateClusterSoftwareError,
47 >,
48 > {
49 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50 }
51}
52impl UpdateClusterSoftwareFluentBuilder {
53 /// Creates a new `UpdateClusterSoftwareFluentBuilder`.
54 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55 Self {
56 handle,
57 inner: ::std::default::Default::default(),
58 config_override: ::std::option::Option::None,
59 }
60 }
61 /// Access the UpdateClusterSoftware as a reference.
62 pub fn as_input(&self) -> &crate::operation::update_cluster_software::builders::UpdateClusterSoftwareInputBuilder {
63 &self.inner
64 }
65 /// Sends the request and returns the response.
66 ///
67 /// If an error occurs, an `SdkError` will be returned with additional details that
68 /// can be matched against.
69 ///
70 /// By default, any retryable failures will be retried twice. Retry behavior
71 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72 /// set when configuring the client.
73 pub async fn send(
74 self,
75 ) -> ::std::result::Result<
76 crate::operation::update_cluster_software::UpdateClusterSoftwareOutput,
77 ::aws_smithy_runtime_api::client::result::SdkError<
78 crate::operation::update_cluster_software::UpdateClusterSoftwareError,
79 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80 >,
81 > {
82 let input = self
83 .inner
84 .build()
85 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86 let runtime_plugins = crate::operation::update_cluster_software::UpdateClusterSoftware::operation_runtime_plugins(
87 self.handle.runtime_plugins.clone(),
88 &self.handle.conf,
89 self.config_override,
90 );
91 crate::operation::update_cluster_software::UpdateClusterSoftware::orchestrate(&runtime_plugins, input).await
92 }
93
94 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95 pub fn customize(
96 self,
97 ) -> crate::client::customize::CustomizableOperation<
98 crate::operation::update_cluster_software::UpdateClusterSoftwareOutput,
99 crate::operation::update_cluster_software::UpdateClusterSoftwareError,
100 Self,
101 > {
102 crate::client::customize::CustomizableOperation::new(self)
103 }
104 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110 self.config_override = config_override;
111 self
112 }
113 /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
114 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.cluster_name(input.into());
116 self
117 }
118 /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
119 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_cluster_name(input);
121 self
122 }
123 /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
124 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_cluster_name()
126 }
127 ///
128 /// Appends an item to `InstanceGroups`.
129 ///
130 /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
131 ///
132 /// <p>The array of instance groups for which to update AMI versions.</p>
133 pub fn instance_groups(mut self, input: crate::types::UpdateClusterSoftwareInstanceGroupSpecification) -> Self {
134 self.inner = self.inner.instance_groups(input);
135 self
136 }
137 /// <p>The array of instance groups for which to update AMI versions.</p>
138 pub fn set_instance_groups(
139 mut self,
140 input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateClusterSoftwareInstanceGroupSpecification>>,
141 ) -> Self {
142 self.inner = self.inner.set_instance_groups(input);
143 self
144 }
145 /// <p>The array of instance groups for which to update AMI versions.</p>
146 pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateClusterSoftwareInstanceGroupSpecification>> {
147 self.inner.get_instance_groups()
148 }
149 /// <p>The configuration to use when updating the AMI versions.</p>
150 pub fn deployment_config(mut self, input: crate::types::DeploymentConfiguration) -> Self {
151 self.inner = self.inner.deployment_config(input);
152 self
153 }
154 /// <p>The configuration to use when updating the AMI versions.</p>
155 pub fn set_deployment_config(mut self, input: ::std::option::Option<crate::types::DeploymentConfiguration>) -> Self {
156 self.inner = self.inner.set_deployment_config(input);
157 self
158 }
159 /// <p>The configuration to use when updating the AMI versions.</p>
160 pub fn get_deployment_config(&self) -> &::std::option::Option<crate::types::DeploymentConfiguration> {
161 self.inner.get_deployment_config()
162 }
163 /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
164 /// <ul>
165 /// <li>
166 /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
167 /// <li>
168 /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
169 /// <li>
170 /// <p><code>default</code>: Use the default latest system image</p></li>
171 /// </ul>
172 /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
173 /// <ul>
174 /// <li>
175 /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
176 /// <li>
177 /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
178 /// <li>
179 /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
180 /// </ul>
181 /// <p>When updating the instance group's AMI through the <code>UpdateClusterSoftware</code> operation, if an instance group uses a custom AMI, you must provide an <code>ImageId</code> or use the default as input. Note that if you don't specify an instance group in your <code>UpdateClusterSoftware</code> request, then all of the instance groups are patched with the specified image.</p>
182 pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.inner = self.inner.image_id(input.into());
184 self
185 }
186 /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
187 /// <ul>
188 /// <li>
189 /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
190 /// <li>
191 /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
192 /// <li>
193 /// <p><code>default</code>: Use the default latest system image</p></li>
194 /// </ul>
195 /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
196 /// <ul>
197 /// <li>
198 /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
199 /// <li>
200 /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
201 /// <li>
202 /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
203 /// </ul>
204 /// <p>When updating the instance group's AMI through the <code>UpdateClusterSoftware</code> operation, if an instance group uses a custom AMI, you must provide an <code>ImageId</code> or use the default as input. Note that if you don't specify an instance group in your <code>UpdateClusterSoftware</code> request, then all of the instance groups are patched with the specified image.</p>
205 pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206 self.inner = self.inner.set_image_id(input);
207 self
208 }
209 /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
210 /// <ul>
211 /// <li>
212 /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
213 /// <li>
214 /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
215 /// <li>
216 /// <p><code>default</code>: Use the default latest system image</p></li>
217 /// </ul>
218 /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
219 /// <ul>
220 /// <li>
221 /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
222 /// <li>
223 /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
224 /// <li>
225 /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
226 /// </ul>
227 /// <p>When updating the instance group's AMI through the <code>UpdateClusterSoftware</code> operation, if an instance group uses a custom AMI, you must provide an <code>ImageId</code> or use the default as input. Note that if you don't specify an instance group in your <code>UpdateClusterSoftware</code> request, then all of the instance groups are patched with the specified image.</p>
228 pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
229 self.inner.get_image_id()
230 }
231}