Skip to content

update_endpoint

update_endpoint(
    endpoint_arn: ComprehendEndpointArn,
    *,
    config_overrides: Optional[ComprehendClientConfig] = None,
    desired_model_arn: Optional[ComprehendModelArn] = None,
    desired_inference_units: Optional[InferenceUnitsInteger] = None,
    desired_data_access_role_arn: Optional[IamRoleArn] = None,
    flywheel_arn: Optional[ComprehendFlywheelArn] = None,
) -> UpdateEndpointResponse

Updates information about the specified endpoint. For information about endpoints, see Managing endpoints.

Parameters:

  • endpoint_arn (ComprehendEndpointArn) –

    The Amazon Resource Number (ARN) of the endpoint being updated.

  • desired_model_arn (Optional[ComprehendModelArn], default: None ) –

    The ARN of the new model to use when updating an existing endpoint.

  • desired_inference_units (Optional[InferenceUnitsInteger], default: None ) –

    The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.

  • desired_data_access_role_arn (Optional[IamRoleArn], default: None ) –

    Data access role ARN to use in case the new model is encrypted with a customer CMK.

  • flywheel_arn (Optional[ComprehendFlywheelArn], default: None ) –

    The Amazon Resource Number (ARN) of the flywheel

Raises:

Source code in docs_src/capo_comprehend/_services/comprehend.py
def update_endpoint(
    self,
    endpoint_arn: "capo_comprehend.types.comprehend_endpoint_arn.ComprehendEndpointArn",
    *,
    config_overrides: Optional[ComprehendClientConfig] = None,
    desired_model_arn: Optional[
        "capo_comprehend.types.comprehend_model_arn.ComprehendModelArn"
    ] = None,
    desired_inference_units: Optional[
        "capo_comprehend.types.inference_units_integer.InferenceUnitsInteger"
    ] = None,
    desired_data_access_role_arn: Optional[
        "capo_comprehend.types.iam_role_arn.IamRoleArn"
    ] = None,
    flywheel_arn: Optional[
        "capo_comprehend.types.comprehend_flywheel_arn.ComprehendFlywheelArn"
    ] = None,
) -> "capo_comprehend.types.update_endpoint_response.UpdateEndpointResponse":
    """<p>Updates information about the specified endpoint. For information about endpoints, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/manage-endpoints.html">Managing endpoints</a>.</p>

    Args:
        endpoint_arn: <p>The Amazon Resource Number (ARN) of the endpoint being updated.</p>
        desired_model_arn: <p>The ARN of the new model to use when updating an existing endpoint.</p>
        desired_inference_units: <p> The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.</p>
        desired_data_access_role_arn: <p>Data access role ARN to use in case the new model is encrypted with a customer CMK.</p>
        flywheel_arn: <p>The Amazon Resource Number (ARN) of the flywheel</p>

    Raises:
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource name is already in use. Use a different name and try your request again.</p>
        capo_comprehend.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>The maximum number of resources per account has been exceeded. Review the resources, and then try your request again.</p>
        capo_comprehend.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
        capo_comprehend.errors.resource_unavailable_exception.ResourceUnavailableException: <p>The specified resource is not available. Check the resource and try your request again.</p>
        capo_comprehend.errors.too_many_requests_exception.TooManyRequestsException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_comprehend.types.update_endpoint_request.UpdateEndpointRequest]",
    ) -> OperationResponse[
        "capo_comprehend.types.update_endpoint_response.UpdateEndpointResponse"
    ]:
        import capo_comprehend._operations.comprehend_20171127.update_endpoint

        output, http_response = (
            capo_comprehend._operations.comprehend_20171127.update_endpoint.update_endpoint(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEndpoint")
    )
    input_: capo_comprehend.types.update_endpoint_request.UpdateEndpointRequest = {
        "endpoint_arn": endpoint_arn
    }
    if desired_model_arn is not None:
        input_["desired_model_arn"] = desired_model_arn
    if desired_inference_units is not None:
        input_["desired_inference_units"] = desired_inference_units
    if desired_data_access_role_arn is not None:
        input_["desired_data_access_role_arn"] = desired_data_access_role_arn
    if flywheel_arn is not None:
        input_["flywheel_arn"] = flywheel_arn

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