Skip to content

update_global_inference_gateway async

update_global_inference_gateway(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    identifier: Optional[GlobalInferenceGatewayIdentifier] = None,
    routing: Optional[GlobalInferenceGatewayRouting] = None,
) -> UpdateGlobalInferenceGatewayResponse

Updates the routing configuration of a global inference gateway. To add or remove in-cluster inference gateways, use AddInferenceGateway and RemoveInferenceGateway. This operation is asynchronous: the global inference gateway moves to the UPDATING status. The operation fails with ConflictException while another operation is in progress on the global inference gateway.

Parameters:

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/async_sage_maker.py
async def update_global_inference_gateway(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    identifier: Optional[
        "capo_sagemaker.types.global_inference_gateway_identifier.GlobalInferenceGatewayIdentifier"
    ] = None,
    routing: Optional[
        "capo_sagemaker.types.global_inference_gateway_routing.GlobalInferenceGatewayRouting"
    ] = None,
) -> "capo_sagemaker.types.update_global_inference_gateway_response.UpdateGlobalInferenceGatewayResponse":
    """Updates the routing configuration of a global inference gateway. To add or remove in-cluster inference gateways, use `AddInferenceGateway` and `RemoveInferenceGateway`. This operation is asynchronous: the global inference gateway moves to the `UPDATING` status. The operation fails with `ConflictException` while another operation is in progress on the global inference gateway.

    Args:
        identifier: <p>The name, Amazon Resource Name (ARN), or ID of the global inference gateway to update.</p>
        routing: <p>The new routing configuration of the global inference gateway.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_global_inference_gateway_request.UpdateGlobalInferenceGatewayRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_global_inference_gateway_response.UpdateGlobalInferenceGatewayResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_global_inference_gateway

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateGlobalInferenceGateway")
    )
    input_: capo_sagemaker.types.update_global_inference_gateway_request.UpdateGlobalInferenceGatewayRequest = {}
    if identifier is not None:
        input_["identifier"] = identifier
    if routing is not None:
        input_["routing"] = routing

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