api.ts 687 B

12345678910111213141516171819
  1. import { getBackendSrv } from 'app/core/services/backend_srv';
  2. import { ActiveUserStats, LicenseToken } from '../types';
  3. export const getLicenseToken = async (): Promise<LicenseToken> => {
  4. return getBackendSrv().get('/api/licensing/token');
  5. };
  6. export const postLicenseToken = async (token: string): Promise<LicenseToken> => {
  7. return getBackendSrv().post('/api/licensing/token', { token: token });
  8. };
  9. export const renewLicenseToken = async (): Promise<LicenseToken> => {
  10. return getBackendSrv().post('/api/licensing/token/renew', {});
  11. };
  12. export const refreshLicenseStats = async (): Promise<ActiveUserStats> => {
  13. return getBackendSrv().get('/api/licensing/refresh-stats');
  14. };