nodeConfig method

Future<NodeConfig> nodeConfig(
  1. String nodeId
)

Gets the configuration of a single node.

Will throw an exception when there is a failure containing a description of the failure.

Implementation

Future<NodeConfig> nodeConfig(String nodeId) async {
  final uri = _urlBase.getPath(_nodeConfig, {
    'nodeid': nodeId,
  });

  final resp = await get(
    uri,
    headers: {
      URLBase.authHeader: accessToken,
    },
  );
  final Map<String, dynamic> bodyResp =
      await JsonIsolate().decodeJson(resp.body);
  if (resp.statusCode != 200) {
    throw bodyResp['description'];
  }

  return NodeConfig.fromJson(bodyResp);
}