aws-sdk-sagemaker 1.189.0

AWS SDK for Amazon SageMaker Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::batch_reboot_cluster_nodes::_batch_reboot_cluster_nodes_input::BatchRebootClusterNodesInputBuilder;

pub use crate::operation::batch_reboot_cluster_nodes::_batch_reboot_cluster_nodes_output::BatchRebootClusterNodesOutputBuilder;

impl crate::operation::batch_reboot_cluster_nodes::builders::BatchRebootClusterNodesInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.batch_reboot_cluster_nodes();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `BatchRebootClusterNodes`.
///
/// <p>Reboots specific nodes within a SageMaker HyperPod cluster using a soft recovery mechanism. <code>BatchRebootClusterNodes</code> performs a graceful reboot of the specified nodes by calling the Amazon Elastic Compute Cloud <code>RebootInstances</code> API, which attempts to cleanly shut down the operating system before restarting the instance.</p>
/// <p>This operation is useful for recovering from transient issues or applying certain configuration changes that require a restart.</p><note>
/// <ul>
/// <li>
/// <p>Rebooting a node may cause temporary service interruption for workloads running on that node. Ensure your workloads can handle node restarts or use appropriate scheduling to minimize impact.</p></li>
/// <li>
/// <p>You can reboot up to 25 nodes in a single request.</p></li>
/// <li>
/// <p>For SageMaker HyperPod clusters using the Slurm workload manager, ensure rebooting nodes will not disrupt critical cluster operations.</p></li>
/// </ul>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct BatchRebootClusterNodesFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::batch_reboot_cluster_nodes::builders::BatchRebootClusterNodesInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
    > for BatchRebootClusterNodesFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
            crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl BatchRebootClusterNodesFluentBuilder {
    /// Creates a new `BatchRebootClusterNodesFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the BatchRebootClusterNodes as a reference.
    pub fn as_input(&self) -> &crate::operation::batch_reboot_cluster_nodes::builders::BatchRebootClusterNodesInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodes::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodes::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesOutput,
        crate::operation::batch_reboot_cluster_nodes::BatchRebootClusterNodesError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster containing the nodes to reboot.</p>
    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cluster_name(input.into());
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster containing the nodes to reboot.</p>
    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cluster_name(input);
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster containing the nodes to reboot.</p>
    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cluster_name()
    }
    ///
    /// Appends an item to `NodeIds`.
    ///
    /// To override the contents of this collection use [`set_node_ids`](Self::set_node_ids).
    ///
    /// <p>A list of EC2 instance IDs to reboot using soft recovery. You can specify between 1 and 25 instance IDs.</p><note>
    /// <ul>
    /// <li>
    /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
    /// <li>
    /// <p>Each instance ID must follow the pattern <code>i-</code> followed by 17 hexadecimal characters (for example, <code>i-0123456789abcdef0</code>).</p></li>
    /// </ul>
    /// </note>
    pub fn node_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.node_ids(input.into());
        self
    }
    /// <p>A list of EC2 instance IDs to reboot using soft recovery. You can specify between 1 and 25 instance IDs.</p><note>
    /// <ul>
    /// <li>
    /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
    /// <li>
    /// <p>Each instance ID must follow the pattern <code>i-</code> followed by 17 hexadecimal characters (for example, <code>i-0123456789abcdef0</code>).</p></li>
    /// </ul>
    /// </note>
    pub fn set_node_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_node_ids(input);
        self
    }
    /// <p>A list of EC2 instance IDs to reboot using soft recovery. You can specify between 1 and 25 instance IDs.</p><note>
    /// <ul>
    /// <li>
    /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
    /// <li>
    /// <p>Each instance ID must follow the pattern <code>i-</code> followed by 17 hexadecimal characters (for example, <code>i-0123456789abcdef0</code>).</p></li>
    /// </ul>
    /// </note>
    pub fn get_node_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_node_ids()
    }
    ///
    /// Appends an item to `NodeLogicalIds`.
    ///
    /// To override the contents of this collection use [`set_node_logical_ids`](Self::set_node_logical_ids).
    ///
    /// <p>A list of logical node IDs to reboot using soft recovery. You can specify between 1 and 25 logical node IDs.</p>
    /// <p>The <code>NodeLogicalId</code> is a unique identifier that persists throughout the node's lifecycle and can be used to track nodes that are still being provisioned and don't yet have an EC2 instance ID assigned.</p><important>
    /// <ul>
    /// <li>
    /// <p>This parameter is only supported for clusters using <code>Continuous</code> as the <code>NodeProvisioningMode</code>. For clusters using the default provisioning mode, use <code>NodeIds</code> instead.</p></li>
    /// <li>
    /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
    /// </ul>
    /// </important>
    pub fn node_logical_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.node_logical_ids(input.into());
        self
    }
    /// <p>A list of logical node IDs to reboot using soft recovery. You can specify between 1 and 25 logical node IDs.</p>
    /// <p>The <code>NodeLogicalId</code> is a unique identifier that persists throughout the node's lifecycle and can be used to track nodes that are still being provisioned and don't yet have an EC2 instance ID assigned.</p><important>
    /// <ul>
    /// <li>
    /// <p>This parameter is only supported for clusters using <code>Continuous</code> as the <code>NodeProvisioningMode</code>. For clusters using the default provisioning mode, use <code>NodeIds</code> instead.</p></li>
    /// <li>
    /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
    /// </ul>
    /// </important>
    pub fn set_node_logical_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_node_logical_ids(input);
        self
    }
    /// <p>A list of logical node IDs to reboot using soft recovery. You can specify between 1 and 25 logical node IDs.</p>
    /// <p>The <code>NodeLogicalId</code> is a unique identifier that persists throughout the node's lifecycle and can be used to track nodes that are still being provisioned and don't yet have an EC2 instance ID assigned.</p><important>
    /// <ul>
    /// <li>
    /// <p>This parameter is only supported for clusters using <code>Continuous</code> as the <code>NodeProvisioningMode</code>. For clusters using the default provisioning mode, use <code>NodeIds</code> instead.</p></li>
    /// <li>
    /// <p>Either <code>NodeIds</code> or <code>NodeLogicalIds</code> must be provided (or both), but at least one is required.</p></li>
    /// </ul>
    /// </important>
    pub fn get_node_logical_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_node_logical_ids()
    }
}