Skip to content

delete_knowledge_base async

delete_knowledge_base(
    knowledge_base_id: UuidOrArn,
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
) -> DeleteKnowledgeBaseResponse

Deletes the knowledge base.

When you use this API to delete an external knowledge base such as Salesforce or ServiceNow, you must also delete the Amazon AppIntegrations DataIntegration. This is because you can't reuse the DataIntegration after it's been associated with an external knowledge base. However, you can delete and recreate it. See DeleteDataIntegration and CreateDataIntegration in the Amazon AppIntegrations API Reference.

Parameters:

  • knowledge_base_id (UuidOrArn) –

    The knowledge base to delete content from. Can be either the ID or the ARN. URLs cannot contain the ARN.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be processed because of conflict in the current state of the resource. For example, if you're using a Create API (such as CreateAssistant) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • ValidationException –

    The input fails to satisfy the constraints specified by a service.

  • UnknownServiceError –

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

Source code in docs_src/capo_wisdom/_services/async_wisdom.py
async def delete_knowledge_base(
    self,
    knowledge_base_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
) -> "capo_wisdom.types.delete_knowledge_base_response.DeleteKnowledgeBaseResponse":
    """<p>Deletes the knowledge base.</p> <note> <p>When you use this API to delete an external knowledge base such as Salesforce or ServiceNow, you must also delete the <a href="https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html">Amazon AppIntegrations</a> DataIntegration. This is because you can't reuse the DataIntegration after it's been associated with an external knowledge base. However, you can delete and recreate it. See <a href="https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html">DeleteDataIntegration</a> and <a href="https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html">CreateDataIntegration</a> in the <i>Amazon AppIntegrations API Reference</i>.</p> </note>

    Args:
        knowledge_base_id: <p>The knowledge base to delete content from. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>

    Raises:
        capo_wisdom.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_wisdom.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource. For example, if you're using a <code>Create</code> API (such as <code>CreateAssistant</code>) that accepts name, a conflicting resource (usually with the same name) is being created or mutated.</p>
        capo_wisdom.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_wisdom.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_wisdom.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wisdom.types.delete_knowledge_base_request.DeleteKnowledgeBaseRequest]",
    ) -> AsyncOperationResponse[
        "capo_wisdom.types.delete_knowledge_base_response.DeleteKnowledgeBaseResponse"
    ]:
        import capo_wisdom._operations.wisdom_service.delete_knowledge_base

        (
            output,
            http_response,
        ) = await capo_wisdom._operations.wisdom_service.delete_knowledge_base.async_delete_knowledge_base(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteKnowledgeBase")
    )
    input_: capo_wisdom.types.delete_knowledge_base_request.DeleteKnowledgeBaseRequest = {
        "knowledge_base_id": knowledge_base_id
    }

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