ConfidentialLedgerClient.GetTransactionStatus(String, RequestContext) Method
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.
[Protocol Method] Gets the status of an entry identified by a transaction id.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response GetTransactionStatus(string transactionId, Azure.RequestContext context = default);
abstract member GetTransactionStatus : string * Azure.RequestContext -> Azure.Response
override this.GetTransactionStatus : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetTransactionStatus (transactionId As String, Optional context As RequestContext = Nothing) As Response
- transactionId
- String
Identifies a write transaction.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
The response returned from the service.
transactionId
is null.
transactionId
is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
This sample shows how to call GetTransactionStatus and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential);
Response response = client.GetTransactionStatus("<transactionId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("transactionId").ToString());
This sample shows how to call GetTransactionStatus with all parameters and parse the result.
Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(endpoint, credential);
Response response = client.GetTransactionStatus("<transactionId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("state").ToString());
Console.WriteLine(result.GetProperty("transactionId").ToString());
Below is the JSON schema for the response payload.
Response Body:
Schema for TransactionStatus
:
{
state: "Committed" | "Pending", # Required. Represents the state of the transaction.
transactionId: string, # Required. 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.
}
Product | Versions |
---|---|
Azure SDK for .NET | Latest, Preview |
Azure SDK for .NET feedback
Azure SDK for .NET is an open source project. Select a link to provide feedback: