Class: AWSCDK::CloudWatch::CfnAlarm::MetricProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::CfnAlarm::MetricProperty
- Defined in:
- cloud_watch/cfn_alarm.rb
Overview
The Metric property type represents a specific metric.
Metric is a property of the MetricStat property type.
Instance Attribute Summary collapse
-
#dimensions ⇒ AWSCDK::IResolvable, ...
readonly
The metric dimensions that you want to be used for the metric that the alarm will watch.
-
#metric_name ⇒ String?
readonly
The name of the metric that you want the alarm to watch.
-
#namespace ⇒ String?
readonly
The namespace of the metric that the alarm will watch.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dimensions: nil, metric_name: nil, namespace: nil) ⇒ MetricProperty
constructor
A new instance of MetricProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(dimensions: nil, metric_name: nil, namespace: nil) ⇒ MetricProperty
Returns a new instance of MetricProperty.
1105 1106 1107 1108 1109 1110 1111 1112 |
# File 'cloud_watch/cfn_alarm.rb', line 1105 def initialize(dimensions: nil, metric_name: nil, namespace: nil) @dimensions = dimensions Jsii::Type.check_type(@dimensions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5DZm5BbGFybS5EaW1lbnNpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "dimensions") unless @dimensions.nil? @metric_name = metric_name Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") unless @metric_name.nil? @namespace = namespace Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil? end |
Instance Attribute Details
#dimensions ⇒ AWSCDK::IResolvable, ... (readonly)
The metric dimensions that you want to be used for the metric that the alarm will watch.
1118 1119 1120 |
# File 'cloud_watch/cfn_alarm.rb', line 1118 def dimensions @dimensions end |
#metric_name ⇒ String? (readonly)
The name of the metric that you want the alarm to watch.
This is a required field.
1125 1126 1127 |
# File 'cloud_watch/cfn_alarm.rb', line 1125 def metric_name @metric_name end |
#namespace ⇒ String? (readonly)
The namespace of the metric that the alarm will watch.
1130 1131 1132 |
# File 'cloud_watch/cfn_alarm.rb', line 1130 def namespace @namespace end |
Class Method Details
.jsii_properties ⇒ Object
1132 1133 1134 1135 1136 1137 1138 |
# File 'cloud_watch/cfn_alarm.rb', line 1132 def self.jsii_properties { :dimensions => "dimensions", :metric_name => "metricName", :namespace => "namespace", } end |
Instance Method Details
#to_jsii ⇒ Object
1140 1141 1142 1143 1144 1145 1146 1147 1148 |
# File 'cloud_watch/cfn_alarm.rb', line 1140 def to_jsii result = {} result.merge!({ "dimensions" => @dimensions, "metricName" => @metric_name, "namespace" => @namespace, }) result.compact end |