Class ConfidentialLedgerAsyncClient

java.lang.Object
com.azure.security.confidentialledger.ConfidentialLedgerAsyncClient

public final class ConfidentialLedgerAsyncClient extends Object
Initializes a new instance of the asynchronous ConfidentialLedgerClient type.
  • Method Details

    • getConstitutionWithResponse

      public Mono<Response<BinaryData>> getConstitutionWithResponse(RequestOptions requestOptions)
      The constitution is a script that assesses and applies proposals from consortium members.

      Response Body Schema

      
       {
           digest: String (Required)
           script: String (Required)
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the governance script for the application along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listConsortiumMembers

      public PagedFlux<BinaryData> listConsortiumMembers(RequestOptions requestOptions)
      Consortium members can manage the Confidential Ledger.

      Response Body Schema

      
       {
           members (Required): [
                (Required){
                   certificate: String (Required)
                   id: String (Required)
               }
           ]
           nextLink: String (Optional)
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      list of members in the consortium as paginated response with PagedFlux.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getEnclaveQuotesWithResponse

      public Mono<Response<BinaryData>> getEnclaveQuotesWithResponse(RequestOptions requestOptions)
      A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.

      Response Body Schema

      
       {
           currentNodeId: String (Required)
           enclaveQuotes (Required): {
               String (Required): {
                   nodeId: String (Required)
                   mrenclave: String (Optional)
                   quoteVersion: String (Required)
                   raw: String (Required)
               }
           }
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      information about the enclaves running the Confidential Ledger along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listCollections

      public PagedFlux<BinaryData> listCollections(RequestOptions requestOptions)
      Collection ids are user-created collections of ledger entries.

      Response Body Schema

      
       {
           collections (Required): [
                (Required){
                   collectionId: String (Required)
               }
           ]
           nextLink: String (Optional)
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      paginated collections returned in response to a query as paginated response with PagedFlux.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • listLedgerEntries

      public PagedFlux<BinaryData> listLedgerEntries(RequestOptions requestOptions)
      A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      collectionIdStringNoThe collection id.
      fromTransactionIdStringNoSpecify the first transaction ID in a range.
      toTransactionIdStringNoSpecify the last transaction ID in a range.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

      
       {
           state: String(Loading/Ready) (Required)
           nextLink: String (Optional)
           entries (Required): [
                (Required){
                   contents: String (Required)
                   collectionId: String (Optional)
                   transactionId: String (Optional)
               }
           ]
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      paginated ledger entries returned in response to a query as paginated response with PagedFlux.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • createLedgerEntryWithResponse

      public Mono<Response<BinaryData>> createLedgerEntryWithResponse(BinaryData entry, RequestOptions requestOptions)
      A collection id may optionally be specified.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      collectionIdStringNoThe collection id.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Request Body Schema

      
       {
           contents: String (Required)
           collectionId: String (Optional)
           transactionId: String (Optional)
       }
       

      Response Body Schema

      
       {
           collectionId: String (Required)
       }
       
      Parameters:
      entry - Ledger entry.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      returned as a result of a write to the Confidential Ledger, the transaction id in the response indicates when the write will become durable along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getLedgerEntryWithResponse

      public Mono<Response<BinaryData>> getLedgerEntryWithResponse(String transactionId, RequestOptions requestOptions)
      To return older ledger entries, the relevant sections of the ledger must be read from disk and validated. To prevent blocking within the enclave, the response will indicate whether the entry is ready and part of the response, or if the loading is still ongoing.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      collectionIdStringNoThe collection id.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

      
       {
           state: String(Loading/Ready) (Required)
           entry (Optional): {
               contents: String (Required)
               collectionId: String (Optional)
               transactionId: String (Optional)
           }
       }
       
      Parameters:
      transactionId - Identifies a write transaction.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the result of querying for a ledger entry from an older transaction id along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getReceiptWithResponse

      public Mono<Response<BinaryData>> getReceiptWithResponse(String transactionId, RequestOptions requestOptions)
      Gets a receipt certifying ledger contents at a particular transaction id.

      Response Body Schema

      
       {
           receipt (Optional): {
               cert: String (Optional)
               leaf: String (Optional)
               leafComponents (Optional): {
                   claimsDigest: String (Optional)
                   commitEvidence: String (Optional)
                   writeSetDigest: String (Optional)
               }
               nodeId: String (Required)
               proof (Required): [
                    (Required){
                       left: String (Optional)
                       right: String (Optional)
                   }
               ]
               root: String (Optional)
               serviceEndorsements (Optional): [
                   String (Optional)
               ]
               signature: String (Required)
           }
           state: String(Loading/Ready) (Required)
           transactionId: String (Required)
       }
       
      Parameters:
      transactionId - Identifies a write transaction.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a receipt certifying ledger contents at a particular transaction id along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getTransactionStatusWithResponse

      public Mono<Response<BinaryData>> getTransactionStatusWithResponse(String transactionId, RequestOptions requestOptions)
      Gets the status of an entry identified by a transaction id.

      Response Body Schema

      
       {
           state: String(Committed/Pending) (Required)
           transactionId: String (Required)
       }
       
      Parameters:
      transactionId - Identifies a write transaction.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the status of an entry identified by a transaction id along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getCurrentLedgerEntryWithResponse

      public Mono<Response<BinaryData>> getCurrentLedgerEntryWithResponse(RequestOptions requestOptions)
      A collection id may optionally be specified.

      Query Parameters

      Query Parameters
      NameTypeRequiredDescription
      collectionIdStringNoThe collection id.
      You can add these to a request with RequestOptions.addQueryParam(java.lang.String, java.lang.String)

      Response Body Schema

      
       {
           contents: String (Required)
           collectionId: String (Optional)
           transactionId: String (Optional)
       }
       
      Parameters:
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      an entry in the ledger along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • deleteUserWithResponse

      public Mono<Response<Void>> deleteUserWithResponse(String userId, RequestOptions requestOptions)
      Deletes a user from the Confidential Ledger.
      Parameters:
      userId - The user id, either an AAD object ID or certificate fingerprint.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      the Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • getUserWithResponse

      public Mono<Response<BinaryData>> getUserWithResponse(String userId, RequestOptions requestOptions)
      Gets a user.

      Response Body Schema

      
       {
           assignedRole: String(Administrator/Contributor/Reader) (Required)
           userId: String (Optional)
       }
       
      Parameters:
      userId - The user id, either an AAD object ID or certificate fingerprint.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      a user along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.
    • createOrUpdateUserWithResponse

      public Mono<Response<BinaryData>> createOrUpdateUserWithResponse(String userId, BinaryData userDetails, RequestOptions requestOptions)
      A JSON merge patch is applied for existing users.

      Request Body Schema

      
       {
           assignedRole: String(Administrator/Contributor/Reader) (Required)
           userId: String (Optional)
       }
       

      Response Body Schema

      
       {
           assignedRole: String(Administrator/Contributor/Reader) (Required)
           userId: String (Optional)
       }
       
      Parameters:
      userId - The user id, either an AAD object ID or certificate fingerprint.
      userDetails - Details about a Confidential Ledger user.
      requestOptions - The options to configure the HTTP request before HTTP client sends it.
      Returns:
      details about a Confidential Ledger user along with Response on successful completion of Mono.
      Throws:
      HttpResponseException - thrown if the request is rejected by server.
      ClientAuthenticationException - thrown if the request is rejected by server on status code 401.
      ResourceNotFoundException - thrown if the request is rejected by server on status code 404.
      ResourceModifiedException - thrown if the request is rejected by server on status code 409.