getNodeStatus method
Get the connectivity status for the node.
Will throw an exception when there is a failure containing a description of the failure.
Implementation
Future<NodeConnectivity> getNodeStatus(String nodeId) async {
final uri = _urlBase.getPath(_nodeStatus, {
'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 NodeConnectivity.fromJson(bodyResp['connectivity']);
}