Class: AWSCDK::CloudWatch::TableWidgetProps

Inherits:
MetricWidgetProps
  • Object
show all
Defined in:
cloud_watch/table_widget_props.rb

Overview

Properties for a TableWidget.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, _end: nil, full_precision: nil, layout: nil, live_data: nil, metrics: nil, period: nil, set_period_to_time_range: nil, show_units_in_label: nil, start: nil, statistic: nil, summary: nil, thresholds: nil) ⇒ TableWidgetProps

Returns a new instance of TableWidgetProps.

Parameters:

  • account_id (String, nil) (defaults to: nil)

    The AWS account ID where the metrics are located.

  • height (Numeric, nil) (defaults to: nil)

    Height of the widget.

  • region (String, nil) (defaults to: nil)

    The region the metrics of this graph should be taken from.

  • title (String, nil) (defaults to: nil)

    Title for the graph.

  • width (Numeric, nil) (defaults to: nil)

    Width of the widget, in a grid of 24 units wide.

  • _end (String, nil) (defaults to: nil)

    The end of the time range to use for each widget independently from those of the dashboard.

  • full_precision (Boolean, nil) (defaults to: nil)

    Whether to show as many digits as can fit, before rounding.

  • layout (AWSCDK::CloudWatch::TableLayout, nil) (defaults to: nil)

    Table layout.

  • live_data (Boolean, nil) (defaults to: nil)

    Whether the graph should show live data.

  • metrics (Array<AWSCDK::CloudWatch::IMetric>, nil) (defaults to: nil)

    Metrics to display in the table.

  • period (AWSCDK::Duration, nil) (defaults to: nil)

    The default period for all metrics in this widget.

  • set_period_to_time_range (Boolean, nil) (defaults to: nil)

    Whether to show the value from the entire time range. Only applicable for Bar and Pie charts.

  • show_units_in_label (Boolean, nil) (defaults to: nil)

    Show the metrics units in the label column.

  • start (String, nil) (defaults to: nil)

    The start of the time range to use for each widget independently from those of the dashboard.

  • statistic (String, nil) (defaults to: nil)

    The default statistic to be displayed for each metric.

  • summary (AWSCDK::CloudWatch::TableSummaryProps, nil) (defaults to: nil)

    Properties for displaying summary columns.

  • thresholds (Array<AWSCDK::CloudWatch::TableThreshold>, nil) (defaults to: nil)

    Thresholds for highlighting table cells.



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
54
55
56
57
58
59
# File 'cloud_watch/table_widget_props.rb', line 24

def initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, _end: nil, full_precision: nil, layout: nil, live_data: nil, metrics: nil, period: nil, set_period_to_time_range: nil, show_units_in_label: nil, start: nil, statistic: nil, summary: nil, thresholds: nil)
  @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?
  @_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?
  @layout = layout
  Jsii::Type.check_type(@layout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5UYWJsZUxheW91dCJ9")), "layout") unless @layout.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?
  @show_units_in_label = show_units_in_label
  Jsii::Type.check_type(@show_units_in_label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "showUnitsInLabel") unless @show_units_in_label.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?
  @summary = summary.is_a?(Hash) ? ::AWSCDK::CloudWatch::TableSummaryProps.new(**summary.transform_keys(&:to_sym)) : summary
  Jsii::Type.check_type(@summary, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5UYWJsZVN1bW1hcnlQcm9wcyJ9")), "summary") unless @summary.nil?
  @thresholds = thresholds
  Jsii::Type.check_type(@thresholds, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLlRhYmxlVGhyZXNob2xkIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "thresholds") unless @thresholds.nil?
end

Instance Attribute Details

#_endString? (readonly)

Note:

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.

Returns:

  • (String, nil)


100
101
102
# File 'cloud_watch/table_widget_props.rb', line 100

def _end
  @_end
end

#account_idString? (readonly)

Note:

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

Returns:

  • (String, nil)


72
73
74
# File 'cloud_watch/table_widget_props.rb', line 72

def 
  @account_id
end

#full_precisionBoolean? (readonly)

Note:

Default: false

Whether to show as many digits as can fit, before rounding.

Returns:

  • (Boolean, nil)


105
106
107
# File 'cloud_watch/table_widget_props.rb', line 105

def full_precision
  @full_precision
end

#heightNumeric? (readonly)

Note:

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.

Returns:

  • (Numeric, nil)


77
78
79
# File 'cloud_watch/table_widget_props.rb', line 77

def height
  @height
end

#layoutAWSCDK::CloudWatch::TableLayout? (readonly)

Note:

Default: - TableLayout.HORIZONTAL

Table layout.



110
111
112
# File 'cloud_watch/table_widget_props.rb', line 110

def layout
  @layout
end

#live_dataBoolean? (readonly)

Note:

Default: false

Whether the graph should show live data.

Returns:

  • (Boolean, nil)


115
116
117
# File 'cloud_watch/table_widget_props.rb', line 115

def live_data
  @live_data
end

#metricsArray<AWSCDK::CloudWatch::IMetric>? (readonly)

Note:

Default: - No metrics

Metrics to display in the table.

Returns:



120
121
122
# File 'cloud_watch/table_widget_props.rb', line 120

def metrics
  @metrics
end

#periodAWSCDK::Duration? (readonly)

Note:

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.

Returns:



128
129
130
# File 'cloud_watch/table_widget_props.rb', line 128

def period
  @period
end

#regionString? (readonly)

Note:

Default: - Current region

The region the metrics of this graph should be taken from.

Returns:

  • (String, nil)


82
83
84
# File 'cloud_watch/table_widget_props.rb', line 82

def region
  @region
end

#set_period_to_time_rangeBoolean? (readonly)

Note:

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.

Returns:

  • (Boolean, nil)


136
137
138
# File 'cloud_watch/table_widget_props.rb', line 136

def set_period_to_time_range
  @set_period_to_time_range
end

#show_units_in_labelBoolean? (readonly)

Note:

Default: - false

Show the metrics units in the label column.

Returns:

  • (Boolean, nil)


141
142
143
# File 'cloud_watch/table_widget_props.rb', line 141

def show_units_in_label
  @show_units_in_label
end

#startString? (readonly)

Note:

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.

Returns:

  • (String, nil)


152
153
154
# File 'cloud_watch/table_widget_props.rb', line 152

def start
  @start
end

#statisticString? (readonly)

Note:

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

Returns:

  • (String, nil)


159
160
161
# File 'cloud_watch/table_widget_props.rb', line 159

def statistic
  @statistic
end

#summaryAWSCDK::CloudWatch::TableSummaryProps? (readonly)

Note:

Default: - no summary columns are shown

Properties for displaying summary columns.



164
165
166
# File 'cloud_watch/table_widget_props.rb', line 164

def summary
  @summary
end

#thresholdsArray<AWSCDK::CloudWatch::TableThreshold>? (readonly)

Note:

Default: - No thresholds

Thresholds for highlighting table cells.

Returns:



169
170
171
# File 'cloud_watch/table_widget_props.rb', line 169

def thresholds
  @thresholds
end

#titleString? (readonly)

Note:

Default: - None

Title for the graph.

Returns:

  • (String, nil)


87
88
89
# File 'cloud_watch/table_widget_props.rb', line 87

def title
  @title
end

#widthNumeric? (readonly)

Note:

Default: 6

Width of the widget, in a grid of 24 units wide.

Returns:

  • (Numeric, nil)


92
93
94
# File 'cloud_watch/table_widget_props.rb', line 92

def width
  @width
end

Class Method Details

.jsii_propertiesObject



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'cloud_watch/table_widget_props.rb', line 171

def self.jsii_properties
  {
    :account_id => "accountId",
    :height => "height",
    :region => "region",
    :title => "title",
    :width => "width",
    :_end => "end",
    :full_precision => "fullPrecision",
    :layout => "layout",
    :live_data => "liveData",
    :metrics => "metrics",
    :period => "period",
    :set_period_to_time_range => "setPeriodToTimeRange",
    :show_units_in_label => "showUnitsInLabel",
    :start => "start",
    :statistic => "statistic",
    :summary => "summary",
    :thresholds => "thresholds",
  }
end

Instance Method Details

#to_jsiiObject



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'cloud_watch/table_widget_props.rb', line 193

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "accountId" => @account_id,
    "height" => @height,
    "region" => @region,
    "title" => @title,
    "width" => @width,
    "end" => @_end,
    "fullPrecision" => @full_precision,
    "layout" => @layout,
    "liveData" => @live_data,
    "metrics" => @metrics,
    "period" => @period,
    "setPeriodToTimeRange" => @set_period_to_time_range,
    "showUnitsInLabel" => @show_units_in_label,
    "start" => @start,
    "statistic" => @statistic,
    "summary" => @summary,
    "thresholds" => @thresholds,
  })
  result.compact
end