You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
767 B

import HasticAPI from './hastic_api';
import { BackendSrv } from 'grafana/app/core/services/backend_srv';
export class HasticDatasource {
private hastic: HasticAPI;
/** @ngInject */
constructor(instanceSettings: any, backendSrv: BackendSrv) {
this.hastic = new HasticAPI(instanceSettings, backendSrv);
}
async query(options: any) {
console.log(options);
}
async testDatasource() {
try {
await this.hastic.get('/');
return {
status: 'success', title: 'Success',
message: 'Datasource is working'
};
} catch(err) {
console.error(err);
return {
status: 'error', title: 'Error',
message: err.message
};
}
}
metricFindQuery(options: any) {
return [];
}
}