aws_sdk_pcs/operation/update_compute_node_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_compute_node_group::_update_compute_node_group_output::UpdateComputeNodeGroupOutputBuilder;
3
4pub use crate::operation::update_compute_node_group::_update_compute_node_group_input::UpdateComputeNodeGroupInputBuilder;
5
6impl crate::operation::update_compute_node_group::builders::UpdateComputeNodeGroupInputBuilder {
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_compute_node_group::UpdateComputeNodeGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_compute_node_group::UpdateComputeNodeGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_compute_node_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateComputeNodeGroup`.
24///
25/// <p>Updates a compute node group. You can update many of the fields related to your compute node group including the configurations for networking, compute nodes, and settings specific to your scheduler (such as Slurm).</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateComputeNodeGroupFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_compute_node_group::builders::UpdateComputeNodeGroupInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_compute_node_group::UpdateComputeNodeGroupOutput,
35 crate::operation::update_compute_node_group::UpdateComputeNodeGroupError,
36 > for UpdateComputeNodeGroupFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::update_compute_node_group::UpdateComputeNodeGroupOutput,
44 crate::operation::update_compute_node_group::UpdateComputeNodeGroupError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateComputeNodeGroupFluentBuilder {
51 /// Creates a new `UpdateComputeNodeGroupFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the UpdateComputeNodeGroup as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_compute_node_group::builders::UpdateComputeNodeGroupInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_compute_node_group::UpdateComputeNodeGroupOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_compute_node_group::UpdateComputeNodeGroupError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_compute_node_group::UpdateComputeNodeGroup::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_compute_node_group::UpdateComputeNodeGroup::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_compute_node_group::UpdateComputeNodeGroupOutput,
97 crate::operation::update_compute_node_group::UpdateComputeNodeGroupError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name or ID of the cluster of the compute node group.</p>
112 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.cluster_identifier(input.into());
114 self
115 }
116 /// <p>The name or ID of the cluster of the compute node group.</p>
117 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_cluster_identifier(input);
119 self
120 }
121 /// <p>The name or ID of the cluster of the compute node group.</p>
122 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_cluster_identifier()
124 }
125 /// <p>The name or ID of the compute node group.</p>
126 pub fn compute_node_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.compute_node_group_identifier(input.into());
128 self
129 }
130 /// <p>The name or ID of the compute node group.</p>
131 pub fn set_compute_node_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_compute_node_group_identifier(input);
133 self
134 }
135 /// <p>The name or ID of the compute node group.</p>
136 pub fn get_compute_node_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_compute_node_group_identifier()
138 }
139 /// <p>The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.</p>
140 pub fn ami_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.ami_id(input.into());
142 self
143 }
144 /// <p>The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.</p>
145 pub fn set_ami_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_ami_id(input);
147 self
148 }
149 /// <p>The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. If not provided, PCS uses the AMI ID specified in the custom launch template.</p>
150 pub fn get_ami_id(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_ami_id()
152 }
153 ///
154 /// Appends an item to `subnetIds`.
155 ///
156 /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
157 ///
158 /// <p>The list of subnet IDs where the compute node group provisions instances. The subnets must be in the same VPC as the cluster.</p>
159 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.inner = self.inner.subnet_ids(input.into());
161 self
162 }
163 /// <p>The list of subnet IDs where the compute node group provisions instances. The subnets must be in the same VPC as the cluster.</p>
164 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
165 self.inner = self.inner.set_subnet_ids(input);
166 self
167 }
168 /// <p>The list of subnet IDs where the compute node group provisions instances. The subnets must be in the same VPC as the cluster.</p>
169 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
170 self.inner.get_subnet_ids()
171 }
172 /// <p>An Amazon EC2 launch template PCS uses to launch compute nodes.</p>
173 pub fn custom_launch_template(mut self, input: crate::types::CustomLaunchTemplate) -> Self {
174 self.inner = self.inner.custom_launch_template(input);
175 self
176 }
177 /// <p>An Amazon EC2 launch template PCS uses to launch compute nodes.</p>
178 pub fn set_custom_launch_template(mut self, input: ::std::option::Option<crate::types::CustomLaunchTemplate>) -> Self {
179 self.inner = self.inner.set_custom_launch_template(input);
180 self
181 }
182 /// <p>An Amazon EC2 launch template PCS uses to launch compute nodes.</p>
183 pub fn get_custom_launch_template(&self) -> &::std::option::Option<crate::types::CustomLaunchTemplate> {
184 self.inner.get_custom_launch_template()
185 }
186 /// <p>Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html">Amazon EC2 billing and purchasing options</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. For more information about PCS support for Capacity Blocks, see <a href="https://docs.aws.amazon.com/pcs/latest/userguide/capacity-blocks.html">Using Amazon EC2 Capacity Blocks for ML with PCS</a> in the <i>PCS User Guide</i>. If you don't provide this option, it defaults to On-Demand.</p>
187 pub fn purchase_option(mut self, input: crate::types::PurchaseOption) -> Self {
188 self.inner = self.inner.purchase_option(input);
189 self
190 }
191 /// <p>Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html">Amazon EC2 billing and purchasing options</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. For more information about PCS support for Capacity Blocks, see <a href="https://docs.aws.amazon.com/pcs/latest/userguide/capacity-blocks.html">Using Amazon EC2 Capacity Blocks for ML with PCS</a> in the <i>PCS User Guide</i>. If you don't provide this option, it defaults to On-Demand.</p>
192 pub fn set_purchase_option(mut self, input: ::std::option::Option<crate::types::PurchaseOption>) -> Self {
193 self.inner = self.inner.set_purchase_option(input);
194 self
195 }
196 /// <p>Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, and Amazon EC2 Capacity Blocks for ML. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-purchasing-options.html">Amazon EC2 billing and purchasing options</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. For more information about PCS support for Capacity Blocks, see <a href="https://docs.aws.amazon.com/pcs/latest/userguide/capacity-blocks.html">Using Amazon EC2 Capacity Blocks for ML with PCS</a> in the <i>PCS User Guide</i>. If you don't provide this option, it defaults to On-Demand.</p>
197 pub fn get_purchase_option(&self) -> &::std::option::Option<crate::types::PurchaseOption> {
198 self.inner.get_purchase_option()
199 }
200 /// <p>Additional configuration when you specify <code>SPOT</code> as the <code>purchaseOption</code> for the <code>CreateComputeNodeGroup</code> API action.</p>
201 pub fn spot_options(mut self, input: crate::types::SpotOptions) -> Self {
202 self.inner = self.inner.spot_options(input);
203 self
204 }
205 /// <p>Additional configuration when you specify <code>SPOT</code> as the <code>purchaseOption</code> for the <code>CreateComputeNodeGroup</code> API action.</p>
206 pub fn set_spot_options(mut self, input: ::std::option::Option<crate::types::SpotOptions>) -> Self {
207 self.inner = self.inner.set_spot_options(input);
208 self
209 }
210 /// <p>Additional configuration when you specify <code>SPOT</code> as the <code>purchaseOption</code> for the <code>CreateComputeNodeGroup</code> API action.</p>
211 pub fn get_spot_options(&self) -> &::std::option::Option<crate::types::SpotOptions> {
212 self.inner.get_spot_options()
213 }
214 /// <p>Specifies the boundaries of the compute node group auto scaling.</p>
215 pub fn scaling_configuration(mut self, input: crate::types::ScalingConfigurationRequest) -> Self {
216 self.inner = self.inner.scaling_configuration(input);
217 self
218 }
219 /// <p>Specifies the boundaries of the compute node group auto scaling.</p>
220 pub fn set_scaling_configuration(mut self, input: ::std::option::Option<crate::types::ScalingConfigurationRequest>) -> Self {
221 self.inner = self.inner.set_scaling_configuration(input);
222 self
223 }
224 /// <p>Specifies the boundaries of the compute node group auto scaling.</p>
225 pub fn get_scaling_configuration(&self) -> &::std::option::Option<crate::types::ScalingConfigurationRequest> {
226 self.inner.get_scaling_configuration()
227 }
228 /// <p>The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the <code>pcs:RegisterComputeNodeGroupInstance</code> permission and the role name must start with <code>AWSPCS</code> or must have the path <code>/aws-pcs/</code>. For more information, see <a href="https://docs.aws.amazon.com/pcs/latest/userguide/security-instance-profiles.html">IAM instance profiles for PCS</a> in the <i>PCS User Guide</i>.</p>
229 pub fn iam_instance_profile_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230 self.inner = self.inner.iam_instance_profile_arn(input.into());
231 self
232 }
233 /// <p>The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the <code>pcs:RegisterComputeNodeGroupInstance</code> permission and the role name must start with <code>AWSPCS</code> or must have the path <code>/aws-pcs/</code>. For more information, see <a href="https://docs.aws.amazon.com/pcs/latest/userguide/security-instance-profiles.html">IAM instance profiles for PCS</a> in the <i>PCS User Guide</i>.</p>
234 pub fn set_iam_instance_profile_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235 self.inner = self.inner.set_iam_instance_profile_arn(input);
236 self
237 }
238 /// <p>The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the <code>pcs:RegisterComputeNodeGroupInstance</code> permission and the role name must start with <code>AWSPCS</code> or must have the path <code>/aws-pcs/</code>. For more information, see <a href="https://docs.aws.amazon.com/pcs/latest/userguide/security-instance-profiles.html">IAM instance profiles for PCS</a> in the <i>PCS User Guide</i>.</p>
239 pub fn get_iam_instance_profile_arn(&self) -> &::std::option::Option<::std::string::String> {
240 self.inner.get_iam_instance_profile_arn()
241 }
242 /// <p>Additional options related to the Slurm scheduler.</p>
243 pub fn slurm_configuration(mut self, input: crate::types::UpdateComputeNodeGroupSlurmConfigurationRequest) -> Self {
244 self.inner = self.inner.slurm_configuration(input);
245 self
246 }
247 /// <p>Additional options related to the Slurm scheduler.</p>
248 pub fn set_slurm_configuration(mut self, input: ::std::option::Option<crate::types::UpdateComputeNodeGroupSlurmConfigurationRequest>) -> Self {
249 self.inner = self.inner.set_slurm_configuration(input);
250 self
251 }
252 /// <p>Additional options related to the Slurm scheduler.</p>
253 pub fn get_slurm_configuration(&self) -> &::std::option::Option<crate::types::UpdateComputeNodeGroupSlurmConfigurationRequest> {
254 self.inner.get_slurm_configuration()
255 }
256 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
257 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258 self.inner = self.inner.client_token(input.into());
259 self
260 }
261 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
262 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263 self.inner = self.inner.set_client_token(input);
264 self
265 }
266 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
267 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
268 self.inner.get_client_token()
269 }
270}