Docs: updated packages reference docs for 7.1.0-beta1. (#25958)

This commit is contained in:
Marcus Andersson
2020-07-01 09:12:35 +02:00
committed by GitHub
parent e93640878d
commit 83df83fa42
97 changed files with 1369 additions and 206 deletions
@@ -31,10 +31,12 @@ import { DataSourceWithBackend } from '@grafana/runtime';
| Method | Modifiers | Description |
| --- | --- | --- |
| [applyTemplateVariables(query)](#applytemplatevariables-method) | | Override to apply template variables |
| [applyTemplateVariables(query, scopedVars)](#applytemplatevariables-method) | | Override to apply template variables. The result is usually also <code>TQuery</code>, but sometimes this can be used to modify the query structure before sending to the backend.<!-- -->NOTE: if you do modify the structure or use template variables, alerting queries may not work as expected |
| [callHealthCheck()](#callhealthcheck-method) | | Run the datasource healthcheck |
| [filterQuery(query)](#filterquery-method) | | Override to skip executing a query |
| [getResource(path, params)](#getresource-method) | | Make a GET request to the datasource resource path |
| [postResource(path, body)](#postresource-method) | | Send a POST request to the datasource resource path |
| [processResponse(res)](#processresponse-method) | | Optionally augment the response before returning the results to the |
| [query(request)](#query-method) | | Ideally final -- any other implementation may not work as expected |
| [testDatasource()](#testdatasource-method) | | Checks the plugin health |
@@ -55,23 +57,26 @@ constructor(instanceSettings: DataSourceInstanceSettings<TOptions>);
### applyTemplateVariables method
Override to apply template variables
Override to apply template variables. The result is usually also `TQuery`<!-- -->, but sometimes this can be used to modify the query structure before sending to the backend.
NOTE: if you do modify the structure or use template variables, alerting queries may not work as expected
<b>Signature</b>
```typescript
/** @virtual */
applyTemplateVariables(query: DataQuery): DataQuery;
applyTemplateVariables(query: TQuery, scopedVars: ScopedVars): Record<string, any>;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| query | <code>DataQuery</code> | |
| query | <code>TQuery</code> | |
| scopedVars | <code>ScopedVars</code> | |
<b>Returns:</b>
`DataQuery`
`Record<string, any>`
### callHealthCheck method
@@ -86,6 +91,26 @@ callHealthCheck(): Promise<HealthCheckResult>;
`Promise<HealthCheckResult>`
### filterQuery method
Override to skip executing a query
<b>Signature</b>
```typescript
/** @virtual */
filterQuery?(query: TQuery): boolean;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| query | <code>TQuery</code> | |
<b>Returns:</b>
`boolean`
### getResource method
Make a GET request to the datasource resource path
@@ -126,6 +151,25 @@ postResource(path: string, body?: any): Promise<any>;
`Promise<any>`
### processResponse method
Optionally augment the response before returning the results to the
<b>Signature</b>
```typescript
processResponse?(res: DataQueryResponse): Promise<DataQueryResponse>;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| res | <code>DataQueryResponse</code> | |
<b>Returns:</b>
`Promise<DataQueryResponse>`
### query method
Ideally final -- any other implementation may not work as expected
@@ -133,13 +177,13 @@ Ideally final -- any other implementation may not work as expected
<b>Signature</b>
```typescript
query(request: DataQueryRequest): Observable<DataQueryResponse>;
query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| request | <code>DataQueryRequest</code> | |
| request | <code>DataQueryRequest&lt;TQuery&gt;</code> | |
<b>Returns:</b>