次の方法で共有


ConfidentialLedgerClient.GetConstitutionAsync(RequestContext) メソッド

定義

[プロトコルメソッド]ガバナンスに使用される構成を取得します。

  • この プロトコルメソッド を使用すると、高度なシナリオで応答の要求と処理を明示的に作成できます。
public virtual System.Threading.Tasks.Task<Azure.Response> GetConstitutionAsync (Azure.RequestContext context = default);
abstract member GetConstitutionAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetConstitutionAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetConstitutionAsync (Optional context As RequestContext = Nothing) As Task(Of Response)

パラメーター

context
RequestContext

要求コンテキスト。これは、呼び出しごとにクライアント パイプラインの既定の動作をオーバーライドできます。

戻り値

サービスから返された応答。

例外

サービスから成功以外の状態コードが返されました。

このサンプルでは、GetConstitutionAsync を呼び出して結果を解析する方法を示します。

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new ConfidentialLedgerClient(endpoint, credential);

Response response = await client.GetConstitutionAsync();

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

注釈

憲法は、コンソーシアム メンバーからの提案を評価して適用するスクリプトです。

応答ペイロードの JSON スキーマを次に示します。

応答本文:

Constitutionスキーマ:

{
  digest: string, # Required. SHA256 digest of the constitution script.
  script: string, # Required. Contents of the constitution.
}

適用対象