-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.ts
62 lines (57 loc) · 1.38 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { DataSourceJsonData } from '@grafana/data';
import { DataQuery } from '@grafana/schema';
/**
* Possible values of CriblQuery.type
*/
export type QueryType = 'adhoc' | 'saved';
/**
* Query used with Cribl Search. Can either use a saved search or run an adhoc query.
*/
export type CriblQuery = DataQuery & (
{
type: 'adhoc';
/**
* Ad-hoc query (Kusto)
*/
query: string;
} | {
type: 'saved';
/**
* ID of the Cribl saved search
*/
savedSearchId: string;
}
);
/**
* Default query with which we pre-populate the UI
*/
export const DEFAULT_QUERY: Partial<CriblQuery> = {
type: 'adhoc',
query: '', // tempting to have a real query here, but for now it's a blank canvas
};
/**
* Options configured for each CriblDataSource instance
*/
export interface CriblDataSourceOptions extends DataSourceJsonData {
/**
* Base URL to the Cribl organization/tenant site (i.e. https://your-org-id.cribl.cloud)
*/
criblOrgBaseUrl: string;
/**
* Client ID used to generate OAuth tokens
*/
clientId?: string;
/**
* How long we're willing to wait for a query to run before giving up on it.
*/
queryTimeoutSec?: number;
}
/**
* Value that is used in the backend, but never sent over HTTP to the frontend
*/
export interface CriblSecureJsonData {
/**
* Client secret used to generate OAuth tokens
*/
clientSecret?: string;
}