Skip to content

cancel_ml_model_transform_job async

cancel_ml_model_transform_job(
    id: str,
    *,
    config_overrides: Optional[AsyncneptunedataClientConfig] = None,
    neptune_iam_role_arn: Optional[str] = None,
    clean: Optional[bool] = None,
) -> CancelMLModelTransformJobOutput

Cancels a specified model transform job. See Use a trained model to generate new model artifacts.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:CancelMLModelTransformJob IAM action in that cluster.

Parameters:

  • id (str) –

    The unique ID of the model transform job to be canceled.

  • neptune_iam_role_arn (Optional[str], default: None ) –

    The ARN of an IAM role that provides Neptune access to SageMaker and Amazon S3 resources. This must be listed in your DB cluster parameter group or an error will occur.

  • clean (Optional[bool], default: None ) –

    If this flag is set to TRUE, all Neptune ML S3 artifacts should be deleted when the job is stopped. The default is FALSE.

Raises:

Source code in docs_src/capo_neptunedata/_services/async_neptunedata.py
async def cancel_ml_model_transform_job(
    self,
    id: str,
    *,
    config_overrides: Optional[AsyncneptunedataClientConfig] = None,
    neptune_iam_role_arn: Optional[str] = None,
    clean: Optional[bool] = None,
) -> "capo_neptunedata.types.cancel_ml_model_transform_job_output.CancelMLModelTransformJobOutput":
    """<p>Cancels a specified model transform job. See <a href="https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html">Use a trained model to generate new model artifacts</a>.</p> <p>When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the <a href="https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelmlmodeltransformjob">neptune-db:CancelMLModelTransformJob</a> IAM action in that cluster.</p>

    Args:
        id: <p>The unique ID of the model transform job to be canceled.</p>
        neptune_iam_role_arn: <p>The ARN of an IAM role that provides Neptune access to SageMaker and Amazon S3 resources. This must be listed in your DB cluster parameter group or an error will occur.</p>
        clean: <p>If this flag is set to <code>TRUE</code>, all Neptune ML S3 artifacts should be deleted when the job is stopped. The default is <code>FALSE</code>.</p>

    Raises:
        capo_neptunedata.errors.bad_request_exception.BadRequestException: <p>Raised when a request is submitted that cannot be processed.</p>
        capo_neptunedata.errors.client_timeout_exception.ClientTimeoutException: <p>Raised when a request timed out in the client.</p>
        capo_neptunedata.errors.constraint_violation_exception.ConstraintViolationException: <p>Raised when a value in a request field did not satisfy required constraints.</p>
        capo_neptunedata.errors.illegal_argument_exception.IllegalArgumentException: <p>Raised when an argument in a request is not supported.</p>
        capo_neptunedata.errors.invalid_argument_exception.InvalidArgumentException: <p>Raised when an argument in a request has an invalid value.</p>
        capo_neptunedata.errors.invalid_parameter_exception.InvalidParameterException: <p>Raised when a parameter value is not valid.</p>
        capo_neptunedata.errors.missing_parameter_exception.MissingParameterException: <p>Raised when a required parameter is missing.</p>
        capo_neptunedata.errors.ml_resource_not_found_exception.MLResourceNotFoundException: <p>Raised when a specified machine-learning resource could not be found.</p>
        capo_neptunedata.errors.preconditions_failed_exception.PreconditionsFailedException: <p>Raised when a precondition for processing a request is not satisfied.</p>
        capo_neptunedata.errors.too_many_requests_exception.TooManyRequestsException: <p>Raised when the number of requests being processed exceeds the limit.</p>
        capo_neptunedata.errors.unsupported_operation_exception.UnsupportedOperationException: <p>Raised when a request attempts to initiate an operation that is not supported.</p>
        capo_neptunedata.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptunedata.types.cancel_ml_model_transform_job_input.CancelMLModelTransformJobInput]",
    ) -> AsyncOperationResponse[
        "capo_neptunedata.types.cancel_ml_model_transform_job_output.CancelMLModelTransformJobOutput"
    ]:
        import capo_neptunedata._operations.amazon_neptune_dataplane.cancel_ml_model_transform_job

        (
            output,
            http_response,
        ) = await capo_neptunedata._operations.amazon_neptune_dataplane.cancel_ml_model_transform_job.async_cancel_ml_model_transform_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelMLModelTransformJob")
    )
    input_: capo_neptunedata.types.cancel_ml_model_transform_job_input.CancelMLModelTransformJobInput = {
        "id": id
    }
    if neptune_iam_role_arn is not None:
        input_["neptune_iam_role_arn"] = neptune_iam_role_arn
    if clean is not None:
        input_["clean"] = clean

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