Skip to content

update_endpoint_weights_and_capacities async

update_endpoint_weights_and_capacities(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    endpoint_name: Optional[EndpointName] = None,
    desired_weights_and_capacities: Optional[DesiredWeightAndCapacityList] = None,
) -> UpdateEndpointWeightsAndCapacitiesOutput

Updates variant weight of one or more variants associated with an existing endpoint, or capacity of one variant associated with an existing endpoint. When it receives the request, SageMaker sets the endpoint status to Updating. After updating the endpoint, it sets the status to InService. To check the status of an endpoint, use the DescribeEndpoint API.

Parameters:

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/async_sage_maker.py
async def update_endpoint_weights_and_capacities(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    endpoint_name: Optional[
        "capo_sagemaker.types.endpoint_name.EndpointName"
    ] = None,
    desired_weights_and_capacities: Optional[
        "capo_sagemaker.types.desired_weight_and_capacity_list.DesiredWeightAndCapacityList"
    ] = None,
) -> "capo_sagemaker.types.update_endpoint_weights_and_capacities_output.UpdateEndpointWeightsAndCapacitiesOutput":
    """<p>Updates variant weight of one or more variants associated with an existing endpoint, or capacity of one variant associated with an existing endpoint. When it receives the request, SageMaker sets the endpoint status to <code>Updating</code>. After updating the endpoint, it sets the status to <code>InService</code>. To check the status of an endpoint, use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpoint.html">DescribeEndpoint</a> API. </p>

    Args:
        endpoint_name: <p>The name of an existing SageMaker endpoint.</p>
        desired_weights_and_capacities: <p>An object that provides new capacity and weight values for a variant.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_endpoint_weights_and_capacities_input.UpdateEndpointWeightsAndCapacitiesInput]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_endpoint_weights_and_capacities_output.UpdateEndpointWeightsAndCapacitiesOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.update_endpoint_weights_and_capacities

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.update_endpoint_weights_and_capacities.async_update_endpoint_weights_and_capacities(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEndpointWeightsAndCapacities")
    )
    input_: capo_sagemaker.types.update_endpoint_weights_and_capacities_input.UpdateEndpointWeightsAndCapacitiesInput = {}
    if endpoint_name is not None:
        input_["endpoint_name"] = endpoint_name
    if desired_weights_and_capacities is not None:
        input_["desired_weights_and_capacities"] = desired_weights_and_capacities

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output