Class: AWSCDK::CloudWatch::GaugeWidgetProps
- Inherits:
-
MetricWidgetProps
- Object
- MetricWidgetProps
- AWSCDK::CloudWatch::GaugeWidgetProps
- Defined in:
- cloud_watch/gauge_widget_props.rb
Overview
Properties for a GaugeWidget.
Instance Attribute Summary collapse
-
#_end ⇒ String?
readonly
The end of the time range to use for each widget independently from those of the dashboard.
-
#account_id ⇒ String?
readonly
The AWS account ID where the metrics are located.
-
#annotations ⇒ Array<AWSCDK::CloudWatch::HorizontalAnnotation>?
readonly
Annotations for the left Y axis.
-
#height ⇒ Numeric?
readonly
Height of the widget.
-
#left_y_axis ⇒ AWSCDK::CloudWatch::YAxisProps?
readonly
Left Y axis.
-
#legend_position ⇒ AWSCDK::CloudWatch::LegendPosition?
readonly
Position of the legend.
-
#live_data ⇒ Boolean?
readonly
Whether the graph should show live data.
-
#metrics ⇒ Array<AWSCDK::CloudWatch::IMetric>?
readonly
Metrics to display on left Y axis.
-
#period ⇒ AWSCDK::Duration?
readonly
The default period for all metrics in this widget.
-
#region ⇒ String?
readonly
The region the metrics of this graph should be taken from.
-
#set_period_to_time_range ⇒ Boolean?
readonly
Whether to show the value from the entire time range.
-
#start ⇒ String?
readonly
The start of the time range to use for each widget independently from those of the dashboard.
-
#statistic ⇒ String?
readonly
The default statistic to be displayed for each metric.
-
#title ⇒ String?
readonly
Title for the graph.
-
#width ⇒ Numeric?
readonly
Width of the widget, in a grid of 24 units wide.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, annotations: nil, _end: nil, left_y_axis: nil, legend_position: nil, live_data: nil, metrics: nil, period: nil, set_period_to_time_range: nil, start: nil, statistic: nil) ⇒ GaugeWidgetProps
constructor
A new instance of GaugeWidgetProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, annotations: nil, _end: nil, left_y_axis: nil, legend_position: nil, live_data: nil, metrics: nil, period: nil, set_period_to_time_range: nil, start: nil, statistic: nil) ⇒ GaugeWidgetProps
Returns a new instance of GaugeWidgetProps.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'cloud_watch/gauge_widget_props.rb', line 22 def initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, annotations: nil, _end: nil, left_y_axis: nil, legend_position: nil, live_data: nil, metrics: nil, period: nil, set_period_to_time_range: nil, start: nil, statistic: nil) @account_id = account_id Jsii::Type.check_type(@account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accountId") unless @account_id.nil? @height = height Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") unless @height.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @title = title Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title") unless @title.nil? @width = width Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") unless @width.nil? @annotations = annotations.is_a?(Array) ? annotations.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudWatch::HorizontalAnnotation.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : annotations Jsii::Type.check_type(@annotations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLkhvcml6b250YWxBbm5vdGF0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "annotations") unless @annotations.nil? @_end = _end Jsii::Type.check_type(@_end, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "end") unless @_end.nil? @left_y_axis = left_y_axis.is_a?(Hash) ? ::AWSCDK::CloudWatch::YAxisProps.new(**left_y_axis.transform_keys(&:to_sym)) : left_y_axis Jsii::Type.check_type(@left_y_axis, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5ZQXhpc1Byb3BzIn0=")), "leftYAxis") unless @left_y_axis.nil? @legend_position = legend_position Jsii::Type.check_type(@legend_position, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5MZWdlbmRQb3NpdGlvbiJ9")), "legendPosition") unless @legend_position.nil? @live_data = live_data Jsii::Type.check_type(@live_data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "liveData") unless @live_data.nil? @metrics = metrics Jsii::Type.check_type(@metrics, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLklNZXRyaWMifSwia2luZCI6ImFycmF5In19")), "metrics") unless @metrics.nil? @period = period Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "period") unless @period.nil? @set_period_to_time_range = set_period_to_time_range Jsii::Type.check_type(@set_period_to_time_range, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "setPeriodToTimeRange") unless @set_period_to_time_range.nil? @start = start Jsii::Type.check_type(@start, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "start") unless @start.nil? @statistic = statistic Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statistic") unless @statistic.nil? end |
Instance Attribute Details
#_end ⇒ String? (readonly)
Default: When the dashboard loads, the end date will be the current time.
The end of the time range to use for each widget independently from those of the dashboard.
If you specify a value for end, you must also specify a value for start. Specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.
99 100 101 |
# File 'cloud_watch/gauge_widget_props.rb', line 99 def _end @_end end |
#account_id ⇒ String? (readonly)
Default: - Current account
The AWS account ID where the metrics are located.
This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account.
For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
66 67 68 |
# File 'cloud_watch/gauge_widget_props.rb', line 66 def account_id @account_id end |
#annotations ⇒ Array<AWSCDK::CloudWatch::HorizontalAnnotation>? (readonly)
Default: - No annotations
Annotations for the left Y axis.
91 92 93 |
# File 'cloud_watch/gauge_widget_props.rb', line 91 def annotations @annotations end |
#height ⇒ Numeric? (readonly)
Default: - 6 for Alarm and Graph widgets. 3 for single value widgets where most recent value of a metric is displayed.
Height of the widget.
71 72 73 |
# File 'cloud_watch/gauge_widget_props.rb', line 71 def height @height end |
#left_y_axis ⇒ AWSCDK::CloudWatch::YAxisProps? (readonly)
Default: min:0,max:100
Left Y axis.
104 105 106 |
# File 'cloud_watch/gauge_widget_props.rb', line 104 def left_y_axis @left_y_axis end |
#legend_position ⇒ AWSCDK::CloudWatch::LegendPosition? (readonly)
Default: - bottom
Position of the legend.
109 110 111 |
# File 'cloud_watch/gauge_widget_props.rb', line 109 def legend_position @legend_position end |
#live_data ⇒ Boolean? (readonly)
Default: false
Whether the graph should show live data.
114 115 116 |
# File 'cloud_watch/gauge_widget_props.rb', line 114 def live_data @live_data end |
#metrics ⇒ Array<AWSCDK::CloudWatch::IMetric>? (readonly)
Default: - No metrics
Metrics to display on left Y axis.
119 120 121 |
# File 'cloud_watch/gauge_widget_props.rb', line 119 def metrics @metrics end |
#period ⇒ AWSCDK::Duration? (readonly)
Default: cdk.Duration.seconds(300)
The default period for all metrics in this widget.
The period is the length of time represented by one data point on the graph. This default can be overridden within each metric definition.
127 128 129 |
# File 'cloud_watch/gauge_widget_props.rb', line 127 def period @period end |
#region ⇒ String? (readonly)
Default: - Current region
The region the metrics of this graph should be taken from.
76 77 78 |
# File 'cloud_watch/gauge_widget_props.rb', line 76 def region @region end |
#set_period_to_time_range ⇒ Boolean? (readonly)
Default: false
Whether to show the value from the entire time range. Only applicable for Bar and Pie charts.
If false, values will be from the most recent period of your chosen time range; if true, shows the value from the entire time range.
135 136 137 |
# File 'cloud_watch/gauge_widget_props.rb', line 135 def set_period_to_time_range @set_period_to_time_range end |
#start ⇒ String? (readonly)
Default: When the dashboard loads, the start time will be the default time range.
The start of the time range to use for each widget independently from those of the dashboard.
You can specify start without specifying end to specify a relative time range that ends with the current time. In this case, the value of start must begin with -P, and you can use M, H, D, W and M as abbreviations for minutes, hours, days, weeks and months. For example, -PT8H shows the last 8 hours and -P3M shows the last three months. You can also use start along with an end field, to specify an absolute time range. When specifying an absolute time range, use the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.
146 147 148 |
# File 'cloud_watch/gauge_widget_props.rb', line 146 def start @start end |
#statistic ⇒ String? (readonly)
Default: - The statistic for each metric is used
The default statistic to be displayed for each metric.
This default can be overridden within the definition of each individual metric
153 154 155 |
# File 'cloud_watch/gauge_widget_props.rb', line 153 def statistic @statistic end |
#title ⇒ String? (readonly)
Default: - None
Title for the graph.
81 82 83 |
# File 'cloud_watch/gauge_widget_props.rb', line 81 def title @title end |
#width ⇒ Numeric? (readonly)
Default: 6
Width of the widget, in a grid of 24 units wide.
86 87 88 |
# File 'cloud_watch/gauge_widget_props.rb', line 86 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'cloud_watch/gauge_widget_props.rb', line 155 def self.jsii_properties { :account_id => "accountId", :height => "height", :region => "region", :title => "title", :width => "width", :annotations => "annotations", :_end => "end", :left_y_axis => "leftYAxis", :legend_position => "legendPosition", :live_data => "liveData", :metrics => "metrics", :period => "period", :set_period_to_time_range => "setPeriodToTimeRange", :start => "start", :statistic => "statistic", } end |
Instance Method Details
#to_jsii ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'cloud_watch/gauge_widget_props.rb', line 175 def to_jsii result = {} result.merge!(super) result.merge!({ "accountId" => @account_id, "height" => @height, "region" => @region, "title" => @title, "width" => @width, "annotations" => @annotations, "end" => @_end, "leftYAxis" => @left_y_axis, "legendPosition" => @legend_position, "liveData" => @live_data, "metrics" => @metrics, "period" => @period, "setPeriodToTimeRange" => @set_period_to_time_range, "start" => @start, "statistic" => @statistic, }) result.compact end |