listNodes method
Returns information about the nodes within a network.
Applies to Hyperledger Fabric and Ethereum.
May throw AccessDeniedException.
May throw InternalServiceErrorException.
May throw InvalidRequestException.
May throw ThrottlingException.
Parameter networkId :
The unique identifier of the network for which to list nodes.
Parameter maxResults :
The maximum number of nodes to list.
Parameter memberId :
The unique identifier of the member who owns the nodes to list.
Applies only to Hyperledger Fabric and is required for Hyperledger Fabric.
Parameter nextToken :
The pagination token that indicates the next set of results to retrieve.
Parameter status :
An optional status specifier. If provided, only nodes currently in this
status are listed.
Implementation
Future<ListNodesOutput> listNodes({
required String networkId,
int? maxResults,
String? memberId,
String? nextToken,
NodeStatus? status,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
20,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (memberId != null) 'memberId': [memberId],
if (nextToken != null) 'nextToken': [nextToken],
if (status != null) 'status': [status.value],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/networks/${Uri.encodeComponent(networkId)}/nodes',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListNodesOutput.fromJson(response);
}