
* fixes so we match the transformer based on name properly. * changed the signature on the FieldMatcher. * introduced a names option so you can filter in name specificly. * changed so the matcher UI uses the new options format. * moved the exported functions together. * changing editors a bit. * made the filter by name work with both regex and name filtering. * fixed failing tests and make sure we always parse regex the same way. * removed unused code. * simplified to make the existing field overrides still working. * fixed issue reported by hugo. * added tests for the name matcher. * added tests for filter by name. * added more tests. * generated new version of the packages docs. * fixed spelling error. * regenerated the docs.
3.8 KiB
+++
-----------------------------------------------------------------------
Do not edit this file. It is automatically generated by API Documenter.
-----------------------------------------------------------------------
title = "DataSourceWithBackend" keywords = ["grafana","documentation","sdk","@grafana/runtime"] type = "docs" +++
DataSourceWithBackend class
Extend this class to implement a data source plugin that is depending on the Grafana backend API.
Signature
export declare class DataSourceWithBackend<TQuery extends DataQuery = DataQuery, TOptions extends DataSourceJsonData = DataSourceJsonData> extends DataSourceApi<TQuery, TOptions>
Import
import { DataSourceWithBackend } from '@grafana/runtime';
Constructors
Constructor | Modifiers | Description |
---|---|---|
constructor(instanceSettings) | Constructs a new instance of the DataSourceWithBackend class |
Methods
Method | Modifiers | Description |
---|---|---|
applyTemplateVariables(query) | Override to apply template variables | |
callHealthCheck() | Run the datasource healthcheck | |
getResource(path, params) | Make a GET request to the datasource resource path | |
postResource(path, body) | Send a POST request to the datasource resource path | |
query(request) | Ideally final -- any other implementation may not work as expected | |
testDatasource() | Checks the plugin health |
constructor(instanceSettings)
Constructs a new instance of the DataSourceWithBackend
class
Signature
constructor(instanceSettings: DataSourceInstanceSettings<TOptions>);
Parameters
Parameter | Type | Description |
---|---|---|
instanceSettings | DataSourceInstanceSettings<TOptions> |
applyTemplateVariables method
Override to apply template variables
Signature
/** @virtual */
applyTemplateVariables(query: DataQuery): DataQuery;
Parameters
Parameter | Type | Description |
---|---|---|
query | DataQuery |
Returns:
DataQuery
callHealthCheck method
Run the datasource healthcheck
Signature
callHealthCheck(): Promise<HealthCheckResult>;
Returns:
Promise<HealthCheckResult>
getResource method
Make a GET request to the datasource resource path
Signature
getResource(path: string, params?: any): Promise<any>;
Parameters
Parameter | Type | Description |
---|---|---|
path | string |
|
params | any |
Returns:
Promise<any>
postResource method
Send a POST request to the datasource resource path
Signature
postResource(path: string, body?: any): Promise<any>;
Parameters
Parameter | Type | Description |
---|---|---|
path | string |
|
body | any |
Returns:
Promise<any>
query method
Ideally final -- any other implementation may not work as expected
Signature
query(request: DataQueryRequest): Observable<DataQueryResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
request | DataQueryRequest |
Returns:
Observable<DataQueryResponse>
testDatasource method
Checks the plugin health
Signature
testDatasource(): Promise<any>;
Returns:
Promise<any>