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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateClusterSoftwareInput {
    /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
    pub cluster_name: ::std::option::Option<::std::string::String>,
    /// <p>The array of instance groups for which to update AMI versions.</p>
    pub instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::UpdateClusterSoftwareInstanceGroupSpecification>>,
    /// <p>The configuration to use when updating the AMI versions.</p>
    pub deployment_config: ::std::option::Option<crate::types::DeploymentConfiguration>,
    /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
    /// <li>
    /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
    /// <li>
    /// <p><code>default</code>: Use the default latest system image</p></li>
    /// </ul>
    /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
    /// <li>
    /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
    /// <li>
    /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
    /// </ul>
    /// <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>
    pub image_id: ::std::option::Option<::std::string::String>,
}
impl UpdateClusterSoftwareInput {
    /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
        self.cluster_name.as_deref()
    }
    /// <p>The array of instance groups for which to update AMI versions.</p>
    ///
    /// 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()`.
    pub fn instance_groups(&self) -> &[crate::types::UpdateClusterSoftwareInstanceGroupSpecification] {
        self.instance_groups.as_deref().unwrap_or_default()
    }
    /// <p>The configuration to use when updating the AMI versions.</p>
    pub fn deployment_config(&self) -> ::std::option::Option<&crate::types::DeploymentConfiguration> {
        self.deployment_config.as_ref()
    }
    /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
    /// <li>
    /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
    /// <li>
    /// <p><code>default</code>: Use the default latest system image</p></li>
    /// </ul>
    /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
    /// <li>
    /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
    /// <li>
    /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
    /// </ul>
    /// <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>
    pub fn image_id(&self) -> ::std::option::Option<&str> {
        self.image_id.as_deref()
    }
}
impl UpdateClusterSoftwareInput {
    /// Creates a new builder-style object to manufacture [`UpdateClusterSoftwareInput`](crate::operation::update_cluster_software::UpdateClusterSoftwareInput).
    pub fn builder() -> crate::operation::update_cluster_software::builders::UpdateClusterSoftwareInputBuilder {
        crate::operation::update_cluster_software::builders::UpdateClusterSoftwareInputBuilder::default()
    }
}

/// A builder for [`UpdateClusterSoftwareInput`](crate::operation::update_cluster_software::UpdateClusterSoftwareInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateClusterSoftwareInputBuilder {
    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::UpdateClusterSoftwareInstanceGroupSpecification>>,
    pub(crate) deployment_config: ::std::option::Option<crate::types::DeploymentConfiguration>,
    pub(crate) image_id: ::std::option::Option<::std::string::String>,
}
impl UpdateClusterSoftwareInputBuilder {
    /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
    /// This field is required.
    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_name = input;
        self
    }
    /// <p>Specify the name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster you want to update for security patching.</p>
    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_name
    }
    /// Appends an item to `instance_groups`.
    ///
    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
    ///
    /// <p>The array of instance groups for which to update AMI versions.</p>
    pub fn instance_groups(mut self, input: crate::types::UpdateClusterSoftwareInstanceGroupSpecification) -> Self {
        let mut v = self.instance_groups.unwrap_or_default();
        v.push(input);
        self.instance_groups = ::std::option::Option::Some(v);
        self
    }
    /// <p>The array of instance groups for which to update AMI versions.</p>
    pub fn set_instance_groups(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::UpdateClusterSoftwareInstanceGroupSpecification>>,
    ) -> Self {
        self.instance_groups = input;
        self
    }
    /// <p>The array of instance groups for which to update AMI versions.</p>
    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::UpdateClusterSoftwareInstanceGroupSpecification>> {
        &self.instance_groups
    }
    /// <p>The configuration to use when updating the AMI versions.</p>
    pub fn deployment_config(mut self, input: crate::types::DeploymentConfiguration) -> Self {
        self.deployment_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration to use when updating the AMI versions.</p>
    pub fn set_deployment_config(mut self, input: ::std::option::Option<crate::types::DeploymentConfiguration>) -> Self {
        self.deployment_config = input;
        self
    }
    /// <p>The configuration to use when updating the AMI versions.</p>
    pub fn get_deployment_config(&self) -> &::std::option::Option<crate::types::DeploymentConfiguration> {
        &self.deployment_config
    }
    /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
    /// <li>
    /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
    /// <li>
    /// <p><code>default</code>: Use the default latest system image</p></li>
    /// </ul>
    /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
    /// <li>
    /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
    /// <li>
    /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
    /// </ul>
    /// <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>
    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
    /// <li>
    /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
    /// <li>
    /// <p><code>default</code>: Use the default latest system image</p></li>
    /// </ul>
    /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
    /// <li>
    /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
    /// <li>
    /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
    /// </ul>
    /// <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>
    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_id = input;
        self
    }
    /// <p>When configuring your HyperPod cluster, you can specify an image ID using one of the following options:</p>
    /// <ul>
    /// <li>
    /// <p><code>HyperPodPublicAmiId</code>: Use a HyperPod public AMI</p></li>
    /// <li>
    /// <p><code>CustomAmiId</code>: Use your custom AMI</p></li>
    /// <li>
    /// <p><code>default</code>: Use the default latest system image</p></li>
    /// </ul>
    /// <p>If you choose to use a custom AMI (<code>CustomAmiId</code>), ensure it meets the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Encryption: The custom AMI must be unencrypted.</p></li>
    /// <li>
    /// <p>Ownership: The custom AMI must be owned by the same Amazon Web Services account that is creating the HyperPod cluster.</p></li>
    /// <li>
    /// <p>Volume support: Only the primary AMI snapshot volume is supported; additional AMI volumes are not supported.</p></li>
    /// </ul>
    /// <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>
    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_id
    }
    /// Consumes the builder and constructs a [`UpdateClusterSoftwareInput`](crate::operation::update_cluster_software::UpdateClusterSoftwareInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_cluster_software::UpdateClusterSoftwareInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_cluster_software::UpdateClusterSoftwareInput {
            cluster_name: self.cluster_name,
            instance_groups: self.instance_groups,
            deployment_config: self.deployment_config,
            image_id: self.image_id,
        })
    }
}