Class: AWSCDK::CloudWatch::AlarmStatusWidgetProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_watch/alarm_status_widget_props.rb

Overview

Properties for an Alarm Status Widget.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alarms:, height: nil, sort_by: nil, states: nil, title: nil, width: nil) ⇒ AlarmStatusWidgetProps

Returns a new instance of AlarmStatusWidgetProps.

Parameters:

  • alarms (Array<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef>)

    CloudWatch Alarms to show in widget.

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

    Height of the widget.

  • sort_by (AWSCDK::CloudWatch::AlarmStatusWidgetSortBy, nil) (defaults to: nil)

    Specifies how to sort the alarms in the widget.

  • states (Array<AWSCDK::CloudWatch::AlarmState>, nil) (defaults to: nil)

    Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states.

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

    The title of the widget.

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

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



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'cloud_watch/alarm_status_widget_props.rb', line 13

def initialize(alarms:, height: nil, sort_by: nil, states: nil, title: nil, width: nil)
  @alarms = alarms
  Jsii::Type.check_type(@alarms, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2Nsb3Vkd2F0Y2guSUFsYXJtUmVmIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "alarms")
  @height = height
  Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") unless @height.nil?
  @sort_by = sort_by
  Jsii::Type.check_type(@sort_by, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5BbGFybVN0YXR1c1dpZGdldFNvcnRCeSJ9")), "sortBy") unless @sort_by.nil?
  @states = states
  Jsii::Type.check_type(@states, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLkFsYXJtU3RhdGUifSwia2luZCI6ImFycmF5In19")), "states") unless @states.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

Instance Attribute Details

#alarmsArray<AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef> (readonly)

CloudWatch Alarms to show in widget.



31
32
33
# File 'cloud_watch/alarm_status_widget_props.rb', line 31

def alarms
  @alarms
end

#heightNumeric? (readonly)

Note:

Default: 3

Height of the widget.

Returns:

  • (Numeric, nil)


36
37
38
# File 'cloud_watch/alarm_status_widget_props.rb', line 36

def height
  @height
end

#sort_byAWSCDK::CloudWatch::AlarmStatusWidgetSortBy? (readonly)

Note:

Default: - alphabetical order

Specifies how to sort the alarms in the widget.



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

def sort_by
  @sort_by
end

#statesArray<AWSCDK::CloudWatch::AlarmState>? (readonly)

Note:

Default: - all the alarms specified in alarms are displayed.

Use this field to filter the list of alarms displayed in the widget to only those alarms currently in the specified states.

You can specify one or more alarm states in the value for this field. The alarm states that you can specify are ALARM, INSUFFICIENT_DATA, and OK.

If you omit this field or specify an empty array, all the alarms specified in alarms are displayed.

Returns:



51
52
53
# File 'cloud_watch/alarm_status_widget_props.rb', line 51

def states
  @states
end

#titleString? (readonly)

Note:

Default: 'Alarm Status'

The title of the widget.

Returns:

  • (String, nil)


56
57
58
# File 'cloud_watch/alarm_status_widget_props.rb', line 56

def title
  @title
end

#widthNumeric? (readonly)

Note:

Default: 6

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

Returns:

  • (Numeric, nil)


61
62
63
# File 'cloud_watch/alarm_status_widget_props.rb', line 61

def width
  @width
end

Class Method Details

.jsii_propertiesObject



63
64
65
66
67
68
69
70
71
72
# File 'cloud_watch/alarm_status_widget_props.rb', line 63

def self.jsii_properties
  {
    :alarms => "alarms",
    :height => "height",
    :sort_by => "sortBy",
    :states => "states",
    :title => "title",
    :width => "width",
  }
end

Instance Method Details

#to_jsiiObject



74
75
76
77
78
79
80
81
82
83
84
85
# File 'cloud_watch/alarm_status_widget_props.rb', line 74

def to_jsii
  result = {}
  result.merge!({
    "alarms" => @alarms,
    "height" => @height,
    "sortBy" => @sort_by,
    "states" => @states,
    "title" => @title,
    "width" => @width,
  })
  result.compact
end