Class: AWSCDK::IoT::CfnCustomMetricProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::IoT::CfnCustomMetricProps
- Defined in:
- io_t/cfn_custom_metric_props.rb
Overview
Properties for defining a CfnCustomMetric.
Instance Attribute Summary collapse
-
#display_name ⇒ String?
readonly
The friendly name in the console for the custom metric.
-
#metric_name ⇒ String?
readonly
The name of the custom metric.
-
#metric_type ⇒ String
readonly
The type of the custom metric.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
Metadata that can be used to manage the custom metric.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(metric_type:, display_name: nil, metric_name: nil, tags: nil) ⇒ CfnCustomMetricProps
constructor
A new instance of CfnCustomMetricProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(metric_type:, display_name: nil, metric_name: nil, tags: nil) ⇒ CfnCustomMetricProps
Returns a new instance of CfnCustomMetricProps.
13 14 15 16 17 18 19 20 21 22 |
# File 'io_t/cfn_custom_metric_props.rb', line 13 def initialize(metric_type:, display_name: nil, metric_name: nil, tags: nil) @metric_type = metric_type Jsii::Type.check_type(@metric_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricType") @display_name = display_name Jsii::Type.check_type(@display_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayName") unless @display_name.nil? @metric_name = metric_name Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName") unless @metric_name.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? end |
Instance Attribute Details
#display_name ⇒ String? (readonly)
The friendly name in the console for the custom metric.
This name doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. You can update the friendly name after you define it.
37 38 39 |
# File 'io_t/cfn_custom_metric_props.rb', line 37 def display_name @display_name end |
#metric_name ⇒ String? (readonly)
The name of the custom metric.
This will be used in the metric report submitted from the device/thing. The name can't begin with aws: . You can’t change the name after you define it.
44 45 46 |
# File 'io_t/cfn_custom_metric_props.rb', line 44 def metric_name @metric_name end |
#metric_type ⇒ String (readonly)
The type of the custom metric. Types include string-list , ip-address-list , number-list , and number .
The type
numberonly takes a single metric value as an input, but when you submit the metrics value in the DeviceMetrics report, you must pass it as an array with a single value.
30 31 32 |
# File 'io_t/cfn_custom_metric_props.rb', line 30 def metric_type @metric_type end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
Metadata that can be used to manage the custom metric.
49 50 51 |
# File 'io_t/cfn_custom_metric_props.rb', line 49 def @tags end |
Class Method Details
.jsii_properties ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'io_t/cfn_custom_metric_props.rb', line 51 def self.jsii_properties { :metric_type => "metricType", :display_name => "displayName", :metric_name => "metricName", :tags => "tags", } end |
Instance Method Details
#to_jsii ⇒ Object
60 61 62 63 64 65 66 67 68 69 |
# File 'io_t/cfn_custom_metric_props.rb', line 60 def to_jsii result = {} result.merge!({ "metricType" => @metric_type, "displayName" => @display_name, "metricName" => @metric_name, "tags" => @tags, }) result.compact end |