This repository has been archived on 2023-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
gitops-tbrnt/monitoring/vendor/github.com/grafana/grafonnet-lib/grafonnet/alertlist.libsonnet

44 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-02-11 21:21:17 +00:00
{
2020-05-12 17:42:23 +00:00
/**
2020-09-17 19:38:08 +00:00
* Creates an [Alert list panel](https://grafana.com/docs/grafana/latest/panels/visualizations/alert-list-panel/)
*
2020-05-12 17:42:23 +00:00
* @name alertlist.new
2020-09-17 19:38:08 +00:00
*
* @param title (default `''`)
* @param span (optional)
* @param show (default `'current'`) Whether the panel should display the current alert state or recent alert state changes.
* @param limit (default `10`) Sets the maximum number of alerts to list.
* @param sortOrder (default `'1'`) '1': alerting, '2': no_data, '3': pending, '4': ok, '5': paused
* @param stateFilter (optional)
* @param onlyAlertsOnDashboard (optional) Shows alerts only from the dashboard the alert list is in
* @param transparent (optional) Whether to display the panel without a background
* @param description (optional)
* @param datasource (optional)
2020-05-12 17:42:23 +00:00
*/
2020-02-11 21:21:17 +00:00
new(
title='',
span=null,
show='current',
limit=10,
sortOrder=1,
stateFilter=[],
onlyAlertsOnDashboard=true,
2020-02-11 21:21:17 +00:00
transparent=null,
description=null,
datasource=null,
)::
{
[if transparent != null then 'transparent']: transparent,
title: title,
[if span != null then 'span']: span,
type: 'alertlist',
show: show,
limit: limit,
sortOrder: sortOrder,
[if show != 'changes' then 'stateFilter']: stateFilter,
onlyAlertsOnDashboard: onlyAlertsOnDashboard,
2020-02-11 21:21:17 +00:00
[if description != null then 'description']: description,
datasource: datasource,
},
}