Skip to content

remove_inference_gateway

remove_inference_gateway(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    identifier: Optional[GlobalInferenceGatewayIdentifier] = None,
    cluster_arn: Optional[GlobalInferenceGatewayClusterArn] = None,
    namespace: Optional[GlobalInferenceGatewayKubernetesNamespace] = None,
    name: Optional[GlobalInferenceGatewayKubernetesResourceName] = None,
) -> RemoveInferenceGatewayResponse

Removes an in-cluster inference gateway from a global inference gateway. This operation is asynchronous: the in-cluster inference gateway moves to the REMOVING status, and then no longer appears in ListInferenceGateways. If the in-cluster inference gateway isn't in the global inference gateway, the operation succeeds and returns no status. The operation returns ResourceNotFound only if the global inference gateway doesn't exist. The operation fails with ConflictException while another operation is in progress on the global inference gateway. It fails with ValidationException if the in-cluster inference gateway is the last one, because a global inference gateway must have at least one.

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/sage_maker.py
def remove_inference_gateway(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    identifier: Optional[
        "capo_sagemaker.types.global_inference_gateway_identifier.GlobalInferenceGatewayIdentifier"
    ] = None,
    cluster_arn: Optional[
        "capo_sagemaker.types.global_inference_gateway_cluster_arn.GlobalInferenceGatewayClusterArn"
    ] = None,
    namespace: Optional[
        "capo_sagemaker.types.global_inference_gateway_kubernetes_namespace.GlobalInferenceGatewayKubernetesNamespace"
    ] = None,
    name: Optional[
        "capo_sagemaker.types.global_inference_gateway_kubernetes_resource_name.GlobalInferenceGatewayKubernetesResourceName"
    ] = None,
) -> "capo_sagemaker.types.remove_inference_gateway_response.RemoveInferenceGatewayResponse":
    """Removes an in-cluster inference gateway from a global inference gateway. This operation is asynchronous: the in-cluster inference gateway moves to the `REMOVING` status, and then no longer appears in `ListInferenceGateways`. If the in-cluster inference gateway isn't in the global inference gateway, the operation succeeds and returns no status. The operation returns `ResourceNotFound` only if the global inference gateway doesn't exist. The operation fails with `ConflictException` while another operation is in progress on the global inference gateway. It fails with `ValidationException` if the in-cluster inference gateway is the last one, because a global inference gateway must have at least one.

    Args:
        identifier: <p>The name, Amazon Resource Name (ARN), or ID of the global inference gateway.</p>
        cluster_arn: <p>The Amazon Resource Name (ARN) of the SageMaker HyperPod cluster that runs the in-cluster inference gateway.</p>
        namespace: <p>The Kubernetes namespace of the in-cluster inference gateway.</p>
        name: <p>The name of the <code>InferenceGatewayConfig</code> resource that defines the in-cluster 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.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.remove_inference_gateway_request.RemoveInferenceGatewayRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.remove_inference_gateway_response.RemoveInferenceGatewayResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.remove_inference_gateway

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveInferenceGateway")
    )
    input_: capo_sagemaker.types.remove_inference_gateway_request.RemoveInferenceGatewayRequest = {}
    if identifier is not None:
        input_["identifier"] = identifier
    if cluster_arn is not None:
        input_["cluster_arn"] = cluster_arn
    if namespace is not None:
        input_["namespace"] = namespace
    if name is not None:
        input_["name"] = name

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