Skip to content

update_cluster_extension

update_cluster_extension(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_arn: Optional[ClusterArn] = None,
    extension_arn: Optional[ExtensionArn] = None,
    extension_version: Optional[ExtensionVersion] = None,
    configuration_values: Optional[ExtensionConfigurationValues] = None,
    client_token: Optional[String] = None,
) -> UpdateClusterExtensionResponse

Updates the configuration or the version of an extension installed on a SageMaker HyperPod cluster. SageMaker HyperPod applies the change to every node in the cluster. You can change the configuration, the version, or both in one request.

  • Configuration: You can change settings by sending ConfigurationValues. Settings that you include are changed. Settings that you omit keep their current values. A setting with the value null is removed and returns to its default value.

  • Version: You can update to a later version. You can't update to an earlier version. To use an earlier version, delete the extension and create it again with that version.

To retry the operation on nodes where it failed, fix the cause that DescribeClusterExtension reports in Health, and then send an UpdateClusterExtension request that doesn't change the version or the configuration.

You can't update an extension while it is being deleted.

Parameters:

  • cluster_arn (Optional[ClusterArn], default: None ) –

    The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster on which the extension is installed.

  • extension_arn (Optional[ExtensionArn], default: None ) –

    The Amazon Resource Name (ARN) of the extension to update.

  • extension_version (Optional[ExtensionVersion], default: None ) –

    The version to update the extension to, in MAJOR.MINOR.PATCH format. The version must be later than the extension's current version. If you omit this parameter, the extension keeps its current version.

  • configuration_values (Optional[ExtensionConfigurationValues], default: None ) –

    The configuration changes to apply, as a JSON object serialized as a string. Settings that you include are changed, settings that you omit are unchanged, and a setting with the value null returns to its default value. The resulting configuration must be valid for the target extension version. If you omit ConfigurationValues, the configuration is unchanged.

  • client_token (Optional[String], default: None ) –

    A unique, case-sensitive identifier that you provide so that the request is idempotent. If you send the same update more than once, SageMaker HyperPod applies it once and doesn't return an error.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_cluster_extension(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_arn: Optional["capo_sagemaker.types.cluster_arn.ClusterArn"] = None,
    extension_arn: Optional[
        "capo_sagemaker.types.extension_arn.ExtensionArn"
    ] = None,
    extension_version: Optional[
        "capo_sagemaker.types.extension_version.ExtensionVersion"
    ] = None,
    configuration_values: Optional[
        "capo_sagemaker.types.extension_configuration_values.ExtensionConfigurationValues"
    ] = None,
    client_token: Optional["capo_sagemaker.types.string.String"] = None,
) -> "capo_sagemaker.types.update_cluster_extension_response.UpdateClusterExtensionResponse":
    """<p>Updates the configuration or the version of an extension installed on a SageMaker HyperPod cluster. SageMaker HyperPod applies the change to every node in the cluster. You can change the configuration, the version, or both in one request.</p> <ul> <li> <p> <b>Configuration:</b> You can change settings by sending <code>ConfigurationValues</code>. Settings that you include are changed. Settings that you omit keep their current values. A setting with the value <code>null</code> is removed and returns to its default value.</p> </li> <li> <p> <b>Version:</b> You can update to a later version. You can't update to an earlier version. To use an earlier version, delete the extension and create it again with that version.</p> </li> </ul> <p>To retry the operation on nodes where it failed, fix the cause that <code>DescribeClusterExtension</code> reports in <code>Health</code>, and then send an <code>UpdateClusterExtension</code> request that doesn't change the version or the configuration.</p> <p>You can't update an extension while it is being deleted.</p>

    Args:
        cluster_arn: <p>The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster on which the extension is installed.</p>
        extension_arn: <p>The Amazon Resource Name (ARN) of the extension to update.</p>
        extension_version: <p>The version to update the extension to, in <code>MAJOR.MINOR.PATCH</code> format. The version must be later than the extension's current version. If you omit this parameter, the extension keeps its current version.</p>
        configuration_values: <p>The configuration changes to apply, as a JSON object serialized as a string. Settings that you include are changed, settings that you omit are unchanged, and a setting with the value <code>null</code> returns to its default value. The resulting configuration must be valid for the target extension version. If you omit <code>ConfigurationValues</code>, the configuration is unchanged.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide so that the request is idempotent. If you send the same update more than once, SageMaker HyperPod applies it once and doesn't return an error.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_cluster_extension_request.UpdateClusterExtensionRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_cluster_extension_response.UpdateClusterExtensionResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_cluster_extension

        output, http_response = (
            capo_sagemaker._operations.sage_maker.update_cluster_extension.update_cluster_extension(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateClusterExtension")
    )
    input_: capo_sagemaker.types.update_cluster_extension_request.UpdateClusterExtensionRequest = {}
    if cluster_arn is not None:
        input_["cluster_arn"] = cluster_arn
    if extension_arn is not None:
        input_["extension_arn"] = extension_arn
    if extension_version is not None:
        input_["extension_version"] = extension_version
    if configuration_values is not None:
        input_["configuration_values"] = configuration_values
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output