ConfidentialLedgerClient.GetConstitution(RequestContext) 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.
[Protocol Method] Gets the constitution used for governance.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual Azure.Response GetConstitution (Azure.RequestContext context = default);
abstract member GetConstitution : Azure.RequestContext -> Azure.Response
override this.GetConstitution : Azure.RequestContext -> Azure.Response
Public Overridable Function GetConstitution (Optional context As RequestContext = Nothing) As Response
Parameters
- 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 GetConstitution and parse the result.
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);
Response response = client.GetConstitution();
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("digest").ToString());
Console.WriteLine(result.GetProperty("script").ToString());
This sample shows how to call GetConstitution with all request content and parse the result.
TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);
Response response = client.GetConstitution();
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("digest").ToString());
Console.WriteLine(result.GetProperty("script").ToString());
Remarks
The constitution is a script that assesses and applies proposals from consortium members.
Below is the JSON schema for the response payload.
Response Body:
Schema for Constitution
:
{
digest: string, # Required. SHA256 digest of the constitution script.
script: string, # Required. Contents of the constitution.
}
Applies to
Azure SDK for .NET