getHealth method

Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<TargetPoolInstanceHealth> getHealth(
  GetHealthTargetPoolRequest request,
) async {
  final url = _endPoint.replace(
    path:
        '/compute/v1/projects/${request.project}/regions/${request.region}/targetPools/${request.targetPool}/getHealth',
  );
  final response = await _client.post(
    url,
    body: request.instanceReferenceResource,
  );
  return TargetPoolInstanceHealth.fromJson(response);
}