Class: AWSCDK::IoT::CfnFleetMetricProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t/cfn_fleet_metric_props.rb

Overview

Properties for defining a CfnFleetMetric.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric_name:, aggregation_field: nil, aggregation_type: nil, description: nil, index_name: nil, period: nil, query_string: nil, query_version: nil, tags: nil, unit: nil) ⇒ CfnFleetMetricProps

Returns a new instance of CfnFleetMetricProps.

Parameters:

  • metric_name (String)

    The name of the fleet metric to create.

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

    The field to aggregate.

  • aggregation_type (AWSCDK::IResolvable, AWSCDK::IoT::CfnFleetMetric::AggregationTypeProperty, nil) (defaults to: nil)

    The type of the aggregation query.

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

    The fleet metric description.

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

    The name of the index to search.

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

    The time in seconds between fleet metric emissions.

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

    The search query string.

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

    The query version.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    Metadata which can be used to manage the fleet metric.

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

    Used to support unit transformation such as milliseconds to seconds.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'io_t/cfn_fleet_metric_props.rb', line 19

def initialize(metric_name:, aggregation_field: nil, aggregation_type: nil, description: nil, index_name: nil, period: nil, query_string: nil, query_version: nil, tags: nil, unit: nil)
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  @aggregation_field = aggregation_field
  Jsii::Type.check_type(@aggregation_field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "aggregationField") unless @aggregation_field.nil?
  @aggregation_type = aggregation_type.is_a?(Hash) ? ::AWSCDK::IoT::CfnFleetMetric::AggregationTypeProperty.new(**aggregation_type.transform_keys(&:to_sym)) : aggregation_type
  Jsii::Type.check_type(@aggregation_type, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3QuQ2ZuRmxlZXRNZXRyaWMuQWdncmVnYXRpb25UeXBlUHJvcGVydHkifV19fQ==")), "aggregationType") unless @aggregation_type.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @index_name = index_name
  Jsii::Type.check_type(@index_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "indexName") unless @index_name.nil?
  @period = period
  Jsii::Type.check_type(@period, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "period") unless @period.nil?
  @query_string = query_string
  Jsii::Type.check_type(@query_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryString") unless @query_string.nil?
  @query_version = query_version
  Jsii::Type.check_type(@query_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryVersion") unless @query_version.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil?
end

Instance Attribute Details

#aggregation_fieldString? (readonly)

The field to aggregate.



51
52
53
# File 'io_t/cfn_fleet_metric_props.rb', line 51

def aggregation_field
  @aggregation_field
end

#aggregation_typeAWSCDK::IResolvable, ... (readonly)

The type of the aggregation query.



56
57
58
# File 'io_t/cfn_fleet_metric_props.rb', line 56

def aggregation_type
  @aggregation_type
end

#descriptionString? (readonly)

The fleet metric description.



61
62
63
# File 'io_t/cfn_fleet_metric_props.rb', line 61

def description
  @description
end

#index_nameString? (readonly)

The name of the index to search.



66
67
68
# File 'io_t/cfn_fleet_metric_props.rb', line 66

def index_name
  @index_name
end

#metric_nameString (readonly)

The name of the fleet metric to create.



46
47
48
# File 'io_t/cfn_fleet_metric_props.rb', line 46

def metric_name
  @metric_name
end

#periodNumeric? (readonly)

The time in seconds between fleet metric emissions.

Range [60(1 min), 86400(1 day)] and must be multiple of 60.



73
74
75
# File 'io_t/cfn_fleet_metric_props.rb', line 73

def period
  @period
end

#query_stringString? (readonly)

The search query string.



78
79
80
# File 'io_t/cfn_fleet_metric_props.rb', line 78

def query_string
  @query_string
end

#query_versionString? (readonly)

The query version.



83
84
85
# File 'io_t/cfn_fleet_metric_props.rb', line 83

def query_version
  @query_version
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

Metadata which can be used to manage the fleet metric.



88
89
90
# File 'io_t/cfn_fleet_metric_props.rb', line 88

def tags
  @tags
end

#unitString? (readonly)

Used to support unit transformation such as milliseconds to seconds.

Must be a unit supported by CW metric. Default to null.



95
96
97
# File 'io_t/cfn_fleet_metric_props.rb', line 95

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'io_t/cfn_fleet_metric_props.rb', line 97

def self.jsii_properties
  {
    :metric_name => "metricName",
    :aggregation_field => "aggregationField",
    :aggregation_type => "aggregationType",
    :description => "description",
    :index_name => "indexName",
    :period => "period",
    :query_string => "queryString",
    :query_version => "queryVersion",
    :tags => "tags",
    :unit => "unit",
  }
end

Instance Method Details

#to_jsiiObject



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'io_t/cfn_fleet_metric_props.rb', line 112

def to_jsii
  result = {}
  result.merge!({
    "metricName" => @metric_name,
    "aggregationField" => @aggregation_field,
    "aggregationType" => @aggregation_type,
    "description" => @description,
    "indexName" => @index_name,
    "period" => @period,
    "queryString" => @query_string,
    "queryVersion" => @query_version,
    "tags" => @tags,
    "unit" => @unit,
  })
  result.compact
end