Share via


ConfidentialLedgerCertificateClient.GetLedgerIdentity Method

Definition

[Protocol Method] Gets identity information for a Confidential Ledger instance.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response GetLedgerIdentity (string ledgerId, Azure.RequestContext context = default);
abstract member GetLedgerIdentity : string * Azure.RequestContext -> Azure.Response
override this.GetLedgerIdentity : string * Azure.RequestContext -> Azure.Response
Public Overridable Function GetLedgerIdentity (ledgerId As String, Optional context As RequestContext = Nothing) As Response

Parameters

ledgerId
String

Id of the Confidential Ledger instance to get information for.

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

ledgerId is null.

ledgerId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetLedgerIdentity and parse the result.

ConfidentialLedgerCertificateClient client = new ConfidentialLedgerCertificateClient(new Uri("http://localhost:3000"));

Response response = client.GetLedgerIdentity("<ledgerId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("ledgerTlsCertificate").ToString());

This sample shows how to call GetLedgerIdentity with all parameters and parse the result.

ConfidentialLedgerCertificateClient client = new ConfidentialLedgerCertificateClient(new Uri("http://localhost:3000"));

Response response = client.GetLedgerIdentity("<ledgerId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("ledgerId").ToString());
Console.WriteLine(result.GetProperty("ledgerTlsCertificate").ToString());

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for LedgerIdentityInformation:

{
  ledgerId: string, # Optional. Id for the ledger.
  ledgerTlsCertificate: string, # Required. PEM-encoded certificate used for TLS by the Confidential Ledger.
}

Applies to