terminalStatus method

Future<bool> terminalStatus()

Lightweight readiness check: GET /api/terminals/{tid}/status.

Returns true when the terminal is ready (HTTP 200) and false when it reports not operable (HTTP 503). Other status codes / transport failures throw (HpsHttpException / HpsConnectionException).

This endpoint carries no response body — the state is signalled purely via the HTTP status code. For a richer, field-based health snapshot use diagnosis.

Implementation

Future<bool> terminalStatus() async {
  final response =
      await _send('GET', _uri('api/terminals/$tid/status', null), null);
  if (response.statusCode == 200) return true;
  if (response.statusCode == 503) return false;
  throw HpsHttpException(
    response.statusCode,
    _errorMessage(response.body, response.statusCode),
    body: response.body,
  );
}