deleteNode method

Future<void> deleteNode({
  1. required String networkId,
  2. required String nodeId,
  3. String? memberId,
})

Deletes a node that your AWS account owns. All data on the node is lost and cannot be recovered.

Applies to Hyperledger Fabric and Ethereum.

May throw InvalidRequestException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ResourceNotReadyException. May throw ThrottlingException. May throw InternalServiceErrorException.

Parameter networkId : The unique identifier of the network that the node is on.

Ethereum public networks have the following NetworkIds:

  • n-ethereum-mainnet
  • n-ethereum-rinkeby
  • n-ethereum-ropsten

Parameter nodeId : The unique identifier of the node.

Parameter memberId : The unique identifier of the member that owns this node.

Applies only to Hyperledger Fabric and is required for Hyperledger Fabric.

Implementation

Future<void> deleteNode({
  required String networkId,
  required String nodeId,
  String? memberId,
}) async {
  ArgumentError.checkNotNull(networkId, 'networkId');
  _s.validateStringLength(
    'networkId',
    networkId,
    1,
    32,
    isRequired: true,
  );
  ArgumentError.checkNotNull(nodeId, 'nodeId');
  _s.validateStringLength(
    'nodeId',
    nodeId,
    1,
    32,
    isRequired: true,
  );
  _s.validateStringLength(
    'memberId',
    memberId,
    1,
    32,
  );
  final $query = <String, List<String>>{
    if (memberId != null) 'memberId': [memberId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/networks/${Uri.encodeComponent(networkId)}/nodes/${Uri.encodeComponent(nodeId)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}