Files
grafana/docs/sources/packages_api/runtime/datasourcesrv.md
Marcus Andersson a2d741f60f Docs: run the api-extractor on master to update docs (#23726)
* regenerated packages docs.

* fixed spelling issues.

* fixed spelling issues.
2020-04-21 10:41:50 +02:00

1.3 KiB

+++

-----------------------------------------------------------------------

Do not edit this file. It is automatically generated by API Documenter.

-----------------------------------------------------------------------

title = "DataSourceSrv" keywords = ["grafana","documentation","sdk","@grafana/runtime"] type = "docs" draft = true +++

DataSourceSrv interface

This is the entry point for communicating with a datasource that is added as a plugin (both external and internal). Via this service you will get access to the DataSourceApi that have a rich API for communicating with the datasource.

Signature

export interface DataSourceSrv 

Import

import { DataSourceSrv } from '@grafana/runtime';

Methods

Method Description
get(name, scopedVars)

get method

Signature

get(name?: string, scopedVars?: ScopedVars): Promise<DataSourceApi>;

Parameters

Parameter Type Description
name string name of the datasource plugin you want to use.
scopedVars ScopedVars variables used to interpolate a templated passed as name.

Returns:

Promise<DataSourceApi>