Class: AWSCDK::CloudWatch::TableWidget
- Inherits:
-
ConcreteWidget
- Object
- ConcreteWidget
- AWSCDK::CloudWatch::TableWidget
- Defined in:
- cloud_watch/table_widget.rb
Overview
A dashboard widget that displays metrics.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_metric(metric) ⇒ void
Add another metric.
-
#copy_metric_warnings(*ms) ⇒ void
Copy the warnings from the given metric.
-
#height ⇒ Numeric
The amount of vertical grid units the widget will take up.
-
#initialize(props) ⇒ TableWidget
constructor
A new instance of TableWidget.
-
#position(x, y) ⇒ void
Place the widget at a given position.
-
#to_json ⇒ Array<Object>
Return the widget JSON for use in the dashboard.
-
#warnings ⇒ Array<String>?
Any warnings that are produced as a result of putting together this widget.
-
#warnings_v2 ⇒ Hash{String => String}?
Any warnings that are produced as a result of putting together this widget.
-
#width ⇒ Numeric
The amount of horizontal grid units the widget will take up.
- #x ⇒ Numeric?
- #x=(value) ⇒ Object
- #y ⇒ Numeric?
- #y=(value) ⇒ Object
Constructor Details
#initialize(props) ⇒ TableWidget
Returns a new instance of TableWidget.
9 10 11 12 13 |
# File 'cloud_watch/table_widget.rb', line 9 def initialize(props) props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::TableWidgetProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5UYWJsZVdpZGdldFByb3BzIn0=")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'cloud_watch/table_widget.rb', line 15 def self.jsii_overridable_methods { :height => { kind: :property, name: "height", is_optional: false }, :width => { kind: :property, name: "width", is_optional: false }, :warnings => { kind: :property, name: "warnings", is_optional: true }, :warnings_v2 => { kind: :property, name: "warningsV2", is_optional: true }, :x => { kind: :property, name: "x", is_optional: true }, :y => { kind: :property, name: "y", is_optional: true }, :copy_metric_warnings => { kind: :method, name: "copyMetricWarnings", is_optional: false }, :position => { kind: :method, name: "position", is_optional: false }, :to_json => { kind: :method, name: "toJson", is_optional: false }, :add_metric => { kind: :method, name: "addMetric", is_optional: false }, } end |
Instance Method Details
#add_metric(metric) ⇒ void
This method returns an undefined value.
Add another metric.
111 112 113 114 |
# File 'cloud_watch/table_widget.rb', line 111 def add_metric(metric) Jsii::Type.check_type(metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "metric") jsii_call_method("addMetric", [metric]) end |
#copy_metric_warnings(*ms) ⇒ void
This method returns an undefined value.
Copy the warnings from the given metric.
82 83 84 85 86 87 |
# File 'cloud_watch/table_widget.rb', line 82 def copy_metric_warnings(*ms) ms.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "ms[#{index}]") end jsii_call_method("copyMetricWarnings", [*ms]) end |
#height ⇒ Numeric
The amount of vertical grid units the widget will take up.
33 34 35 |
# File 'cloud_watch/table_widget.rb', line 33 def height() jsii_get_property("height") end |
#position(x, y) ⇒ void
This method returns an undefined value.
Place the widget at a given position.
94 95 96 97 98 |
# File 'cloud_watch/table_widget.rb', line 94 def position(x, y) Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "x") Jsii::Type.check_type(y, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "y") jsii_call_method("position", [x, y]) end |
#to_json ⇒ Array<Object>
Return the widget JSON for use in the dashboard.
103 104 105 |
# File 'cloud_watch/table_widget.rb', line 103 def to_json() jsii_call_method("toJson", []) end |
#warnings ⇒ Array<String>?
Any warnings that are produced as a result of putting together this widget.
47 48 49 |
# File 'cloud_watch/table_widget.rb', line 47 def warnings() jsii_get_property("warnings") end |
#warnings_v2 ⇒ Hash{String => String}?
Any warnings that are produced as a result of putting together this widget.
54 55 56 |
# File 'cloud_watch/table_widget.rb', line 54 def warnings_v2() jsii_get_property("warningsV2") end |
#width ⇒ Numeric
The amount of horizontal grid units the widget will take up.
40 41 42 |
# File 'cloud_watch/table_widget.rb', line 40 def width() jsii_get_property("width") end |
#x ⇒ Numeric?
59 60 61 |
# File 'cloud_watch/table_widget.rb', line 59 def x() jsii_get_property("x") end |
#x=(value) ⇒ Object
63 64 65 66 |
# File 'cloud_watch/table_widget.rb', line 63 def x=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "x") unless value.nil? jsii_set_property("x", value) end |
#y ⇒ Numeric?
69 70 71 |
# File 'cloud_watch/table_widget.rb', line 69 def y() jsii_get_property("y") end |
#y=(value) ⇒ Object
73 74 75 76 |
# File 'cloud_watch/table_widget.rb', line 73 def y=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "y") unless value.nil? jsii_set_property("y", value) end |