The request function can be used to perform a remote call by specifying a BackendSrvRequest. To make the BackendSrv a bit easier to use we have added a couple of shorthand functions that will use default values executing the request.

Signature

Import

    Remarks

    By default, Grafana displays an error message alert if the remote call fails. To prevent this from happening showErrorAlert = true on the options object.

    Methods

    Signature

    1. datasourceRequest<T = any>(options: BackendSrvRequest): Promise<FetchResponse<T>>;

    Parameters

    ParameterTypeDescription
    optionsBackendSrvRequest

    Returns:

    Promise<FetchResponse<T>>

    delete method

    Signature

    Parameters

    ParameterTypeDescription
    urlstring

    Returns:

    Observable http request interface

    Signature

    1. fetch<T>(options: BackendSrvRequest): Observable<FetchResponse<T>>;

    Parameters

    Returns:

    get method

    Signature

    1. get(url: string, params?: any, requestId?: string): Promise<any>;

    Parameters

    ParameterTypeDescription
    urlstring
    paramsany
    requestIdstring

    Returns:

    Promise<any>

    Signature

    Parameters

    ParameterTypeDescription
    urlstring
    dataany

    Returns:

    post method

    Signature

    Parameters

    Returns:

    Promise<any>

    Signature

      Parameters

      ParameterTypeDescription
      urlstring
      dataany

      Returns:

      Promise<any>

      request method

      Signature

      Parameters

      ParameterTypeDescription
      optionsBackendSrvRequest

      Returns: