Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit cc1626a

Browse files
Merge pull request #261 from rquinio/doc/missing-jsdoc
Add some missing API documentations
2 parents bc2e772 + 821d164 commit cc1626a

25 files changed

+365
-210
lines changed

grafonnet/alertlist.libsonnet

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
22
/**
3+
* Creates an [Alert list panel](https://grafana.com/docs/grafana/latest/panels/visualizations/alert-list-panel/)
4+
*
35
* @name alertlist.new
6+
*
7+
* @param title (default `''`)
8+
* @param span (optional)
9+
* @param show (default `'current'`) Whether the panel should display the current alert state or recent alert state changes.
10+
* @param limit (default `10`) Sets the maximum number of alerts to list.
11+
* @param sortOrder (default `'1'`) '1': alerting, '2': no_data, '3': pending, '4': ok, '5': paused
12+
* @param stateFilter (optional)
13+
* @param onlyAlertsOnDashboard (optional) Shows alerts only from the dashboard the alert list is in
14+
* @param transparent (optional) Whether to display the panel without a background
15+
* @param description (optional)
16+
* @param datasource (optional)
417
*/
518
new(
619
title='',

grafonnet/bar_gauge_panel.libsonnet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* @name barGaugePanel.new
66
*
77
* @param title Panel title.
8-
* @param description Panel description.
9-
* @param datasource Panel datasource.
10-
* @param unit The unit of the data.
11-
* @param thresholds An array of threashold values.
8+
* @param description (optional) Panel description.
9+
* @param datasource (optional) Panel datasource.
10+
* @param unit (optional) The unit of the data.
11+
* @param thresholds (optional) An array of threashold values.
1212
*
1313
* @method addTarget(target) Adds a target object.
1414
* @method addTargets(targets) Adds an array of targets.

grafonnet/cloudwatch.libsonnet

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
/**
3-
* Return a CloudWatch Target
3+
* Creates a [CloudWatch target](https://grafana.com/docs/grafana/latest/features/datasources/cloudwatch/)
44
*
55
* @name cloudwatch.target
66
*
77
* @param region
88
* @param namespace
99
* @param metric
10-
* @param datasource
11-
* @param statistic
12-
* @param alias
13-
* @param highResolution
14-
* @param period
15-
* @param dimensions
10+
* @param datasource (optional)
11+
* @param statistic (default: `'Average'`)
12+
* @param alias (optional)
13+
* @param highResolution (default: `false`)
14+
* @param period (default: `'1m'`)
15+
* @param dimensions (optional)
1616
1717
* @return Panel target
1818
*/

grafonnet/dashboard.libsonnet

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,34 @@ local timepickerlib = import 'timepicker.libsonnet';
22

33
{
44
/**
5+
* Creates a [dashboard](https://grafana.com/docs/grafana/latest/features/dashboard/dashboards/)
6+
*
57
* @name dashboard.new
8+
*
9+
* @param title The title of the dashboard
10+
* @param editable (default: `false`) Whether the dashboard is editable via Grafana UI.
11+
* @param style (default: `'dark'`) Theme of dashboard, `'dark'` or `'light'`
12+
* @param tags (optional) Array of tags associated to the dashboard, e.g.`['tag1','tag2']`
13+
* @param time_from (default: `'now-6h'`)
14+
* @param time_to (default: `'now'`)
15+
* @param timezone (default: `'browser'`) Timezone of the dashboard, `'utc'` or `'browser'`
16+
* @param refresh (default: `''`) Auto-refresh interval, e.g. `'30s'`
17+
* @param timepicker (optional) See timepicker API
18+
* @param graphTooltip (default: `'default'`) `'default'` : no shared crosshair or tooltip (0), `'shared_crosshair'`: shared crosshair (1), `'shared_tooltip'`: shared crosshair AND shared tooltip (2)
19+
* @param hideControls (default: `false`)
20+
* @param schemaVersion (default: `14`) Version of the Grafana JSON schema, incremented each time an update brings changes. `26` for Grafana 7.1.5, `22` for Grafana 6.7.4, `16` for Grafana 5.4.5, `14` for Grafana 4.6.3. etc.
21+
* @param uid (default: `''`) Unique dashboard identifier as a string (8-40), that can be chosen by users. Used to identify a dashboard to update when using Grafana REST API.
22+
* @param description (optional)
23+
*
24+
* @method addTemplate(template) Add a template variable
25+
* @method addTemplates(templates) Adds an array of template variables
26+
* @method addAnnotation(annotation) Add an [annotation](https://grafana.com/docs/grafana/latest/dashboards/annotations/)
27+
* @method addPanel(panel,gridPos) Appends a panel, with an optional grid position in grid coordinates, e.g. `gridPos={'x':0, 'y':0, 'w':12, 'h': 9}`
28+
* @method addPanels(panels) Appends an array of panels
29+
* @method addLink(link) Adds a [dashboard link](https://grafana.com/docs/grafana/latest/linking/dashboard-links/)
30+
* @method addRequired(type, name, id, version)
31+
* @method addInput(name, label, type, pluginId, pluginName, description, value)
32+
* @method addRow(row) Adds a row. This is the legacy row concept from Grafana < 5, when rows were needed for layout. Rows should now be added via `addPanel`.
633
*/
734
new(
835
title,

grafonnet/dashlist.libsonnet

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
/**
3-
* Returns a new dashlist panel that can be added in a row.
3+
* Creates a [dashlist panel](https://grafana.com/docs/grafana/latest/panels/visualizations/dashboard-list-panel/).
44
* It requires the dashlist panel plugin in grafana, which is built-in.
55
*
66
* @name dashlist.new
77
*
88
* @param title The title of the dashlist panel.
9-
* @param description Description of the panel
10-
* @param query Query to search by
11-
* @param tags Tag(s) to search by
12-
* @param recent Displays recently viewed dashboards
13-
* @param search Description of the panel
14-
* @param starred Displays starred dashboards
15-
* @param headings Chosen list selection(starred, recently Viewed, search) is shown as a heading
16-
* @param limit Set maximum items in a list
9+
* @param description (optional) Description of the panel
10+
* @param query (optional) Query to search by
11+
* @param tags (optional) Array of tag(s) to search by
12+
* @param recent (default `true`) Displays recently viewed dashboards
13+
* @param search (default `false`) Description of the panel
14+
* @param starred (default `false`) Displays starred dashboards
15+
* @param headings (default `true`) Chosen list selection(starred, recently Viewed, search) is shown as a heading
16+
* @param limit (default `10`) Set maximum items in a list
1717
* @return A json that represents a dashlist panel
1818
*/
1919
new(

grafonnet/elasticsearch.libsonnet

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
{
22
/**
3+
* Creates an [Elasticsearch target](https://grafana.com/docs/grafana/latest/features/datasources/elasticsearch/)
4+
*
35
* @name elasticsearch.target
6+
*
7+
* @param query
8+
* @param timeField
9+
* @param id (optional)
10+
* @param datasource (optional)
11+
* @param metrics (optional)
12+
* @param bucketAggs (optional)
13+
* @param alias (optional)
414
*/
515
target(
616
query,

grafonnet/gauge_panel.libsonnet

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@
55
* @name gaugePanel.new
66
*
77
* @param title Panel title.
8-
* @param description Panel description.
9-
* @param transparent Whether to display the panel without a background.
10-
* @param datasource Panel datasource.
11-
* @param allValues Show all values instead of reducing to one.
12-
* @param valueLimit Limit of values in all values mode.
13-
* @param reducerFunction Function to use to reduce values to when using single value.
14-
* @param fields Fields that should be included in the panel.
15-
* @param showThresholdLabels Render the threshold values around the gauge bar.
16-
* @param showThresholdMarkers Render the thresholds as an outer bar.
17-
* @param unit Panel unit field option.
18-
* @param min Leave empty to calculate based on all values.
19-
* @param max Leave empty to calculate based on all values.
8+
* @param description (optional) Panel description.
9+
* @param transparent (default `false`) Whether to display the panel without a background.
10+
* @param datasource (optional) Panel datasource.
11+
* @param allValues (default `false`) Show all values instead of reducing to one.
12+
* @param valueLimit (optional) Limit of values in all values mode.
13+
* @param reducerFunction (default `'mean'`) Function to use to reduce values to when using single value.
14+
* @param fields (default `''`) Fields that should be included in the panel.
15+
* @param showThresholdLabels (default `false`) Render the threshold values around the gauge bar.
16+
* @param showThresholdMarkers (default `true`) Render the thresholds as an outer bar.
17+
* @param unit (default `'percent'`) Panel unit field option.
18+
* @param min (optional) Leave empty to calculate based on all values.
19+
* @param max (optional) Leave empty to calculate based on all values.
2020
* @param decimals Number of decimal places to show.
2121
* @param displayName Change the field or series name.
22-
* @param noValue What to show when there is no value.
23-
* @param thresholdsMode 'absolute' or 'percentage'.
24-
* @param repeat Name of variable that should be used to repeat this panel.
25-
* @param repeatDirection 'h' for horizontal or 'v' for vertical.
26-
* @param repeatMaxPerRow Maximum panels per row in repeat mode.
27-
* @param pluginVersion Plugin version the panel should be modeled for. This has been tested with the default, '7', and '6.7'.
22+
* @param noValue (optional) What to show when there is no value.
23+
* @param thresholdsMode (default `'absolute'`) 'absolute' or 'percentage'.
24+
* @param repeat (optional) Name of variable that should be used to repeat this panel.
25+
* @param repeatDirection (default `'h'`) 'h' for horizontal or 'v' for vertical.
26+
* @param repeatMaxPerRow (optional) Maximum panels per row in repeat mode.
27+
* @param pluginVersion (default `'7'`) Plugin version the panel should be modeled for. This has been tested with the default, '7', and '6.7'.
2828
*
2929
* @method addTarget(target) Adds a target object.
3030
* @method addTargets(targets) Adds an array of targets.
31-
* @method addLink(link) Adds a link. Argument format: `{ title: 'Link Title', url: 'https://...', targetBlank: true }`.
31+
* @method addLink(link) Adds a [panel link](https://grafana.com/docs/grafana/latest/linking/panel-links/). Argument format: `{ title: 'Link Title', url: 'https://...', targetBlank: true }`.
3232
* @method addLinks(links) Adds an array of links.
3333
* @method addThreshold(step) Adds a threshold step. Argument format: `{ color: 'green', value: 0 }`.
3434
* @method addThresholds(steps) Adds an array of threshold steps.

grafonnet/graph_panel.libsonnet

Lines changed: 58 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,68 @@
11
{
22
/**
3-
* Returns a new graph panel that can be added in a row.
3+
* Creates a [graph panel](https://grafana.com/docs/grafana/latest/panels/visualizations/graph-panel/).
44
* It requires the graph panel plugin in grafana, which is built-in.
55
*
66
* @name graphPanel.new
77
*
88
* @param title The title of the graph panel.
9-
* @param span Width of the panel
10-
* @param datasource Datasource
11-
* @param fill Fill, integer from 0 to 10
12-
* @param linewidth Line Width, integer from 0 to 10
13-
* @param decimals Override automatic decimal precision for legend and tooltip. If null, not added to the json output.
14-
* @param decimalsY1 Override automatic decimal precision for the first Y axis. If null, use decimals parameter.
15-
* @param decimalsY2 Override automatic decimal precision for the second Y axis. If null, use decimals parameter.
16-
* @param min_span Min span
17-
* @param format Unit of the Y axes
18-
* @param formatY1 Unit of the first Y axis
19-
* @param formatY2 Unit of the second Y axis
20-
* @param min Min of the Y axes
21-
* @param max Max of the Y axes
22-
* @param labelY1 Label of the first Y axis
23-
* @param labelY2 Label of the second Y axis
24-
* @param x_axis_mode X axis mode, one of [time, series, histogram]
25-
* @param x_axis_values Chosen value of series, one of [avg, min, max, total, count]
26-
* @param x_axis_buckets restricts the x axis to this amount of buckets
27-
* @param x_axis_min restricts the x axis to display from this value if supplied
28-
* @param x_axis_max restricts the x axis to display up to this value if supplied
29-
* @param lines Display lines, boolean
30-
* @param points Display points, boolean
31-
* @param pointradius Radius of the points, allowed values are 0.5 or [1 ... 10] with step 1
32-
* @param bars Display bars, boolean
33-
* @param staircase Display line as staircase, boolean
34-
* @param dashes Display line as dashes
35-
* @param stack Stack values
36-
* @param repeat Variable used to repeat the graph panel
37-
* @param legend_show Show legend
38-
* @param legend_values Show values in legend
39-
* @param legend_min Show min in legend
40-
* @param legend_max Show max in legend
41-
* @param legend_current Show current in legend
42-
* @param legend_total Show total in legend
43-
* @param legend_avg Show average in legend
44-
* @param legend_alignAsTable Show legend as table
45-
* @param legend_rightSide Show legend to the right
46-
* @param legend_sideWidth Legend width
47-
* @param legend_sort Sort order of legend
48-
* @param legend_sortDesc Sort legend descending
49-
* @param aliasColors Define color mappings for graphs
50-
* @param thresholds Configuration of graph thresholds
51-
* @param logBase1Y Value of logarithm base of the first Y axis
52-
* @param logBase2Y Value of logarithm base of the second Y axis
53-
* @param transparent Boolean (default: false) If set to true the panel will be transparent
54-
* @param value_type Type of tooltip value
55-
* @param shared_tooltip Boolean Allow to group or spit tooltips on mouseover within a chart
56-
* @param percentage Boolean (defaut: false) show as percentages
57-
* @return A json that represents a graph panel
9+
* @param description (optional) The description of the panel
10+
* @param span (optional) Width of the panel
11+
* @param datasource (optional) Datasource
12+
* @param fill (default `1`) , integer from 0 to 10
13+
* @param linewidth (default `1`) Line Width, integer from 0 to 10
14+
* @param decimals (optional) Override automatic decimal precision for legend and tooltip. If null, not added to the json output.
15+
* @param decimalsY1 (optional) Override automatic decimal precision for the first Y axis. If null, use decimals parameter.
16+
* @param decimalsY2 (optional) Override automatic decimal precision for the second Y axis. If null, use decimals parameter.
17+
* @param min_span (optional) Min span
18+
* @param format (default `short`) Unit of the Y axes
19+
* @param formatY1 (optional) Unit of the first Y axis
20+
* @param formatY2 (optional) Unit of the second Y axis
21+
* @param min (optional) Min of the Y axes
22+
* @param max (optional) Max of the Y axes
23+
* @param labelY1 (optional) Label of the first Y axis
24+
* @param labelY2 (optional) Label of the second Y axis
25+
* @param x_axis_mode (default `'time'`) X axis mode, one of [time, series, histogram]
26+
* @param x_axis_values (default `'total'`) Chosen value of series, one of [avg, min, max, total, count]
27+
* @param x_axis_buckets (optional) Restricts the x axis to this amount of buckets
28+
* @param x_axis_min (optional) Restricts the x axis to display from this value if supplied
29+
* @param x_axis_max (optional) Restricts the x axis to display up to this value if supplied
30+
* @param lines (default `true`) Display lines
31+
* @param points (default `false`) Display points
32+
* @param pointradius (default `5`) Radius of the points, allowed values are 0.5 or [1 ... 10] with step 1
33+
* @param bars (default `false`) Display bars
34+
* @param staircase (default `false`) Display line as staircase
35+
* @param dashes (default `false`) Display line as dashes
36+
* @param stack (default `false`) Whether to stack values
37+
* @param repeat (optional) Name of variable that should be used to repeat this panel.
38+
* @param repeatDirection (default `'h'`) 'h' for horizontal or 'v' for vertical.
39+
* @param legend_show (default `true`) Show legend
40+
* @param legend_values (default `false`) Show values in legend
41+
* @param legend_min (default `false`) Show min in legend
42+
* @param legend_max (default `false`) Show max in legend
43+
* @param legend_current (default `false`) Show current in legend
44+
* @param legend_total (default `false`) Show total in legend
45+
* @param legend_avg (default `false`) Show average in legend
46+
* @param legend_alignAsTable (default `false`) Show legend as table
47+
* @param legend_rightSide (default `false`) Show legend to the right
48+
* @param legend_sideWidth (optional) Legend width
49+
* @param legend_sort (optional) Sort order of legend
50+
* @param legend_sortDesc (optional) Sort legend descending
51+
* @param aliasColors (optional) Define color mappings for graphs
52+
* @param thresholds (optional) An array of graph thresholds
53+
* @param logBase1Y (default `1`) Value of logarithm base of the first Y axis
54+
* @param logBase2Y (default `1`) Value of logarithm base of the second Y axis
55+
* @param transparent (default `false`) Whether to display the panel without a background.
56+
* @param value_type (default `'individual'`) Type of tooltip value
57+
* @param shared_tooltip (default `true`) Allow to group or spit tooltips on mouseover within a chart
58+
* @param percentage (defaut: false) show as percentages
59+
*
60+
* @method addTarget(target) Adds a target object.
61+
* @method addTargets(targets) Adds an array of targets.
62+
* @method addSeriesOverride(override)
63+
* @method addYaxis(format,min,max,label,show,logBase,decimals) Adds a Y axis to the graph
64+
* @method addAlert(alert) Adds an alert
65+
* @method addLink(link) Adds a [panel link](https://grafana.com/docs/grafana/latest/linking/panel-links/)
5866
*/
5967
new(
6068
title,

grafonnet/graphite.libsonnet

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
/**
3-
* Return an Graphite Target
3+
* Creates a [Graphite target](https://grafana.com/docs/grafana/latest/features/datasources/graphite/)
44
*
55
* @name graphite.target
66
*
77
* @param target Graphite Query. Nested queries are possible by adding the query reference (refId).
8-
* @param targetFull Expanding the @target. Used in nested queries.
9-
* @param hide Disable query on graph.
10-
* @param textEditor Enable raw query mode.
11-
* @param datasource Datasource.
8+
* @param targetFull (optional) Expanding the @target. Used in nested queries.
9+
* @param hide (default `false`) Disable query on graph.
10+
* @param textEditor (default `false`) Enable raw query mode.
11+
* @param datasource (optional) Datasource.
1212
1313
* @return Panel target
1414
*/

0 commit comments

Comments
 (0)