Skip to content

update_inference_component

update_inference_component(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    inference_component_name: Optional[InferenceComponentName] = None,
    specification: Optional[InferenceComponentSpecification] = None,
    specifications: Optional[InferenceComponentSpecificationList] = None,
    runtime_config: Optional[InferenceComponentRuntimeConfig] = None,
    deployment_config: Optional[InferenceComponentDeploymentConfig] = None,
) -> UpdateInferenceComponentOutput

Updates an inference component.

Parameters:

  • inference_component_name (Optional[InferenceComponentName], default: None ) –

    The name of the inference component.

  • specification (Optional[InferenceComponentSpecification], default: None ) –

    Details about the resources to deploy with this inference component, including the model, container, and compute resources.

  • specifications (Optional[InferenceComponentSpecificationList], default: None ) –

    A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular Specification parameter, but not both.

  • runtime_config (Optional[InferenceComponentRuntimeConfig], default: None ) –

    Runtime settings for a model that is deployed with an inference component.

  • deployment_config (Optional[InferenceComponentDeploymentConfig], default: None ) –

    The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.

Raises:

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • 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_inference_component(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    inference_component_name: Optional[
        "capo_sagemaker.types.inference_component_name.InferenceComponentName"
    ] = None,
    specification: Optional[
        "capo_sagemaker.types.inference_component_specification.InferenceComponentSpecification"
    ] = None,
    specifications: Optional[
        "capo_sagemaker.types.inference_component_specification_list.InferenceComponentSpecificationList"
    ] = None,
    runtime_config: Optional[
        "capo_sagemaker.types.inference_component_runtime_config.InferenceComponentRuntimeConfig"
    ] = None,
    deployment_config: Optional[
        "capo_sagemaker.types.inference_component_deployment_config.InferenceComponentDeploymentConfig"
    ] = None,
) -> "capo_sagemaker.types.update_inference_component_output.UpdateInferenceComponentOutput":
    """<p>Updates an inference component.</p>

    Args:
        inference_component_name: <p>The name of the inference component.</p>
        specification: <p>Details about the resources to deploy with this inference component, including the model, container, and compute resources.</p>
        specifications: <p>A list of specification objects for the inference component, one per instance type. Use this parameter when you want to specify different model or resource configurations for the inference component on each instance type. You can use either this parameter or the singular <code>Specification</code> parameter, but not both.</p>
        runtime_config: <p>Runtime settings for a model that is deployed with an inference component.</p>
        deployment_config: <p>The deployment configuration for the inference component. The configuration contains the desired deployment strategy and rollback settings.</p>

    Raises:
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_inference_component_input.UpdateInferenceComponentInput]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_inference_component_output.UpdateInferenceComponentOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.update_inference_component

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateInferenceComponent")
    )
    input_: capo_sagemaker.types.update_inference_component_input.UpdateInferenceComponentInput = {}
    if inference_component_name is not None:
        input_["inference_component_name"] = inference_component_name
    if specification is not None:
        input_["specification"] = specification
    if specifications is not None:
        input_["specifications"] = specifications
    if runtime_config is not None:
        input_["runtime_config"] = runtime_config
    if deployment_config is not None:
        input_["deployment_config"] = deployment_config

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