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.
Amazon Web ServicesAuto-ScalingComputeEC2High AvailabilityScaling
MetricDataQuery is a JSON Structure definition published by Amazon EC2 Auto Scaling, describing 5 properties, of which 1 is required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.
{
"$schema": "https://json-structure.org/meta/core/v0/#",
"$id": "https://raw.githubusercontent.com/api-evangelist/amazon-ec2-auto-scaling/refs/heads/main/json-structure/ec2-auto-scaling-metric-data-query-structure.json",
"name": "MetricDataQuery",
"description": "<p>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.</p> <p>For more information and examples, see <a href=\"https://docs.aws.amazon.com/autoscaling/ec2/userguide/predictive-scaling-customized-metric-specification.html\">Advanced predictive scaling policy configurations using custom metrics</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p>",
"type": "object",
"properties": {
"Id": {
"allOf": [
{
"$ref": "#/components/schemas/XmlStringMaxLen255"
},
{
"description": "A short name that identifies the object's results in the response. This name must be unique among all <code>MetricDataQuery</code> 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. "
}
]
},
"Expression": {
"allOf": [
{
"$ref": "#/components/schemas/XmlStringMaxLen1023"
},
{
"description": "<p>The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the <code>Id</code> of the other metrics to refer to those metrics, and can also use the <code>Id</code> of other expressions to use the result of those expressions. </p> <p>Conditional: Within each <code>MetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>"
}
]
},
"MetricStat": {
"allOf": [
{
"$ref": "#/components/schemas/MetricStat"
},
{
"description": "<p>Information about the metric data to return.</p> <p>Conditional: Within each <code>MetricDataQuery</code> object, you must specify either <code>Expression</code> or <code>MetricStat</code>, but not both.</p>"
}
]
},
"Label": {
"allOf": [
{
"$ref": "#/components/schemas/XmlStringMetricLabel"
},
{
"description": "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."
}
]
},
"ReturnData": {
"allOf": [
{
"$ref": "#/components/schemas/ReturnData"
},
{
"description": "<p>Indicates whether to return the timestamps and raw data values of this metric. </p> <p>If you use any math expressions, specify <code>true</code> for this value for only the final math expression that the metric specification is based on. You must specify <code>false</code> for <code>ReturnData</code> for all the other metrics and expressions used in the metric specification.</p> <p>If you are only retrieving metrics and not performing any math expressions, do not specify anything for <code>ReturnData</code>. This sets it to its default (<code>true</code>).</p>"
}
]
}
},
"required": [
"Id"
]
}
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.