From 1385ca29e03792e19328499a4770a1d8d3393291 Mon Sep 17 00:00:00 2001 From: nicolas-fidel-wmx <160510693+nicolas-fidel-wmx@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:26:41 +0200 Subject: [PATCH] cloudwatch: add queryMode attribute (#662) * cloudwatch: add queryMode attribute * cloudwatch: add doc for queryMode --------- Co-authored-by: JamesGibo <22477854+JamesGibo@users.noreply.github.com> --- CHANGELOG.rst | 2 +- grafanalib/cloudwatch.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2adc14f4..ea76aedc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,10 +2,10 @@ Changelog ========= - x.x.x ? ======= +* Add `QueryMode` parameter in CloudwatchMetricsTarget * Added support `alias` via the `legendFormat` option for `Target` * Added `neutral` option for `GaugePanel` (supported by Grafana 9.3.0 - https://github.com/grafana/grafana/discussions/38273) * Added support `alias` via the `legendFormat` option for `Target` diff --git a/grafanalib/cloudwatch.py b/grafanalib/cloudwatch.py index f72d891b..9aadae4f 100644 --- a/grafanalib/cloudwatch.py +++ b/grafanalib/cloudwatch.py @@ -33,6 +33,7 @@ class CloudwatchMetricsTarget(Target): :param statistic: Cloudwatch mathematic statistic :param hide: controls if given metric is displayed on visualization :param datasource: Grafana datasource name + :param queryMode: queryMode for cloudwatch metric request """ alias = attr.ib(default="") @@ -51,6 +52,7 @@ class CloudwatchMetricsTarget(Target): statistic = attr.ib(default="Average") hide = attr.ib(default=False, validator=instance_of(bool)) datasource = attr.ib(default=None) + queryMode = attr.ib(default="") def to_json_data(self): return { @@ -70,6 +72,7 @@ def to_json_data(self): "statistic": self.statistic, "hide": self.hide, "datasource": self.datasource, + "queryMode": self.queryMode, }