brokers.ts 504 B

1234567891011121314151617
  1. import {
  2. Broker,
  3. ClusterId,
  4. BrokerMetrics,
  5. } from 'redux/interfaces';
  6. import {
  7. BASE_URL,
  8. BASE_PARAMS,
  9. } from 'lib/constants';
  10. export const getBrokers = (clusterId: ClusterId): Promise<Broker[]> =>
  11. fetch(`${BASE_URL}/clusters/${clusterId}/brokers`, { ...BASE_PARAMS })
  12. .then(res => res.json());
  13. export const getBrokerMetrics = (clusterId: ClusterId): Promise<BrokerMetrics> =>
  14. fetch(`${BASE_URL}/clusters/${clusterId}/metrics/broker`, { ...BASE_PARAMS })
  15. .then(res => res.json());