/// <summary> /// Deletes a ledger and all of its contents. This action is irreversible. /// /// /// <para> /// If deletion protection is enabled, you must first disable it before you can delete /// the ledger using the QLDB API or the AWS Command Line Interface (AWS CLI). You can /// disable it by calling the <code>UpdateLedger</code> operation to set the flag to <code>false</code>. /// The QLDB console disables deletion protection for you when you use it to delete a /// ledger. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteLedger service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteLedger service method, as returned by QLDB.</returns> /// <exception cref="Amazon.QLDB.Model.InvalidParameterException"> /// One or more parameters in the request aren't valid. /// </exception> /// <exception cref="Amazon.QLDB.Model.ResourceInUseException"> /// The specified resource can't be modified at this time. /// </exception> /// <exception cref="Amazon.QLDB.Model.ResourceNotFoundException"> /// The specified resource doesn't exist. /// </exception> /// <exception cref="Amazon.QLDB.Model.ResourcePreconditionNotMetException"> /// The operation failed because a condition wasn't satisfied in advance. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/DeleteLedger">REST API Reference for DeleteLedger Operation</seealso> public virtual Task <DeleteLedgerResponse> DeleteLedgerAsync(DeleteLedgerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteLedgerRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteLedgerResponseUnmarshaller.Instance; return(InvokeAsync <DeleteLedgerResponse>(request, options, cancellationToken)); }
internal virtual DeleteLedgerResponse DeleteLedger(DeleteLedgerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteLedgerRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteLedgerResponseUnmarshaller.Instance; return(Invoke <DeleteLedgerResponse>(request, options)); }
public void RunDeleteLedger() { UpdateLedgerDeletionProtection(this.ledgerName, false); var deleteRequest = new DeleteLedgerRequest { Name = this.ledgerName }; this.amazonQldbClient.DeleteLedgerAsync(deleteRequest).GetAwaiter().GetResult(); WaitForDeletion(this.ledgerName); }
public void RunForceDeleteLedger() { try { UpdateLedgerDeletionProtection(this.ledgerName, false); var deleteRequest = new DeleteLedgerRequest { Name = this.ledgerName }; this.amazonQldbClient.DeleteLedgerAsync(deleteRequest).GetAwaiter().GetResult(); WaitForDeletion(this.ledgerName); } catch (ResourceNotFoundException) { return; } }