Class: AWSCDK::CloudWatch::SingleValueWidgetProps
- Inherits:
-
MetricWidgetProps
- Object
- MetricWidgetProps
- AWSCDK::CloudWatch::SingleValueWidgetProps
- Defined in:
- cloud_watch/single_value_widget_props.rb
Overview
Properties for a SingleValueWidget.
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.
-
#full_precision ⇒ Boolean?
readonly
Whether to show as many digits as can fit, before rounding.
-
#height ⇒ Numeric?
readonly
Height of the widget.
-
#metrics ⇒ Array<AWSCDK::CloudWatch::IMetric>
readonly
Metrics to display.
-
#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.
-
#sparkline ⇒ Boolean?
readonly
Whether to show a graph below the value illustrating the value for the whole time range.
-
#start ⇒ String?
readonly
The start of the time range to use for each widget independently from those of the dashboard.
-
#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, metrics:, _end: nil, full_precision: nil, period: nil, set_period_to_time_range: nil, sparkline: nil, start: nil) ⇒ SingleValueWidgetProps
constructor
A new instance of SingleValueWidgetProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, metrics:, _end: nil, full_precision: nil, period: nil, set_period_to_time_range: nil, sparkline: nil, start: nil) ⇒ SingleValueWidgetProps
Returns a new instance of SingleValueWidgetProps.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'cloud_watch/single_value_widget_props.rb', line 19 def initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, metrics:, _end: nil, full_precision: nil, period: nil, set_period_to_time_range: nil, sparkline: nil, start: 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? @metrics = metrics Jsii::Type.check_type(@metrics, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLklNZXRyaWMifSwia2luZCI6ImFycmF5In19")), "metrics") @_end = _end Jsii::Type.check_type(@_end, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "end") unless @_end.nil? @full_precision = full_precision Jsii::Type.check_type(@full_precision, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "fullPrecision") unless @full_precision.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? @sparkline = sparkline Jsii::Type.check_type(@sparkline, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "sparkline") unless @sparkline.nil? @start = start Jsii::Type.check_type(@start, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "start") unless @start.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.
89 90 91 |
# File 'cloud_watch/single_value_widget_props.rb', line 89 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
57 58 59 |
# File 'cloud_watch/single_value_widget_props.rb', line 57 def account_id @account_id end |
#full_precision ⇒ Boolean? (readonly)
Default: false
Whether to show as many digits as can fit, before rounding.
94 95 96 |
# File 'cloud_watch/single_value_widget_props.rb', line 94 def full_precision @full_precision 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.
62 63 64 |
# File 'cloud_watch/single_value_widget_props.rb', line 62 def height @height end |
#metrics ⇒ Array<AWSCDK::CloudWatch::IMetric> (readonly)
Metrics to display.
81 82 83 |
# File 'cloud_watch/single_value_widget_props.rb', line 81 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.
102 103 104 |
# File 'cloud_watch/single_value_widget_props.rb', line 102 def period @period end |
#region ⇒ String? (readonly)
Default: - Current region
The region the metrics of this graph should be taken from.
67 68 69 |
# File 'cloud_watch/single_value_widget_props.rb', line 67 def region @region end |
#set_period_to_time_range ⇒ Boolean? (readonly)
Default: false
Whether to show the value from the entire time range.
107 108 109 |
# File 'cloud_watch/single_value_widget_props.rb', line 107 def set_period_to_time_range @set_period_to_time_range end |
#sparkline ⇒ Boolean? (readonly)
Default: false
Whether to show a graph below the value illustrating the value for the whole time range.
Cannot be used in combination with set_period_to_time_range
114 115 116 |
# File 'cloud_watch/single_value_widget_props.rb', line 114 def sparkline @sparkline 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.
125 126 127 |
# File 'cloud_watch/single_value_widget_props.rb', line 125 def start @start end |
#title ⇒ String? (readonly)
Default: - None
Title for the graph.
72 73 74 |
# File 'cloud_watch/single_value_widget_props.rb', line 72 def title @title end |
#width ⇒ Numeric? (readonly)
Default: 6
Width of the widget, in a grid of 24 units wide.
77 78 79 |
# File 'cloud_watch/single_value_widget_props.rb', line 77 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'cloud_watch/single_value_widget_props.rb', line 127 def self.jsii_properties { :account_id => "accountId", :height => "height", :region => "region", :title => "title", :width => "width", :metrics => "metrics", :_end => "end", :full_precision => "fullPrecision", :period => "period", :set_period_to_time_range => "setPeriodToTimeRange", :sparkline => "sparkline", :start => "start", } end |
Instance Method Details
#to_jsii ⇒ Object
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'cloud_watch/single_value_widget_props.rb', line 144 def to_jsii result = {} result.merge!(super) result.merge!({ "accountId" => @account_id, "height" => @height, "region" => @region, "title" => @title, "width" => @width, "metrics" => @metrics, "end" => @_end, "fullPrecision" => @full_precision, "period" => @period, "setPeriodToTimeRange" => @set_period_to_time_range, "sparkline" => @sparkline, "start" => @start, }) result.compact end |