Class ConfidentialLedgerClient
java.lang.Object
com.azure.security.confidentialledger.ConfidentialLedgerClient
Initializes a new instance of the synchronous ConfidentialLedgerClient type.
-
Method Summary
Modifier and TypeMethodDescriptioncreateLedgerEntryWithResponse
(BinaryData entry, RequestOptions requestOptions) A collection id may optionally be specified.createOrUpdateUserWithResponse
(String userId, BinaryData userDetails, RequestOptions requestOptions) A JSON merge patch is applied for existing users.deleteUserWithResponse
(String userId, RequestOptions requestOptions) Deletes a user from the Confidential Ledger.getConstitutionWithResponse
(RequestOptions requestOptions) The constitution is a script that assesses and applies proposals from consortium members.getCurrentLedgerEntryWithResponse
(RequestOptions requestOptions) A collection id may optionally be specified.getEnclaveQuotesWithResponse
(RequestOptions requestOptions) A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.getLedgerEntryWithResponse
(String transactionId, RequestOptions requestOptions) To return older ledger entries, the relevant sections of the ledger must be read from disk and validated.getReceiptWithResponse
(String transactionId, RequestOptions requestOptions) Gets a receipt certifying ledger contents at a particular transaction id.getTransactionStatusWithResponse
(String transactionId, RequestOptions requestOptions) Gets the status of an entry identified by a transaction id.getUserWithResponse
(String userId, RequestOptions requestOptions) Gets a user.listCollections
(RequestOptions requestOptions) Collection ids are user-created collections of ledger entries.listConsortiumMembers
(RequestOptions requestOptions) Consortium members can manage the Confidential Ledger.listLedgerEntries
(RequestOptions requestOptions) A collection id may optionally be specified.
-
Method Details
-
getConstitutionWithResponse
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
. - 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
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
PagedIterable
. - 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
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
. - 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
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:
- collections returned in response to a query as paginated response with
PagedIterable
. - 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
A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.Query Parameters
Query Parameters Name Type Required Description collectionId String No The collection id. fromTransactionId String No Specify the first transaction ID in a range. toTransactionId String No Specify the last transaction ID in a range. 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
PagedIterable
. - 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 Response<BinaryData> createLedgerEntryWithResponse(BinaryData entry, RequestOptions requestOptions) A collection id may optionally be specified.Query Parameters
Query Parameters Name Type Required Description collectionId String No The collection id. 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
. - 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 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 Name Type Required Description collectionId String No The collection id. 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
. - 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 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
. - 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 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
. - 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
A collection id may optionally be specified.Query Parameters
Query Parameters Name Type Required Description collectionId String No The collection id. 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
. - 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
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
. - 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
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
. - 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 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
. - 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.
-