Commit 08ada202 by Ryan McKinley Committed by Torkel Ödegaard

@grafana/runtime: Expose datasourceRequest in backendSrv

parent 53f80883
......@@ -12,6 +12,13 @@ export type BackendSrvRequest = {
// Show a message with the result
showSuccessAlert?: boolean;
// A requestID is provided by the datasource as a unique identifier for a
// particular query. If the requestID exists, the promise it is keyed to
// is canceled, canceling the previous datasource request if it is still
// in-flight.
requestId?: string;
// Allow any other parameters
[key: string]: any;
};
......@@ -29,6 +36,9 @@ export interface BackendSrv {
// If there is an error, set: err.isHandled = true
// otherwise the backend will show a message for you
request(options: BackendSrvRequest): Promise<any>;
// DataSource requests add hooks into the query inspector
datasourceRequest(options: BackendSrvRequest): Promise<any>;
}
let singletonInstance: BackendSrv;
......
......@@ -143,7 +143,7 @@ export class BackendSrv implements BackendService {
}
}
datasourceRequest(options: any) {
datasourceRequest(options: BackendSrvRequest) {
let canceler: angular.IDeferred<any> = null;
options.retry = options.retry || 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment