Class CfnScalingPolicy.MetricDataQueryProperty.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.CfnScalingPolicy.MetricDataQueryProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnScalingPolicy.MetricDataQueryProperty>
- Enclosing interface:
CfnScalingPolicy.MetricDataQueryProperty
@Stability(Stable)
public static final class CfnScalingPolicy.MetricDataQueryProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnScalingPolicy.MetricDataQueryProperty>
A builder for
CfnScalingPolicy.MetricDataQueryProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.expression
(String expression) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getExpression()
Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getId()
Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getLabel()
metricStat
(IResolvable metricStat) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getMetricStat()
metricStat
(CfnScalingPolicy.MetricStatProperty metricStat) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getMetricStat()
returnData
(Boolean returnData) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getReturnData()
returnData
(IResolvable returnData) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getReturnData()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
id
Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getId()
- Parameters:
id
- A short name that identifies the object's results in the response. This parameter is required. This name must be unique among allMetricDataQuery
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.- Returns:
this
-
expression
@Stability(Stable) public CfnScalingPolicy.MetricDataQueryProperty.Builder expression(String expression) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getExpression()
- Parameters:
expression
- The math expression to perform on the returned data, if this object is performing a math expression. This expression can use theId
of the other metrics to refer to those metrics, and can also use theId
of other expressions to use the result of those expressions.Conditional: Within each
MetricDataQuery
object, you must specify eitherExpression
orMetricStat
, but not both.- Returns:
this
-
label
Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getLabel()
- Parameters:
label
- 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.- Returns:
this
-
metricStat
@Stability(Stable) public CfnScalingPolicy.MetricDataQueryProperty.Builder metricStat(IResolvable metricStat) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getMetricStat()
- Parameters:
metricStat
- Information about the metric data to return. Conditional: Within eachMetricDataQuery
object, you must specify eitherExpression
orMetricStat
, but not both.- Returns:
this
-
metricStat
@Stability(Stable) public CfnScalingPolicy.MetricDataQueryProperty.Builder metricStat(CfnScalingPolicy.MetricStatProperty metricStat) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getMetricStat()
- Parameters:
metricStat
- Information about the metric data to return. Conditional: Within eachMetricDataQuery
object, you must specify eitherExpression
orMetricStat
, but not both.- Returns:
this
-
returnData
@Stability(Stable) public CfnScalingPolicy.MetricDataQueryProperty.Builder returnData(Boolean returnData) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getReturnData()
- Parameters:
returnData
- Indicates whether to return the timestamps and raw data values of this metric. If you use any math expressions, specifytrue
for this value for only the final math expression that the metric specification is based on. You must specifyfalse
forReturnData
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
).- Returns:
this
-
returnData
@Stability(Stable) public CfnScalingPolicy.MetricDataQueryProperty.Builder returnData(IResolvable returnData) Sets the value ofCfnScalingPolicy.MetricDataQueryProperty.getReturnData()
- Parameters:
returnData
- Indicates whether to return the timestamps and raw data values of this metric. If you use any math expressions, specifytrue
for this value for only the final math expression that the metric specification is based on. You must specifyfalse
forReturnData
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
).- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnScalingPolicy.MetricDataQueryProperty>
- Returns:
- a new instance of
CfnScalingPolicy.MetricDataQueryProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-