Last update: October 5, 2022
List members of a consortium¶
Members in a Quorum Blockchain Service (QBS) consortium that have the OWNER role can list all current members using the GET
method on the ConsortiumManagement
endpoint of the QBS management API.
The URI endpoint has the following format:
This endpoint requires the following parameters:
{inviterSubscriptionId}
- Subscription ID.{inviterResourceGroupName}
- Resource group name.{inviterBlockchainMemberName}
- Managed app name of the owner of the consortium.
Optionally, you can specify two query parameters:
includeRemoved
- Set totrue
to see members that have left the consortium. The default isfalse
.includeDeleted
- Set totrue
to see members that have had their Azure resources deleted. The default isfalse
.
The following video demonstrates how to interact with the Swagger UI to use the ConsortiumManagement
API to list members of an existing consortium.
Code examples
const subscriptionId = 'ffd08efa-1f25-41b8-b4a1-0b7a5ec6fcd3';
const resourceGroup = 'QbsContosoGroup';
const appName = 'QbsContosoApp';
async function listMembers(includeDeleted, includeRemoved) {
const response = await fetch(
`https://management.onquorum.net/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/ConsenSys.Blockchain/blockchainMembers/${appName}/consortiumMembers?includeDeleted=${includeDeleted}&includeRemoved=${includeRemoved}`
{
method: 'GET'
}
);
return response.json();
}
HttpClient httpClient = new();
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
// https://www.nuget.org/packages/ConsenSys.QBS.Client
ConsenSys.QBS.QbsClient qbs = new(httpClient);
readonly Guid subscriptionId = Guid.Parse("{azureSubscriptionId}");
readonly string resourceGroup = "QbsContosoGroup";
readonly string appName = "QbsContosoApp";
var members = await qbs.ListMembersAsync(subscriptionId, resourceGroup, appName, includeDeleted: false, includeRemoved: false);
foreach (var m in members.Value)
{
Console.WriteLine($"{m.Name}, role: {m.Role}, region: {m.Region}, created on: {m.CreatedDate}");
}
String subscriptionId = "ffd08efa-1f25-41b8-b4a1-0b7a5ec6fcd3";
String resourceGroup = "QbsContosoGroup";
String appName = "QbsContosoApp";
String includeDeleted = "false";
String includeRemoved = "false";
String endpoint = MessageFormat.format(
"https://management.onquorum.net/subscriptions/{0}/resourceGroups/{1}/providers/ConsenSys.Blockchain/blockchainMembers/{2}/consortiumMembers?includeDeleted={3}&includeRemoved={4}",
subscriptionId, resourceGroup, appName, includeDeleted, includeRemoved);
URL url = new URL(endpoint);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setRequestMethod("GET");
http.setRequestProperty("Bearer", bearerToken);
import requests
subscriptionId = "ffd08efa-1f25-41b8-b4a1-0b7a5ec6fcd3"
resourceGroup = "QbsContosoGroup"
appName = "QbsContosoApp"
includeDeleted = "false"
includeRemoved = "false"
endpoint = "https://management.onquorum.net/subscriptions/{}/resourceGroups/{}/providers/ConsenSys.Blockchain/blockchainMembers/{}/consortiumMembers?includeDeleted={}&includeRemoved={}"
message = requests.get(endpoint.format(subscriptionId, resourceGroup, appName, includeDeleted, includeRemoved))