Class: AWSCDK::CloudWatch::GraphWidget

Inherits:
ConcreteWidget
  • Object
show all
Defined in:
cloud_watch/graph_widget.rb

Overview

A dashboard widget that displays metrics.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ GraphWidget

Returns a new instance of GraphWidget.



9
10
11
12
13
# File 'cloud_watch/graph_widget.rb', line 9

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::GraphWidgetProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5HcmFwaFdpZGdldFByb3BzIn0=")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'cloud_watch/graph_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_left_metric => { kind: :method, name: "addLeftMetric", is_optional: false },
    :add_right_metric => { kind: :method, name: "addRightMetric", is_optional: false },
  }
end

Instance Method Details

#add_left_metric(metric) ⇒ void

This method returns an undefined value.

Add another metric to the left Y axis of the GraphWidget.

Parameters:



112
113
114
115
# File 'cloud_watch/graph_widget.rb', line 112

def add_left_metric(metric)
  Jsii::Type.check_type(metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "metric")
  jsii_call_method("addLeftMetric", [metric])
end

#add_right_metric(metric) ⇒ void

This method returns an undefined value.

Add another metric to the right Y axis of the GraphWidget.

Parameters:



121
122
123
124
# File 'cloud_watch/graph_widget.rb', line 121

def add_right_metric(metric)
  Jsii::Type.check_type(metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "metric")
  jsii_call_method("addRightMetric", [metric])
end

#copy_metric_warnings(*ms) ⇒ void

This method returns an undefined value.

Copy the warnings from the given metric.

Parameters:



83
84
85
86
87
88
# File 'cloud_watch/graph_widget.rb', line 83

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

#heightNumeric

The amount of vertical grid units the widget will take up.

Returns:

  • (Numeric)


34
35
36
# File 'cloud_watch/graph_widget.rb', line 34

def height()
  jsii_get_property("height")
end

#position(x, y) ⇒ void

This method returns an undefined value.

Place the widget at a given position.

Parameters:

  • x (Numeric)
  • y (Numeric)


95
96
97
98
99
# File 'cloud_watch/graph_widget.rb', line 95

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_jsonArray<Object>

Return the widget JSON for use in the dashboard.

Returns:

  • (Array<Object>)


104
105
106
# File 'cloud_watch/graph_widget.rb', line 104

def to_json()
  jsii_call_method("toJson", [])
end

#warningsArray<String>?

Any warnings that are produced as a result of putting together this widget.

Returns:

  • (Array<String>, nil)


48
49
50
# File 'cloud_watch/graph_widget.rb', line 48

def warnings()
  jsii_get_property("warnings")
end

#warnings_v2Hash{String => String}?

Any warnings that are produced as a result of putting together this widget.

Returns:

  • (Hash{String => String}, nil)


55
56
57
# File 'cloud_watch/graph_widget.rb', line 55

def warnings_v2()
  jsii_get_property("warningsV2")
end

#widthNumeric

The amount of horizontal grid units the widget will take up.

Returns:

  • (Numeric)


41
42
43
# File 'cloud_watch/graph_widget.rb', line 41

def width()
  jsii_get_property("width")
end

#xNumeric?

Returns:

  • (Numeric, nil)


60
61
62
# File 'cloud_watch/graph_widget.rb', line 60

def x()
  jsii_get_property("x")
end

#x=(value) ⇒ Object



64
65
66
67
# File 'cloud_watch/graph_widget.rb', line 64

def x=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "x") unless value.nil?
  jsii_set_property("x", value)
end

#yNumeric?

Returns:

  • (Numeric, nil)


70
71
72
# File 'cloud_watch/graph_widget.rb', line 70

def y()
  jsii_get_property("y")
end

#y=(value) ⇒ Object



74
75
76
77
# File 'cloud_watch/graph_widget.rb', line 74

def y=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "y") unless value.nil?
  jsii_set_property("y", value)
end