listNodes method

Future<ListNodesOutput> listNodes({
  1. required String networkId,
  2. int? maxResults,
  3. String? memberId,
  4. String? nextToken,
  5. NodeStatus? status,
})

Returns information about the nodes within a network.

Applies to Hyperledger Fabric and Ethereum.

May throw InvalidRequestException. May throw AccessDeniedException. May throw ThrottlingException. May throw InternalServiceErrorException.

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 {
  ArgumentError.checkNotNull(networkId, 'networkId');
  _s.validateStringLength(
    'networkId',
    networkId,
    1,
    32,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  _s.validateStringLength(
    'memberId',
    memberId,
    1,
    32,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    128,
  );
  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.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/networks/${Uri.encodeComponent(networkId)}/nodes',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListNodesOutput.fromJson(response);
}