ledger_entries
Creates, updates, deletes, gets or lists a ledger_entries resource.
Overview
| Name | ledger_entries |
| Type | Resource |
| Id | azure.confidential_ledger_dataplane.ledger_entries |
Fields
The following fields are returned by SELECT queries:
- get_ledger_entry
- list_ledger_entries
| Name | Datatype | Description |
|---|---|---|
entry | object | An entry in the ledger. |
state | string | State of a ledger query. Required. Known values are: "Loading" and "Ready". (Loading, Ready) |
| Name | Datatype | Description |
|---|---|---|
collectionId | string | The collection identifier for this ledger entry. |
contents | string | Contents of the ledger entry. Required. |
postHooks | array | List of user defined function hooks to be executed after the ledger entry is written. |
preHooks | array | List of user defined function hooks to be executed before the ledger entry is written. |
transactionId | string | A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ledger_entry | select | transaction_id, ledger_endpoint | collectionId | 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. |
list_ledger_entries | select | ledger_endpoint | collectionId, fromTransactionId, toTransactionId, tag | Gets 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_entry | insert | ledger_endpoint, contents | collectionId, tags | Writes 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.
| Name | Datatype | Description |
|---|---|---|
ledger_endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client ledgerEndpoint parameter. (default: ) |
transaction_id | string | Identifies a write transaction. Required. |
collectionId | string | The collection id. Default value is None. |
fromTransactionId | string | Specify the first transaction ID in a range. Default value is None. |
tag | string | Single tag. Default value is None. |
tags | string | Comma separated tags. Default value is None. |
toTransactionId | string | Specify the last transaction ID in a range. Default value is None. |
SELECT examples
- get_ledger_entry
- list_ledger_entries
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 }}'
;
Gets 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.
SELECT
collectionId,
contents,
postHooks,
preHooks,
transactionId
FROM azure.confidential_ledger_dataplane.ledger_entries
WHERE ledger_endpoint = '{{ ledger_endpoint }}' -- required
AND collectionId = '{{ collectionId }}'
AND fromTransactionId = '{{ fromTransactionId }}'
AND toTransactionId = '{{ toTransactionId }}'
AND tag = '{{ tag }}'
;
INSERT examples
- create_ledger_entry
- Manifest
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
;
# Description fields are for documentation purposes
- name: ledger_entries
props:
- name: ledger_endpoint
value: "{{ ledger_endpoint }}"
description: Required parameter for the ledger_entries resource.
- name: contents
value: "{{ contents }}"
description: |
Contents of the ledger entry. Required.
- name: preHooks
description: |
List of user defined function hooks to be executed before the ledger entry is written.
value:
- functionId: "{{ functionId }}"
properties:
arguments:
- "{{ arguments }}"
exportedFunctionName: "{{ exportedFunctionName }}"
runtimeOptions:
log_exception_details: {{ log_exception_details }}
max_cached_interpreters: {{ max_cached_interpreters }}
max_execution_time_ms: {{ max_execution_time_ms }}
max_heap_bytes: {{ max_heap_bytes }}
max_stack_bytes: {{ max_stack_bytes }}
return_exception_details: {{ return_exception_details }}
- name: postHooks
description: |
List of user defined function hooks to be executed after the ledger entry is written.
value:
- functionId: "{{ functionId }}"
properties:
arguments:
- "{{ arguments }}"
exportedFunctionName: "{{ exportedFunctionName }}"
runtimeOptions:
log_exception_details: {{ log_exception_details }}
max_cached_interpreters: {{ max_cached_interpreters }}
max_execution_time_ms: {{ max_execution_time_ms }}
max_heap_bytes: {{ max_heap_bytes }}
max_stack_bytes: {{ max_stack_bytes }}
return_exception_details: {{ return_exception_details }}
- name: collectionId
value: "{{ collectionId }}"
description: The collection id. Default value is None.
description: The collection id. Default value is None.
- name: tags
value: "{{ tags }}"
description: Comma separated tags. Default value is None.
description: Comma separated tags. Default value is None.