Skip to main content

ledger_entries

Creates, updates, deletes, gets or lists a ledger_entries resource.

Overview

Nameledger_entries
TypeResource
Idazure.confidential_ledger_dataplane.ledger_entries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
entryobjectAn entry in the ledger.
statestringState of a ledger query. Required. Known values are: "Loading" and "Ready". (Loading, Ready)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ledger_entryselecttransaction_id, ledger_endpointcollectionIdGets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value. 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.
list_ledger_entriesselectledger_endpointcollectionId, fromTransactionId, toTransactionId, tagGets ledger entries from a collection corresponding to a range. A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.
create_ledger_entryinsertledger_endpoint, contentscollectionId, tagsWrites a ledger entry. A collection id may optionally be specified.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ledger_endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client ledgerEndpoint parameter. (default: )
transaction_idstringIdentifies a write transaction. Required.
collectionIdstringThe collection id. Default value is None.
fromTransactionIdstringSpecify the first transaction ID in a range. Default value is None.
tagstringSingle tag. Default value is None.
tagsstringComma separated tags. Default value is None.
toTransactionIdstringSpecify the last transaction ID in a range. Default value is None.

SELECT examples

Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value. 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.

SELECT
entry,
state
FROM azure.confidential_ledger_dataplane.ledger_entries
WHERE transaction_id = '{{ transaction_id }}' -- required
AND ledger_endpoint = '{{ ledger_endpoint }}' -- required
AND collectionId = '{{ collectionId }}'
;

INSERT examples

Writes a ledger entry. A collection id may optionally be specified.

INSERT INTO azure.confidential_ledger_dataplane.ledger_entries (
contents,
preHooks,
postHooks,
ledger_endpoint,
collectionId,
tags
)
SELECT
'{{ contents }}' /* required */,
'{{ preHooks }}',
'{{ postHooks }}',
'{{ ledger_endpoint }}',
'{{ collectionId }}',
'{{ tags }}'
RETURNING
collectionId
;