Live: optionally send queries over websocket connection (#41653)
Co-authored-by: ArturWierzbicki <artur.wierzbicki@grafana.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
ArturWierzbicki
Ryan McKinley
parent
bfecbdc0bd
commit
b4204628e4
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
DataFrame,
|
||||
DataFrameJSON,
|
||||
DataQueryRequest,
|
||||
DataQueryResponse,
|
||||
LiveChannelAddress,
|
||||
LiveChannelEvent,
|
||||
@@ -38,12 +39,20 @@ export interface StreamingFrameOptions {
|
||||
*/
|
||||
export interface LiveDataStreamOptions {
|
||||
addr: LiveChannelAddress;
|
||||
frame?: DataFrame; // initial results
|
||||
frame?: DataFrameJSON; // initial results
|
||||
key?: string;
|
||||
buffer?: Partial<StreamingFrameOptions>;
|
||||
filter?: LiveDataFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha -- experimental: send a normal query request over websockt
|
||||
*/
|
||||
export interface LiveQueryDataOptions {
|
||||
request: DataQueryRequest;
|
||||
body: any; // processed queries, same as sent to `/api/query/ds`
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha -- experimental
|
||||
*/
|
||||
@@ -63,6 +72,15 @@ export interface GrafanaLiveSrv {
|
||||
*/
|
||||
getDataStream(options: LiveDataStreamOptions): Observable<DataQueryResponse>;
|
||||
|
||||
/**
|
||||
* Execute a query over the live websocket and potentiall subscribe to a live channel.
|
||||
*
|
||||
* Since the initial request and subscription are on the same socket, this will support HA setups
|
||||
*
|
||||
* @alpha -- this function requires the feature toggle `queryOverLive` to be set
|
||||
*/
|
||||
getQueryData(options: LiveQueryDataOptions): Observable<DataQueryResponse>;
|
||||
|
||||
/**
|
||||
* For channels that support presence, this will request the current state from the server.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user