Codegen: Render disjunctions in docs (#63590)

* Codegen: Render disjunctions in docs

* Fix references

* Regenerate docs
This commit is contained in:
Tania
2023-03-03 17:48:25 +01:00
committed by GitHub
parent ad4b053231
commit 40ba848bf5
5 changed files with 698 additions and 9 deletions

View File

@@ -30,9 +30,99 @@ It extends [DataQuery](#dataquery).
### BucketAggregation
| Property | Type | Required | Description |
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------|
| `object` | Possible types are: [DateHistogram](#datehistogram), [Histogram](#histogram), [Terms](#terms), [Filters](#filters), [GeoHashGrid](#geohashgrid), [Nested](#nested). | | |
### DateHistogram
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))* |
### 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))* |
### 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 |
|----------|------|----------|-------------|
### 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))* |
### 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))* |
### 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))* |
### 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))* |
### 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))* |
### DataQuery
These are the common properties available to all queries in all datasources.
@@ -49,7 +139,157 @@ properties for the given context.
### MetricAggregation
| Property | Type | Required | Description |
|----------|------------------------------------------------------------------------------------------------------|----------|-------------|
| `object` | Possible types are: [Count](#count), [PipelineMetricAggregation](#pipelinemetricaggregation), [](#). | | |
### Count
It extends [BaseMetricAggregation](#basemetricaggregation).
| Property | Type | Required | Description |
|----------|---------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))*<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`. |
| `hide` | boolean | No | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))* |
### BaseMetricAggregation
| Property | Type | Required | Description |
|----------|---------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | |
| `type` | string | **Yes** | 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`. |
| `hide` | boolean | No | |
### PipelineMetricAggregation
| Property | Type | Required | Description |
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------|
| `object` | Possible types are: [MovingAverage](#movingaverage), [Derivative](#derivative), [CumulativeSum](#cumulativesum), [BucketScript](#bucketscript). | | |
### BucketScript
It extends [PipelineMetricAggregationWithMultipleBucketPaths](#pipelinemetricaggregationwithmultiplebucketpaths).
| Property | Type | Required | Description |
|---------------------|-----------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [PipelineMetricAggregationWithMultipleBucketPaths](#pipelinemetricaggregationwithmultiplebucketpaths))*<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`. |
| `hide` | boolean | No | *(Inherited from [PipelineMetricAggregationWithMultipleBucketPaths](#pipelinemetricaggregationwithmultiplebucketpaths))* |
| `id` | string | No | *(Inherited from [PipelineMetricAggregationWithMultipleBucketPaths](#pipelinemetricaggregationwithmultiplebucketpaths))* |
| `pipelineVariables` | [PipelineVariable](#pipelinevariable)[] | No | *(Inherited from [PipelineMetricAggregationWithMultipleBucketPaths](#pipelinemetricaggregationwithmultiplebucketpaths))* |
| `settings` | [object](#settings) | No | |
### PipelineMetricAggregationWithMultipleBucketPaths
It extends [BaseMetricAggregation](#basemetricaggregation).
| Property | Type | Required | Description |
|---------------------|-----------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))*<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`. |
| `hide` | boolean | No | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))* |
| `pipelineVariables` | [PipelineVariable](#pipelinevariable)[] | No | |
### PipelineVariable
| Property | Type | Required | Description |
|---------------|--------|----------|-------------|
| `name` | string | **Yes** | |
| `pipelineAgg` | string | **Yes** | |
### Settings
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `script` | | No | |
### CumulativeSum
It extends [BasePipelineMetricAggregation](#basepipelinemetricaggregation).
| Property | Type | Required | Description |
|---------------|---------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))*<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 [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `hide` | boolean | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `id` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `pipelineAgg` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `settings` | [object](#settings) | No | |
### BasePipelineMetricAggregation
It extends [MetricAggregationWithField](#metricaggregationwithfield).
| Property | Type | Required | Description |
|---------------|---------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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
It extends [BaseMetricAggregation](#basemetricaggregation).
| Property | Type | Required | Description |
|----------|---------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | string | **Yes** | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))* |
| `type` | string | **Yes** | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))*<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 | |
| `hide` | boolean | No | *(Inherited from [BaseMetricAggregation](#basemetricaggregation))* |
### Settings
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `format` | string | No | |
### Derivative
It extends [BasePipelineMetricAggregation](#basepipelinemetricaggregation).
| Property | Type | Required | Description |
|---------------|---------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))*<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 [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `hide` | boolean | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `id` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `pipelineAgg` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `settings` | [object](#settings) | No | |
### Settings
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `unit` | string | No | |
### MovingAverage
#MovingAverage's settings are overridden in types.ts
It extends [BasePipelineMetricAggregation](#basepipelinemetricaggregation).
| Property | Type | Required | Description |
|---------------|---------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type` | string | **Yes** | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))*<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 [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `hide` | boolean | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `id` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `pipelineAgg` | string | No | *(Inherited from [BasePipelineMetricAggregation](#basepipelinemetricaggregation))* |
| `settings` | [object](#settings) | No | |
### Meta
| Property | Type | Required | Description |
|----------|------|----------|-------------|
### Settings
| Property | Type | Required | Description |
|-----------|----------|----------|-------------|
| `metrics` | string[] | No | |
| `orderBy` | string | No | |
| `order` | string | No | |

View File

@@ -209,21 +209,24 @@ TODO docs
Controls cell value unit
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| Property | Type | Required | Description |
|----------|-----------------------------------|----------|-------------|
| `object` | Possible types are: [](#), [](#). | | |
### Color
Controls the color options
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| Property | Type | Required | Description |
|----------|-----------------------------------|----------|-------------|
| `object` | Possible types are: [](#), [](#). | | |
### FilterValues
Filters values between a given range
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| Property | Type | Required | Description |
|----------|-----------------------------------|----------|-------------|
| `object` | Possible types are: [](#), [](#). | | |

View File

@@ -41,7 +41,8 @@ Sort by field state
Controls footer options
| Property | Type | Required | Description |
|----------|------|----------|-------------|
| Property | Type | Required | Description |
|----------|-----------------------------------|----------|-------------|
| `object` | Possible types are: [](#), [](#). | | |

View File

@@ -124,9 +124,415 @@ Datasource to use for annotation.
### Panels
| Property | Type | Required | Description |
|----------|-----------------------------------------------------------------------------------------------------------------------|----------|-------------|
| `object` | Possible types are: [Panel](#panel), [RowPanel](#rowpanel), [GraphPanel](#graphpanel), [HeatmapPanel](#heatmappanel). | | |
### DataTransformerConfig
TODO docs
| Property | Type | Required | Description |
|------------|---------------------------------|----------|----------------------------------------------------------------------------------------|
| `id` | string | **Yes** | Unique identifier of transformer |
| `options` | | **Yes** | Options to be passed to the transformer<br/>Valid options depend on the transformer id |
| `disabled` | boolean | No | Disabled transformations are skipped |
| `filter` | [MatcherConfig](#matcherconfig) | No | |
### MatcherConfig
| Property | Type | Required | Description |
|-----------|--------|----------|--------------|
| `id` | string | **Yes** | Default: ``. |
| `options` | | No | |
### FieldConfigSource
| Property | Type | Required | Description |
|-------------|-----------------------------|----------|-------------|
| `defaults` | [FieldConfig](#fieldconfig) | **Yes** | |
| `overrides` | [object](#overrides)[] | **Yes** | |
### FieldConfig
| Property | Type | Required | Description |
|---------------------|---------------------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | TODO docs |
| `custom` | [object](#custom) | No | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | Significant digits (for display) |
| `description` | string | No | Human readable field metadata |
| `displayNameFromDS` | string | No | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
| `displayName` | string | No | The display value for this field. This supports template variables blank is auto |
| `filterable` | boolean | No | True if data source field supports ad-hoc filters |
| `links` | | No | The behavior when clicking on a result |
| `mappings` | [ValueMapping](#valuemapping)[] | No | Convert input values into a display string |
| `max` | number | No | |
| `min` | number | No | |
| `noValue` | string | No | Alternative to empty string |
| `path` | string | No | An explicit path to the field in the datasource. When the frame meta includes a path,<br/>This will default to `${frame.meta.path}/${field.name}<br/><br/>When defined, this value can be used as an identifier within the datasource scope, and<br/>may be used to update the results |
| `thresholds` | [ThresholdsConfig](#thresholdsconfig) | No | |
| `unit` | string | No | Numeric Options |
| `writeable` | boolean | No | True if data source can write a value to the path. Auth/authz are supported separately |
### FieldColor
TODO docs
| Property | Type | Required | Description |
|--------------|--------|----------|----------------------------------------------------------|
| `mode` | string | **Yes** | The main color scheme mode |
| `fixedColor` | string | No | Stores the fixed color value if mode is fixed |
| `seriesBy` | string | No | TODO docs<br/>Possible values are: `min`, `max`, `last`. |
### ThresholdsConfig
| Property | Type | Required | Description |
|----------|---------------------------|----------|------------------------------------------------------------|
| `mode` | string | **Yes** | Possible values are: `absolute`, `percentage`. |
| `steps` | [Threshold](#threshold)[] | **Yes** | Must be sorted by 'value', first value is always -Infinity |
### Threshold
TODO docs
| Property | Type | Required | Description |
|----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | string | **Yes** | TODO docs |
| `state` | string | No | TODO docs<br/>TODO are the values here enumerable into a disjunction?<br/>Some seem to be listed in typescript comment |
| `value` | number | No | TODO docs<br/>FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON |
### ValueMapping
TODO docs
| Property | Type | Required | Description |
|----------|-------------------------------------------------------------------------------------------------------------------------------|----------|-------------|
| `object` | Possible types are: [ValueMap](#valuemap), [RangeMap](#rangemap), [RegexMap](#regexmap), [SpecialValueMap](#specialvaluemap). | | |
### RangeMap
TODO docs
| Property | Type | Required | Description |
|-----------|--------------------|----------|-------------|
| `options` | [object](#options) | **Yes** | |
| `type` | string | **Yes** | |
### Options
| Property | Type | Required | Description |
|----------|-------------------------------------------|----------|--------------------------------------------------------------------------------|
| `from` | number | **Yes** | to and from are `number &#124; null` in current ts, really not sure what to do |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | TODO docs |
| `to` | number | **Yes** | |
### ValueMappingResult
TODO docs
| Property | Type | Required | Description |
|----------|---------|----------|-------------|
| `color` | string | No | |
| `icon` | string | No | |
| `index` | integer | No | |
| `text` | string | No | |
### RegexMap
TODO docs
| Property | Type | Required | Description |
|-----------|--------------------|----------|-------------|
| `options` | [object](#options) | **Yes** | |
| `type` | string | **Yes** | |
### Options
| Property | Type | Required | Description |
|-----------|-------------------------------------------|----------|-------------|
| `pattern` | string | **Yes** | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | TODO docs |
### SpecialValueMap
TODO docs
| Property | Type | Required | Description |
|-----------|--------------------|----------|-------------|
| `options` | [object](#options) | **Yes** | |
| `type` | string | **Yes** | |
### Options
| Property | Type | Required | Description |
|-----------|-------------------------------------------|----------|---------------------------------------|
| `match` | string | **Yes** | Possible values are: `true`, `false`. |
| `pattern` | string | **Yes** | |
| `result` | [ValueMappingResult](#valuemappingresult) | **Yes** | TODO docs |
### ValueMap
TODO docs
| Property | Type | Required | Description |
|-----------|------------------------------------------------------|----------|-------------|
| `options` | map[string][ValueMappingResult](#valuemappingresult) | **Yes** | |
| `type` | string | **Yes** | |
### Custom
custom is specified by the PanelFieldConfig field
in panel plugin schemas.
| Property | Type | Required | Description |
|----------|------|----------|-------------|
### Overrides
| Property | Type | Required | Description |
|--------------|---------------------------------------------|----------|-------------|
| `matcher` | [MatcherConfig](#matcherconfig) | **Yes** | |
| `properties` | [DynamicConfigValue](#dynamicconfigvalue)[] | **Yes** | |
### DynamicConfigValue
| Property | Type | Required | Description |
|----------|--------|----------|--------------|
| `id` | string | **Yes** | Default: ``. |
| `value` | | No | |
### GraphPanel
Support for legacy graph and heatmap panels.
| Property | Type | Required | Description |
|----------|-------------------|----------|----------------------------------------------------|
| `type` | string | **Yes** | Possible values are: `graph`. |
| `legend` | [object](#legend) | No | @deprecated this is part of deprecated graph panel |
### Legend
@deprecated this is part of deprecated graph panel
| Property | Type | Required | Description |
|------------|---------|----------|------------------|
| `show` | boolean | **Yes** | Default: `true`. |
| `sortDesc` | boolean | No | |
| `sort` | string | No | |
### GridPos
| Property | Type | Required | Description |
|----------|---------|----------|----------------------------------------------------|
| `h` | uint32 | **Yes** | Panel Default: `9`. |
| `w` | integer | **Yes** | Panel Default: `12`.<br/>Constraint: `>0 & <=24`. |
| `x` | integer | **Yes** | Panel x Default: `0`.<br/>Constraint: `>=0 & <24`. |
| `y` | uint32 | **Yes** | Panel y Default: `0`. |
| `static` | boolean | No | true if fixed |
### HeatmapPanel
| Property | Type | Required | Description |
|----------|--------|----------|---------------------------------|
| `type` | string | **Yes** | Possible values are: `heatmap`. |
### LibraryPanelRef
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `name` | string | **Yes** | |
| `uid` | string | **Yes** | |
### Panel
Dashboard panels. Panels are canonically defined inline
because they share a version timeline with the dashboard
schema; they do not evolve independently.
| Property | Type | Required | Description |
|-------------------|---------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | |
| `options` | [object](#options) | **Yes** | options is specified by the PanelOptions field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. Default: `h`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | |
| `transparent` | boolean | **Yes** | Whether to display the panel without a background. Default: `false`. |
| `type` | string | **Yes** | The panel plugin type id. May not be empty.<br/>Constraint: `length >=1`. |
| `datasource` | [object](#datasource) | No | The datasource used in all targets. |
| `description` | string | No | Description. |
| `gridPos` | [GridPos](#gridpos) | No | |
| `id` | uint32 | No | TODO docs |
| `interval` | string | No | TODO docs<br/>TODO tighter constraint |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | |
| `links` | [DashboardLink](#dashboardlink)[] | No | Panel links.<br/>TODO fill this out - seems there are a couple variants? |
| `maxDataPoints` | number | No | TODO docs |
| `pluginVersion` | string | No | FIXME this almost certainly has to be changed in favor of scuemata versions |
| `repeatPanelId` | integer | No | Id of the repeating panel. |
| `repeat` | string | No | Name of template variable to repeat for. |
| `tags` | string[] | No | TODO docs |
| `targets` | [Target](#target)[] | No | TODO docs |
| `thresholds` | | No | TODO docs - seems to be an old field from old dashboard alerts? |
| `timeFrom` | string | No | TODO docs<br/>TODO tighter constraint |
| `timeRegions` | | No | TODO docs |
| `timeShift` | string | No | TODO docs<br/>TODO tighter constraint |
| `title` | string | No | Panel title. |
### FieldConfigSource
| Property | Type | Required | Description |
|-------------|-----------------------------|----------|-------------|
| `defaults` | [FieldConfig](#fieldconfig) | **Yes** | |
| `overrides` | [overrides](#overrides)[] | **Yes** | |
### FieldConfig
| Property | Type | Required | Description |
|---------------------|---------------------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `color` | [FieldColor](#fieldcolor) | No | TODO docs |
| `custom` | [custom](#custom) | No | custom is specified by the PanelFieldConfig field<br/>in panel plugin schemas. |
| `decimals` | number | No | Significant digits (for display) |
| `description` | string | No | Human readable field metadata |
| `displayNameFromDS` | string | No | This can be used by data sources that return and explicit naming structure for values and labels<br/>When this property is configured, this value is used rather than the default naming strategy. |
| `displayName` | string | No | The display value for this field. This supports template variables blank is auto |
| `filterable` | boolean | No | True if data source field supports ad-hoc filters |
| `links` | | No | The behavior when clicking on a result |
| `mappings` | [ValueMapping](#valuemapping)[] | No | Convert input values into a display string |
| `max` | number | No | |
| `min` | number | No | |
| `noValue` | string | No | Alternative to empty string |
| `path` | string | No | An explicit path to the field in the datasource. When the frame meta includes a path,<br/>This will default to `${frame.meta.path}/${field.name}<br/><br/>When defined, this value can be used as an identifier within the datasource scope, and<br/>may be used to update the results |
| `thresholds` | [ThresholdsConfig](#thresholdsconfig) | No | |
| `unit` | string | No | Numeric Options |
| `writeable` | boolean | No | True if data source can write a value to the path. Auth/authz are supported separately |
### RangeMap
TODO docs
| Property | Type | Required | Description |
|-----------|---------------------|----------|-------------|
| `options` | [options](#options) | **Yes** | |
| `type` | string | **Yes** | |
### RegexMap
TODO docs
| Property | Type | Required | Description |
|-----------|---------------------|----------|-------------|
| `options` | [options](#options) | **Yes** | |
| `type` | string | **Yes** | |
### SpecialValueMap
TODO docs
| Property | Type | Required | Description |
|-----------|---------------------|----------|-------------|
| `options` | [options](#options) | **Yes** | |
| `type` | string | **Yes** | |
### Target
Schema for panel targets is specified by datasource
plugins. We use a placeholder definition, which the Go
schema loader either left open/as-is with the Base
variant of the Dashboard and Panel families, or filled
with types derived from plugins in the Instance variant.
When working directly from CUE, importers can extend this
type directly to achieve the same effect.
| Property | Type | Required | Description |
|----------|------|----------|-------------|
### Datasource
The datasource used in all targets.
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `type` | string | No | |
| `uid` | string | No | |
### Options
options is specified by the PanelOptions field in panel
plugin schemas.
| Property | Type | Required | Description |
|----------|------|----------|-------------|
### RowPanel
Row panel
| Property | Type | Required | Description |
|--------------|-----------------------|----------|------------------------------------------|
| `collapsed` | boolean | **Yes** | Default: `false`. |
| `id` | uint32 | **Yes** | |
| `panels` | [panels](#panels)[] | **Yes** | |
| `type` | string | **Yes** | Possible values are: `row`. |
| `datasource` | [object](#datasource) | No | Name of default datasource. |
| `gridPos` | [GridPos](#gridpos) | No | |
| `repeat` | string | No | Name of template variable to repeat for. |
| `title` | string | No | |
### Datasource
Name of default datasource.
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `type` | string | No | |
| `uid` | string | No | |
### Panels
| Property | Type | Required | Description |
|----------|------------------------------------------------------------------------------------------------|----------|-------------|
| `object` | Possible types are: [Panel](#panel), [GraphPanel](#graphpanel), [HeatmapPanel](#heatmappanel). | | |
### GraphPanel
Support for legacy graph and heatmap panels.
| Property | Type | Required | Description |
|----------|-------------------|----------|----------------------------------------------------|
| `type` | string | **Yes** | Possible values are: `graph`. |
| `legend` | [legend](#legend) | No | @deprecated this is part of deprecated graph panel |
### Panel
Dashboard panels. Panels are canonically defined inline
because they share a version timeline with the dashboard
schema; they do not evolve independently.
| Property | Type | Required | Description |
|-------------------|---------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fieldConfig` | [FieldConfigSource](#fieldconfigsource) | **Yes** | |
| `options` | [options](#options) | **Yes** | options is specified by the PanelOptions field in panel<br/>plugin schemas. |
| `repeatDirection` | string | **Yes** | Direction to repeat in if 'repeat' is set.<br/>"h" for horizontal, "v" for vertical.<br/>TODO this is probably optional<br/>Possible values are: `h`, `v`. Default: `h`. |
| `transformations` | [DataTransformerConfig](#datatransformerconfig)[] | **Yes** | |
| `transparent` | boolean | **Yes** | Whether to display the panel without a background. Default: `false`. |
| `type` | string | **Yes** | The panel plugin type id. May not be empty.<br/>Constraint: `length >=1`. |
| `datasource` | [datasource](#datasource) | No | The datasource used in all targets. |
| `description` | string | No | Description. |
| `gridPos` | [GridPos](#gridpos) | No | |
| `id` | uint32 | No | TODO docs |
| `interval` | string | No | TODO docs<br/>TODO tighter constraint |
| `libraryPanel` | [LibraryPanelRef](#librarypanelref) | No | |
| `links` | [DashboardLink](#dashboardlink)[] | No | Panel links.<br/>TODO fill this out - seems there are a couple variants? |
| `maxDataPoints` | number | No | TODO docs |
| `pluginVersion` | string | No | FIXME this almost certainly has to be changed in favor of scuemata versions |
| `repeatPanelId` | integer | No | Id of the repeating panel. |
| `repeat` | string | No | Name of template variable to repeat for. |
| `tags` | string[] | No | TODO docs |
| `targets` | [Target](#target)[] | No | TODO docs |
| `thresholds` | | No | TODO docs - seems to be an old field from old dashboard alerts? |
| `timeFrom` | string | No | TODO docs<br/>TODO tighter constraint |
| `timeRegions` | | No | TODO docs |
| `timeShift` | string | No | TODO docs<br/>TODO tighter constraint |
| `title` | string | No | Panel title. |
### Templating
TODO docs

View File

@@ -136,6 +136,7 @@ type schema struct {
Enum []Any `json:"enum"`
Default any `json:"default"`
AllOf []*schema `json:"allOf"`
OneOf []*schema `json:"oneOf"`
AdditionalProperties *schema `json:"additionalProperties"`
extends []string `json:"-"`
inheritedFrom string `json:"-"`
@@ -247,6 +248,16 @@ func resolveSchema(schem *schema, root *simplejson.Json) (*schema, error) {
}
}
if len(schem.OneOf) > 0 {
for idx, child := range schem.OneOf {
tmp, err := resolveSubSchema(schem, child, root)
if err != nil {
return nil, err
}
schem.OneOf[idx] = tmp
}
}
if schem.AdditionalProperties != nil {
if schem.AdditionalProperties.Ref != "" {
tmp, err := resolveReference(schem.AdditionalProperties.Ref, root)
@@ -479,6 +490,20 @@ func findDefinitions(s *schema) []*schema {
}
}
for _, child := range s.OneOf {
if child.Type.HasType(PropertyTypeObject) {
objs = append(objs, child)
}
if child.Type.HasType(PropertyTypeArray) {
if child.Items != nil {
if child.Items.Type.HasType(PropertyTypeObject) {
objs = append(objs, child.Items)
}
}
}
}
// Sort the object schemas.
sort.Slice(objs, func(i, j int) bool {
return objs[i].Title < objs[j].Title
@@ -491,10 +516,16 @@ func makeRows(s *schema) [][]string {
// Buffer all property rows so that we can sort them before printing them.
rows := make([][]string, 0, len(s.Properties))
var typeStr string
if len(s.OneOf) > 0 {
typeStr = enumStr(s)
rows = append(rows, []string{"`object`", typeStr, "", ""})
return rows
}
for key, p := range s.Properties {
alias := propTypeAlias(p)
var typeStr string
if alias != "" {
typeStr = alias
} else {
@@ -614,6 +645,14 @@ func constraintDescr(prop *schema) string {
return ""
}
func enumStr(propValue *schema) string {
var vals []string
for _, v := range propValue.OneOf {
vals = append(vals, fmt.Sprintf("[%s](#%s)", v.Title, strings.ToLower(v.Title)))
}
return "Possible types are: " + strings.Join(vals, ", ") + "."
}
func propTypeStr(propName string, propValue *schema) string {
// If the property has AdditionalProperties, it is most likely a map type
if propValue.AdditionalProperties != nil {