Skip to content

delete_ontology_induction

delete_ontology_induction(
    ontology_induction_id: OntologyInductionIdentifier,
    *,
    config_overrides: Optional[ContextClientConfig] = None,
) -> DeleteOntologyInductionResponse

Deletes an ontology induction. You can delete a FAILED or CANCELLED induction, or one whose ontology is PUBLISHED or was deleted after it was published. While the induction is INDUCING, or while its ontology is still a DRAFT, the request fails with ConflictException. To stop a running induction, call CancelOntologyInduction first. To delete a draft ontology and its induction together, call DeleteOntology. Deleting an induction doesn't change its published ontology.

Parameters:

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

    The request failed because of an internal error. Retry the request.

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • ConflictException –

    The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.

  • ResourceNotFoundException –

    The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Delete an ontology induction The following example deletes a CANCELLED ontology induction.

>>> client.delete_ontology_induction(ontology_induction_id='oi-9e8d7c6b5a4f4e3d8c2b1a0f9e8d7c6b')
Delete an ontology induction whose ontology is a draft, which fails with ConflictException
The following example fails with ConflictException because the induction's ontology is still a DRAFT; to delete the draft ontology and its induction together, call DeleteOntology.
>>> client.delete_ontology_induction(ontology_induction_id='oi-4f2a9c7e1b3d4e6f8a0b2c4d6e8f0a1b')
Source code in docs_src/capo_context/_services/context.py
def delete_ontology_induction(
    self,
    ontology_induction_id: "capo_context.types.ontology_induction_identifier.OntologyInductionIdentifier",
    *,
    config_overrides: Optional[ContextClientConfig] = None,
) -> "capo_context.types.delete_ontology_induction_response.DeleteOntologyInductionResponse":
    """<p>Deletes an ontology induction. You can delete a <code>FAILED</code> or <code>CANCELLED</code> induction, or one whose ontology is <code>PUBLISHED</code> or was deleted after it was published. While the induction is <code>INDUCING</code>, or while its ontology is still a <code>DRAFT</code>, the request fails with <code>ConflictException</code>. To stop a running induction, call CancelOntologyInduction first. To delete a draft ontology and its induction together, call DeleteOntology. Deleting an induction doesn't change its published ontology.</p>

    Args:
        ontology_induction_id: <p>The ID or Amazon Resource Name (ARN) of the ontology induction to delete.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.</p>
        capo_context.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Delete an ontology induction
        The following example deletes a CANCELLED ontology induction.

        >>> client.delete_ontology_induction(ontology_induction_id='oi-9e8d7c6b5a4f4e3d8c2b1a0f9e8d7c6b')
        Delete an ontology induction whose ontology is a draft, which fails with ConflictException
        The following example fails with ConflictException because the induction's ontology is still a DRAFT; to delete the draft ontology and its induction together, call DeleteOntology.

        >>> client.delete_ontology_induction(ontology_induction_id='oi-4f2a9c7e1b3d4e6f8a0b2c4d6e8f0a1b')
    """

    def _handler(
        req: "OperationRequest[capo_context.types.delete_ontology_induction_request.DeleteOntologyInductionRequest]",
    ) -> OperationResponse[
        "capo_context.types.delete_ontology_induction_response.DeleteOntologyInductionResponse"
    ]:
        import capo_context._operations.context.delete_ontology_induction

        output, http_response = (
            capo_context._operations.context.delete_ontology_induction.delete_ontology_induction(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteOntologyInduction")
    )
    input_: capo_context.types.delete_ontology_induction_request.DeleteOntologyInductionRequest = {
        "ontology_induction_id": ontology_induction_id
    }

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