Elastic Search: Fix BasePipelineMetricAggregation schema type (#64335)

* Fix type

* Tweak BaseBucketAggregation type

* Remove comment
This commit is contained in:
Alex Khomenko 2023-03-08 13:12:44 +02:00 committed by GitHub
parent 42c32504be
commit 4c30403904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 126 additions and 187 deletions

View File

@ -38,90 +38,85 @@ It extends [DataQuery](#dataquery).
It extends [BucketAggregationWithField](#bucketaggregationwithfield).
| Property | Type | Required | Description |
|------------|---------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | [object](#settings) | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| Property | Type | Required | Description |
|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
### BucketAggregationWithField
It extends [BaseBucketAggregation](#basebucketaggregation).
| Property | Type | Required | Description |
|------------|---------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | |
| `settings` | [object](#settings) | No | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
| Property | Type | Required | Description |
|------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | |
| `settings` | | No | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
### BaseBucketAggregation
| Property | Type | Required | Description |
|------------|---------------------|----------|---------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | |
| `type` | string | **Yes** | Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `settings` | [object](#settings) | No | |
### Settings
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| Property | Type | Required | Description |
|------------|--------|----------|---------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | |
| `type` | string | **Yes** | Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `settings` | | No | |
### Filters
It extends [BaseBucketAggregation](#basebucketaggregation).
| Property | Type | Required | Description |
|------------|---------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `settings` | [object](#settings) | No | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
| Property | Type | Required | Description |
|------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `settings` | | No | *(Inherited from [BaseBucketAggregation](#basebucketaggregation))* |
### GeoHashGrid
It extends [BucketAggregationWithField](#bucketaggregationwithfield).
| Property | Type | Required | Description |
|------------|---------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | [object](#settings) | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| Property | Type | Required | Description |
|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
### Histogram
It extends [BucketAggregationWithField](#bucketaggregationwithfield).
| Property | Type | Required | Description |
|------------|---------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | [object](#settings) | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| Property | Type | Required | Description |
|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
### Nested
It extends [BucketAggregationWithField](#bucketaggregationwithfield).
| Property | Type | Required | Description |
|------------|---------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | [object](#settings) | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| Property | Type | Required | Description |
|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
### Terms
It extends [BucketAggregationWithField](#bucketaggregationwithfield).
| Property | Type | Required | Description |
|------------|---------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | [object](#settings) | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| Property | Type | Required | Description |
|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))*<br/>Possible values are: `terms`, `filters`, `geohash_grid`, `date_histogram`, `histogram`, `nested`. |
| `field` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `id` | string | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
| `settings` | | No | *(Inherited from [BucketAggregationWithField](#bucketaggregationwithfield))* |
### DataQuery
@ -222,11 +217,11 @@ It extends [MetricAggregationWithField](#metricaggregationwithfield).
| Property | Type | Required | Description |
|---------------|---------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [MetricAggregationWithField](#metricaggregationwithfield))*<br/>Possible values are: `count`, `avg`, `sum`, `min`, `max`, `extended_stats`, `percentiles`, `cardinality`, `raw_document`, `raw_data`, `logs`, `rate`, `top_metrics`, `moving_avg`, `moving_fn`, `derivative`, `serial_diff`, `cumulative_sum`, `bucket_script`. |
| `field` | string | No | *(Inherited from [MetricAggregationWithField](#metricaggregationwithfield))* |
| `hide` | boolean | No | *(Inherited from [MetricAggregationWithField](#metricaggregationwithfield))* |
| `id` | string | No | *(Inherited from [MetricAggregationWithField](#metricaggregationwithfield))* |
| `pipelineAgg` | string | No | |
| `type` | string | No | *(Inherited from [MetricAggregationWithField](#metricaggregationwithfield))*<br/>Possible values are: `count`, `avg`, `sum`, `min`, `max`, `extended_stats`, `percentiles`, `cardinality`, `raw_document`, `raw_data`, `logs`, `rate`, `top_metrics`, `moving_avg`, `moving_fn`, `derivative`, `serial_diff`, `cumulative_sum`, `bucket_script`. |
### MetricAggregationWithField
@ -279,6 +274,11 @@ It extends [BasePipelineMetricAggregation](#basepipelinemetricaggregation).
| `pipelineAgg` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `settings` | [object](#settings) | No | |
### Settings
| Property | Type | Required | Description |
|----------|------|----------|-------------|
### Meta
| Property | Type | Required | Description |

View File

@ -62,25 +62,12 @@ const (
// Defines values for BasePipelineMetricAggregationType.
const (
BasePipelineMetricAggregationTypeAvg BasePipelineMetricAggregationType = "avg"
BasePipelineMetricAggregationTypeBucketScript BasePipelineMetricAggregationType = "bucket_script"
BasePipelineMetricAggregationTypeCardinality BasePipelineMetricAggregationType = "cardinality"
BasePipelineMetricAggregationTypeCount BasePipelineMetricAggregationType = "count"
BasePipelineMetricAggregationTypeCumulativeSum BasePipelineMetricAggregationType = "cumulative_sum"
BasePipelineMetricAggregationTypeDerivative BasePipelineMetricAggregationType = "derivative"
BasePipelineMetricAggregationTypeExtendedStats BasePipelineMetricAggregationType = "extended_stats"
BasePipelineMetricAggregationTypeLogs BasePipelineMetricAggregationType = "logs"
BasePipelineMetricAggregationTypeMax BasePipelineMetricAggregationType = "max"
BasePipelineMetricAggregationTypeMin BasePipelineMetricAggregationType = "min"
BasePipelineMetricAggregationTypeMovingAvg BasePipelineMetricAggregationType = "moving_avg"
BasePipelineMetricAggregationTypeMovingFn BasePipelineMetricAggregationType = "moving_fn"
BasePipelineMetricAggregationTypePercentiles BasePipelineMetricAggregationType = "percentiles"
BasePipelineMetricAggregationTypeRate BasePipelineMetricAggregationType = "rate"
BasePipelineMetricAggregationTypeRawData BasePipelineMetricAggregationType = "raw_data"
BasePipelineMetricAggregationTypeRawDocument BasePipelineMetricAggregationType = "raw_document"
BasePipelineMetricAggregationTypeSerialDiff BasePipelineMetricAggregationType = "serial_diff"
BasePipelineMetricAggregationTypeSum BasePipelineMetricAggregationType = "sum"
BasePipelineMetricAggregationTypeTopMetrics BasePipelineMetricAggregationType = "top_metrics"
)
// Defines values for BucketAggregationSettingsOrder.
@ -457,7 +444,7 @@ type AverageType string
// BaseBucketAggregation defines model for BaseBucketAggregation.
type BaseBucketAggregation struct {
Id string `json:"id"`
Settings map[string]interface{} `json:"settings,omitempty"`
Settings *interface{} `json:"settings,omitempty"`
Type BaseBucketAggregationType `json:"type"`
}
@ -498,35 +485,31 @@ type BasePipelineMetricAggregationType string
// BucketAggregation defines model for BucketAggregation.
type BucketAggregation struct {
Field *string `json:"field,omitempty"`
Id *string `json:"id,omitempty"`
Settings *BucketAggregationSettings `json:"settings,omitempty"`
Type *interface{} `json:"type,omitempty"`
union json.RawMessage
Field *string `json:"field,omitempty"`
Id *string `json:"id,omitempty"`
Settings *struct {
Filters []struct {
Label string `json:"label"`
Query string `json:"query"`
} `json:"filters,omitempty"`
Interval *string `json:"interval,omitempty"`
MinDocCount *string `json:"min_doc_count,omitempty"`
Missing *string `json:"missing,omitempty"`
Offset *string `json:"offset,omitempty"`
Order *BucketAggregationSettingsOrder `json:"order,omitempty"`
OrderBy *string `json:"orderBy,omitempty"`
Precision *string `json:"precision,omitempty"`
Size *string `json:"size,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
TrimEdges *string `json:"trimEdges,omitempty"`
} `json:"settings,omitempty"`
Type *interface{} `json:"type,omitempty"`
union json.RawMessage
}
// BucketAggregationSettingsOrder defines model for BucketAggregation.Settings.Order.
type BucketAggregationSettingsOrder string
// BucketAggregationSettings defines model for BucketAggregation.Settings.
type BucketAggregationSettings struct {
Filters []struct {
Label string `json:"label"`
Query string `json:"query"`
} `json:"filters,omitempty"`
Interval *string `json:"interval,omitempty"`
MinDocCount *string `json:"min_doc_count,omitempty"`
Missing *string `json:"missing,omitempty"`
Offset *string `json:"offset,omitempty"`
Order *BucketAggregationSettingsOrder `json:"order,omitempty"`
OrderBy *string `json:"orderBy,omitempty"`
Precision *string `json:"precision,omitempty"`
Size *string `json:"size,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
TrimEdges *string `json:"trimEdges,omitempty"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// BucketAggregationType defines model for BucketAggregationType.
type BucketAggregationType string
@ -534,7 +517,7 @@ type BucketAggregationType string
type BucketAggregationWithField struct {
Field *string `json:"field,omitempty"`
Id string `json:"id"`
Settings map[string]interface{} `json:"settings,omitempty"`
Settings *interface{} `json:"settings,omitempty"`
Type BucketAggregationWithFieldType `json:"type"`
}
@ -664,32 +647,28 @@ type ElasticsearchDataQuery struct {
// BucketAggsSettingsOrder defines model for ElasticsearchDataQuery.BucketAggs.Settings.Order.
type BucketAggsSettingsOrder string
// BucketAggsSettings defines model for ElasticsearchDataQuery.BucketAggs.Settings.
type BucketAggsSettings struct {
Filters []struct {
Label string `json:"label"`
Query string `json:"query"`
} `json:"filters,omitempty"`
Interval *string `json:"interval,omitempty"`
MinDocCount *string `json:"min_doc_count,omitempty"`
Missing *string `json:"missing,omitempty"`
Offset *string `json:"offset,omitempty"`
Order *BucketAggsSettingsOrder `json:"order,omitempty"`
OrderBy *string `json:"orderBy,omitempty"`
Precision *string `json:"precision,omitempty"`
Size *string `json:"size,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
TrimEdges *string `json:"trimEdges,omitempty"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// BucketAggsItem defines model for ElasticsearchDataQuery.bucketAggs.Item.
type BucketAggsItem struct {
Field *string `json:"field,omitempty"`
Id *string `json:"id,omitempty"`
Settings *BucketAggsSettings `json:"settings,omitempty"`
Type *interface{} `json:"type,omitempty"`
union json.RawMessage
Field *string `json:"field,omitempty"`
Id *string `json:"id,omitempty"`
Settings *struct {
Filters []struct {
Label string `json:"label"`
Query string `json:"query"`
} `json:"filters,omitempty"`
Interval *string `json:"interval,omitempty"`
MinDocCount *string `json:"min_doc_count,omitempty"`
Missing *string `json:"missing,omitempty"`
Offset *string `json:"offset,omitempty"`
Order *BucketAggsSettingsOrder `json:"order,omitempty"`
OrderBy *string `json:"orderBy,omitempty"`
Precision *string `json:"precision,omitempty"`
Size *string `json:"size,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
TrimEdges *string `json:"trimEdges,omitempty"`
} `json:"settings,omitempty"`
Type *interface{} `json:"type,omitempty"`
union json.RawMessage
}
// MetricsSettings defines model for ElasticsearchDataQuery.Metrics.Settings.

View File

@ -49,9 +49,9 @@ composableKinds: DataQuery: {
#BucketAggregationType: "terms" | "filters" | "geohash_grid" | "date_histogram" | "histogram" | "nested" @cuetsy(kind="type")
#BaseBucketAggregation: {
id: string
type: #BucketAggregationType
settings?: {...}
id: string
type: #BucketAggregationType
settings?: _
} @cuetsy(kind="interface")
#BucketAggregationWithField: {
@ -287,6 +287,7 @@ composableKinds: DataQuery: {
#BasePipelineMetricAggregation: {
#MetricAggregationWithField
pipelineAgg?: string
type: #PipelineMetricAggregationType
} @cuetsy(kind="interface")
#PipelineMetricAggregationWithMultipleBucketPaths: {

View File

@ -20,7 +20,7 @@ export type BucketAggregationType = ('terms' | 'filters' | 'geohash_grid' | 'dat
export interface BaseBucketAggregation {
id: string;
settings?: Record<string, unknown>;
settings?: unknown;
type: BucketAggregationType;
}
@ -29,6 +29,13 @@ export interface BucketAggregationWithField extends BaseBucketAggregation {
}
export interface DateHistogram extends BucketAggregationWithField {
settings?: {
interval?: string;
min_doc_count?: string;
trimEdges?: string;
offset?: string;
timeZone?: string;
};
type: 'date_histogram';
}
@ -41,6 +48,10 @@ export interface DateHistogramSettings {
}
export interface Histogram extends BucketAggregationWithField {
settings?: {
interval?: string;
min_doc_count?: string;
};
type: 'histogram';
}
@ -52,10 +63,18 @@ export interface HistogramSettings {
export type TermsOrder = ('desc' | 'asc');
export interface Nested extends BucketAggregationWithField {
settings?: Record<string, unknown>;
type: 'nested';
}
export interface Terms extends BucketAggregationWithField {
settings?: {
order?: TermsOrder;
size?: string;
min_doc_count?: string;
orderBy?: string;
missing?: string;
};
type: 'terms';
}
@ -68,6 +87,9 @@ export interface TermsSettings {
}
export interface Filters extends BaseBucketAggregation {
settings?: {
filters?: Array<Filter>;
};
type: 'filters';
}
@ -85,6 +107,9 @@ export const defaultFiltersSettings: Partial<FiltersSettings> = {
};
export interface GeoHashGrid extends BucketAggregationWithField {
settings?: {
precision?: string;
};
type: 'geohash_grid';
}
@ -234,6 +259,7 @@ export interface Rate extends MetricAggregationWithField {
export interface BasePipelineMetricAggregation extends MetricAggregationWithField {
pipelineAgg?: string;
type: PipelineMetricAggregationType;
}
export interface PipelineMetricAggregationWithMultipleBucketPaths extends BaseMetricAggregation {

View File

@ -2,7 +2,6 @@ import { DataSourceJsonData } from '@grafana/data';
import {
BucketAggregationType,
Filter,
MetricAggregation,
MetricAggregationType,
MovingAverageEWMAModelSettings,
@ -11,18 +10,9 @@ import {
MovingAverageLinearModelSettings,
MovingAverageModel,
MovingAverageSimpleModelSettings,
PipelineMetricAggregationType,
TermsOrder,
ExtendedStats,
BasePipelineMetricAggregation as SchemaBasePipelineMetricAggregation,
PipelineMetricAggregationWithMultipleBucketPaths as SchemaPipelineMetricAggregationWithMultipleBucketPaths,
MovingAverage as SchemaMovingAverage,
Filters as SchemaFilters,
Terms as SchemaTerms,
DateHistogram as SchemaDateHistogram,
Histogram as SchemaHistogram,
GeoHashGrid as SchemaGeoHashGrid,
Nested as SchemaNested,
BucketAggregation,
} from './dataquery.gen';
export * from './dataquery.gen';
@ -30,17 +20,6 @@ export { Elasticsearch as ElasticsearchQuery } from './dataquery.gen';
export type MetricAggregationWithMeta = ExtendedStats;
// Start of temporary overrides because of incorrect type generation in dataquery.gen.ts
// TODO: Remove this once the type generation is fixed
export interface BasePipelineMetricAggregation extends SchemaBasePipelineMetricAggregation {
type: PipelineMetricAggregationType;
}
export interface PipelineMetricAggregationWithMultipleBucketPaths
extends SchemaPipelineMetricAggregationWithMultipleBucketPaths {
type: PipelineMetricAggregationType;
}
export type MovingAverageModelSettings<T extends MovingAverageModel = MovingAverageModel> = Partial<
Extract<
| MovingAverageSimpleModelSettings
@ -56,52 +35,6 @@ export interface MovingAverage<T extends MovingAverageModel = MovingAverageModel
settings?: MovingAverageModelSettings<T>;
}
export interface Filters extends SchemaFilters {
settings?: {
filters?: Filter[];
};
}
export interface Terms extends SchemaTerms {
settings?: {
min_doc_count?: string;
missing?: string;
order?: TermsOrder;
orderBy?: string;
size?: string;
};
}
export interface DateHistogram extends SchemaDateHistogram {
settings?: {
interval?: string;
min_doc_count?: string;
offset?: string;
timeZone?: string;
trimEdges?: string;
};
}
export interface Histogram extends SchemaHistogram {
settings?: {
interval?: string;
min_doc_count?: string;
};
}
interface GeoHashGrid extends SchemaGeoHashGrid {
settings?: {
precision?: string;
};
}
interface Nested extends SchemaNested {
settings?: {};
}
export type BucketAggregation = DateHistogram | Histogram | Terms | Filters | GeoHashGrid | Nested;
// End of temporary overrides
export type Interval = 'Hourly' | 'Daily' | 'Weekly' | 'Monthly' | 'Yearly';
export interface ElasticsearchOptions extends DataSourceJsonData {