Documentation ¶
Index ¶
- func ToADXTimeSeries(in *data.Frame) (*data.Frame, error)
- type ARGRequestPayload
- type AzureFrameMD
- type CacheSettings
- type ClusterOption
- type Column
- type DatasourceSettings
- type ErrorResponse
- type HttpError
- type KeyValue
- type MacroData
- type Properties
- type QueryModel
- type RequestPayload
- type Row
- type Table
- type TableResponse
- type TraceLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToADXTimeSeries ¶
ToADXTimeSeries returns Time series for a query that returns an ADX series type. This done by having a query with make_series as the returned type. The time column must be named "Timestamp". Each Row has: - N Columns for group by items, where each Group by item is a column individual string column - An Array of Values per Aggregation Column - Timestamp column
From the ADX documentation, I believe all series will share the same time index, so we create a wide frame.
Types ¶
type ARGRequestPayload ¶
type ARGRequestPayload struct {
Query string `json:"query"`
}
type AzureFrameMD ¶
type AzureFrameMD struct {
ColumnTypes []string
}
AzureFrameMD is a type to populate a Frame's Custom metadata property.
type CacheSettings ¶
CacheSettings is use to enable caching on a per query basis
func NewCacheSettings ¶
func NewCacheSettings(s *DatasourceSettings, q *backend.DataQuery, qm *QueryModel) *CacheSettings
NewCacheSettings is used to detect what cache settings is applicable for the current query.
type ClusterOption ¶
type DatasourceSettings ¶
type DatasourceSettings struct { ClusterURL string `json:"clusterUrl"` DefaultDatabase string `json:"defaultDatabase"` DataConsistency string `json:"dataConsistency"` CacheMaxAge string `json:"cacheMaxAge"` DynamicCaching bool `json:"dynamicCaching"` EnableUserTracking bool `json:"enableUserTracking"` // QueryTimeoutRaw is a duration string set in the datasource settings and corresponds // to the server execution timeout. QueryTimeoutRaw string `json:"queryTimeout"` // QueryTimeout the parsed duration of QueryTimeoutRaw. QueryTimeout time.Duration `json:"-"` // ServerTimeoutValue is the QueryTimeout formatted as a MS Timespan // which is used as a connection property option. ServerTimeoutValue string `json:"-"` OpenAIAPIKey string EnforceTrustedEndpoints bool `json:"-"` }
DatasourceSettings holds the datasource configuration information for Azure Data Explorer's API that is needed to execute a request against Azure's Data Explorer API.
func (*DatasourceSettings) Load ¶
func (d *DatasourceSettings) Load(config backend.DataSourceInstanceSettings) error
newDataSourceData creates a dataSourceData from the plugin API's DatasourceInfo's JSONData and Encrypted JSONData which contains the information needed to connected to the datasource. It also sets the QueryTimeout and ServerTimeoutValues by parsing QueryTimeoutRaw.
type ErrorResponse ¶
type ErrorResponse struct { Error struct { Message string `json:"message"` Type string `json:"@type"` Description string `json:"@message"` } `json:"error"` }
errorResponse is a minimal structure of Azure Data Explorer's JSON error body,
type MacroData ¶
MacroData contains the information needed for macro expansion.
func NewMacroData ¶
NewMacroData creates a MacroData object from the arguments that can be used to interpolate macros with the Interpolate method.
type Properties ¶
type Properties struct {
Options *options `json:"options,omitempty"`
}
Properties is a property bag of connection string options.
func NewConnectionProperties ¶
func NewConnectionProperties(s *DatasourceSettings, cs *CacheSettings) *Properties
NewConnectionProperties creates ADX connection properties based on datasource settings.
type QueryModel ¶
type QueryModel struct { Format string `json:"resultFormat"` QueryType string `json:"queryType"` Query string `json:"query"` Database string `json:"database"` QuerySource string `json:"querySource"` // used to identify if query came from getSchema, raw mode, etc ClusterUri string `json:"clusterUri,omitempty"` MacroData MacroData }
QueryModel contains the query information from the API call that we use to make a query.
func (*QueryModel) Interpolate ¶
func (qm *QueryModel) Interpolate() (err error)
Interpolate applies macro expansion on the QueryModel's Payload's Query string
type RequestPayload ¶
type RequestPayload struct { DB string `json:"db"` CSL string `json:"csl"` QuerySource string `json:"querySource"` Properties *Properties `json:"properties,omitempty"` }
RequestPayload is the information that makes up a Kusto query for Azure's Data Explorer API.
type TableResponse ¶
TableResponse represents the response struct from Azure's Data Explorer REST API.
func TableFromJSON ¶
func TableFromJSON(rc io.Reader) (*TableResponse, error)