Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricDataQueryProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
application_auto_scaling/cfn_scaling_policy.rb

Overview

The metric data to return.

Also defines whether this call is returning data for one metric only, or whether it is performing a math expression on the values of returned metric statistics to create a new time series. A time series is a series of data points, each of which is associated with a timestamp.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression: nil, id: nil, label: nil, metric_stat: nil, return_data: nil) ⇒ PredictiveScalingMetricDataQueryProperty

Returns a new instance of PredictiveScalingMetricDataQueryProperty.

Parameters:

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

    The math expression to perform on the returned data, if this object is performing a math expression.

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

    A short name that identifies the object's results in the response.

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

    A human-readable label for this metric or expression.

  • metric_stat (AWSCDK::IResolvable, AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricStatProperty, nil) (defaults to: nil)

    Information about the metric data to return.

  • return_data (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Indicates whether to return the timestamps and raw data values of this metric.



928
929
930
931
932
933
934
935
936
937
938
939
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 928

def initialize(expression: nil, id: nil, label: nil, metric_stat: nil, return_data: nil)
  @expression = expression
  Jsii::Type.check_type(@expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression") unless @expression.nil?
  @id = id
  Jsii::Type.check_type(@id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") unless @id.nil?
  @label = label
  Jsii::Type.check_type(@label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "label") unless @label.nil?
  @metric_stat = metric_stat.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricStatProperty.new(**metric_stat.transform_keys(&:to_sym)) : metric_stat
  Jsii::Type.check_type(@metric_stat, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdNZXRyaWNTdGF0UHJvcGVydHkifV19fQ==")), "metricStat") unless @metric_stat.nil?
  @return_data = return_data
  Jsii::Type.check_type(@return_data, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "returnData") unless @return_data.nil?
end

Instance Attribute Details

#expressionString? (readonly)

The math expression to perform on the returned data, if this object is performing a math expression.

This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.



949
950
951
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 949

def expression
  @expression
end

#idString? (readonly)

A short name that identifies the object's results in the response.

This name must be unique among all MetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter.



956
957
958
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 956

def id
  @id
end

#labelString? (readonly)

A human-readable label for this metric or expression.

This is especially useful if this is a math expression, so that you know what the value represents.



963
964
965
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 963

def label
  @label
end

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

Information about the metric data to return.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat , but not both.



970
971
972
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 970

def metric_stat
  @metric_stat
end

#return_dataBoolean, ... (readonly)

Indicates whether to return the timestamps and raw data values of this metric.

If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification.

If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData . This sets it to its default ( true ).



979
980
981
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 979

def return_data
  @return_data
end

Class Method Details

.jsii_propertiesObject



981
982
983
984
985
986
987
988
989
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 981

def self.jsii_properties
  {
    :expression => "expression",
    :id => "id",
    :label => "label",
    :metric_stat => "metricStat",
    :return_data => "returnData",
  }
end

Instance Method Details

#to_jsiiObject



991
992
993
994
995
996
997
998
999
1000
1001
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 991

def to_jsii
  result = {}
  result.merge!({
    "expression" => @expression,
    "id" => @id,
    "label" => @label,
    "metricStat" => @metric_stat,
    "returnData" => @return_data,
  })
  result.compact
end