Skip to content

delete_archive

delete_archive(
    archive_name: ArchiveName,
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
) -> DeleteArchiveResponse

Deletes the specified archive.

Parameters:

  • archive_name (ArchiveName) –

    The name of the archive to delete.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/cloud_watch_events.py
def delete_archive(
    self,
    archive_name: "capo_cloudwatch_events.types.archive_name.ArchiveName",
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
) -> "capo_cloudwatch_events.types.delete_archive_response.DeleteArchiveResponse":
    """<p>Deletes the specified archive.</p>

    Args:
        archive_name: <p>The name of the archive to delete.</p>

    Raises:
        capo_cloudwatch_events.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
        capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_cloudwatch_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</p>
        capo_cloudwatch_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_events.types.delete_archive_request.DeleteArchiveRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_events.types.delete_archive_response.DeleteArchiveResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.delete_archive

        output, http_response = (
            capo_cloudwatch_events._operations.aws_events.delete_archive.delete_archive(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteArchive")
    )
    input_: capo_cloudwatch_events.types.delete_archive_request.DeleteArchiveRequest = {
        "archive_name": archive_name
    }

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