ConfidentialLedgerClient.GetLedgerEntries Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetLedgerEntries(String, String, String, RequestContext) |
[Protocol Method] Gets all ledger entries.
|
GetLedgerEntries(String, String, String, String, RequestContext) |
[Protocol Method] Gets ledger entries from a collection corresponding to a range.
|
GetLedgerEntries(String, String, String, RequestContext)
- Source:
- ConfidentialLedgerClient.cs
- Source:
- ConfidentialLedgerClient.cs
[Protocol Method] Gets all ledger entries.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Pageable<BinaryData> GetLedgerEntries(string collectionId = default, string fromTransactionId = default, string toTransactionId = default, Azure.RequestContext context = default);
public virtual Azure.Pageable<BinaryData> GetLedgerEntries(string collectionId, string fromTransactionId, string toTransactionId, Azure.RequestContext context);
abstract member GetLedgerEntries : string * string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetLedgerEntries : string * string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetLedgerEntries (Optional collectionId As String = Nothing, Optional fromTransactionId As String = Nothing, Optional toTransactionId As String = Nothing, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)
Public Overridable Function GetLedgerEntries (collectionId As String, fromTransactionId As String, toTransactionId As String, context As RequestContext) As Pageable(Of BinaryData)
Parameters
- collectionId
- String
The collection id.
- fromTransactionId
- String
The from transaction id.
- toTransactionId
- String
The to transaction id.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
Service returned a non-success status code.
Examples
This sample shows how to call GetLedgerEntries and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential);
foreach (BinaryData item in client.GetLedgerEntries())
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("contents").ToString());
}
This sample shows how to call GetLedgerEntries with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential);
foreach (BinaryData item in client.GetLedgerEntries(collectionId: "<collectionId>", fromTransactionId: "<fromTransactionId>", toTransactionId: "<toTransactionId>"))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("contents").ToString());
Console.WriteLine(result.GetProperty("collectionId").ToString());
Console.WriteLine(result.GetProperty("transactionId").ToString());
}
Remarks
A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.
Below is the JSON schema for one item in the pageable response.
Response Body:
Schema for LedgerEntries
:
{
contents: string, # Required. Contents of the ledger entry.
collectionId: string, # Optional.
transactionId: string, # Optional. 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.
}
Applies to
GetLedgerEntries(String, String, String, String, RequestContext)
- Source:
- ConfidentialLedgerClient.cs
[Protocol Method] Gets ledger entries from a collection corresponding to a range.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Pageable<BinaryData> GetLedgerEntries(string collectionId = default, string fromTransactionId = default, string toTransactionId = default, string tag = default, Azure.RequestContext context = default);
abstract member GetLedgerEntries : string * string * string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetLedgerEntries : string * string * string * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetLedgerEntries (Optional collectionId As String = Nothing, Optional fromTransactionId As String = Nothing, Optional toTransactionId As String = Nothing, Optional tag As String = Nothing, Optional context As RequestContext = Nothing) As Pageable(Of BinaryData)
Parameters
- collectionId
- String
The collection id.
- fromTransactionId
- String
Specify the first transaction ID in a range.
- toTransactionId
- String
Specify the last transaction ID in a range.
- tag
- String
Single tag.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The Pageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.
Exceptions
Service returned a non-success status code.
Examples
This sample shows how to call GetLedgerEntries and parse the result.
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);
foreach (BinaryData item in client.GetLedgerEntries())
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("contents").ToString());
}
This sample shows how to call GetLedgerEntries with all parameters and parse the result.
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);
foreach (BinaryData item in client.GetLedgerEntries(collectionId: "<collectionId>", fromTransactionId: "<fromTransactionId>", toTransactionId: "<toTransactionId>", tag: "<tag>"))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("contents").ToString());
Console.WriteLine(result.GetProperty("collectionId").ToString());
Console.WriteLine(result.GetProperty("transactionId").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("functionId").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("arguments")[0].ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("exportedFunctionName").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("log_exception_details").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_cached_interpreters").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_execution_time_ms").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_heap_bytes").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_stack_bytes").ToString());
Console.WriteLine(result.GetProperty("preHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("return_exception_details").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("functionId").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("arguments")[0].ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("exportedFunctionName").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("log_exception_details").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_cached_interpreters").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_execution_time_ms").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_heap_bytes").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("max_stack_bytes").ToString());
Console.WriteLine(result.GetProperty("postHooks")[0].GetProperty("properties").GetProperty("runtimeOptions").GetProperty("return_exception_details").ToString());
}