GetPredictiveScalingForecast
Retrieves the forecast data for a predictive scaling policy.
Load forecasts are predictions of the hourly load values using historical load data from CloudWatch and an analysis of historical trends. Capacity forecasts are represented as predicted values for the minimum capacity that is needed on an hourly basis, based on the hourly load forecast.
A minimum of 24 hours of data is required to create the initial forecasts. However, having a full 14 days of historical data results in more accurate forecasts.
Request Syntax
{
"EndTime": number
,
"PolicyName": "string
",
"ResourceId": "string
",
"ScalableDimension": "string
",
"ServiceNamespace": "string
",
"StartTime": number
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- EndTime
-
The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is 30 days.
Type: Timestamp
Required: Yes
- PolicyName
-
The name of the policy.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
\p{Print}+
Required: Yes
- ResourceId
-
The identifier of the resource.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1600.
Pattern:
[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
Required: Yes
- ScalableDimension
-
The scalable dimension.
Type: String
Valid Values:
ecs:service:DesiredCount | ec2:spot-fleet-request:TargetCapacity | elasticmapreduce:instancegroup:InstanceCount | appstream:fleet:DesiredCapacity | dynamodb:table:ReadCapacityUnits | dynamodb:table:WriteCapacityUnits | dynamodb:index:ReadCapacityUnits | dynamodb:index:WriteCapacityUnits | rds:cluster:ReadReplicaCount | sagemaker:variant:DesiredInstanceCount | custom-resource:ResourceType:Property | comprehend:document-classifier-endpoint:DesiredInferenceUnits | comprehend:entity-recognizer-endpoint:DesiredInferenceUnits | lambda:function:ProvisionedConcurrency | cassandra:table:ReadCapacityUnits | cassandra:table:WriteCapacityUnits | kafka:broker-storage:VolumeSize | elasticache:replication-group:NodeGroups | elasticache:replication-group:Replicas | neptune:cluster:ReadReplicaCount | sagemaker:variant:DesiredProvisionedConcurrency | sagemaker:inference-component:DesiredCopyCount | workspaces:workspacespool:DesiredUserSessions
Required: Yes
- ServiceNamespace
-
The namespace of the Amazon service that provides the resource. For a resource provided by your own application or service, use
custom-resource
instead.Type: String
Valid Values:
ecs | elasticmapreduce | ec2 | appstream | dynamodb | rds | sagemaker | custom-resource | comprehend | lambda | cassandra | kafka | elasticache | neptune | workspaces
Required: Yes
- StartTime
-
The inclusive start time of the time range for the forecast data to get. At most, the date and time can be one year before the current date and time
Type: Timestamp
Required: Yes
Response Syntax
{
"CapacityForecast": {
"Timestamps": [ number ],
"Values": [ number ]
},
"LoadForecast": [
{
"MetricSpecification": {
"CustomizedCapacityMetricSpecification": {
"MetricDataQueries": [
{
"Expression": "string",
"Id": "string",
"Label": "string",
"MetricStat": {
"Metric": {
"Dimensions": [
{
"Name": "string",
"Value": "string"
}
],
"MetricName": "string",
"Namespace": "string"
},
"Stat": "string",
"Unit": "string"
},
"ReturnData": boolean
}
]
},
"CustomizedLoadMetricSpecification": {
"MetricDataQueries": [
{
"Expression": "string",
"Id": "string",
"Label": "string",
"MetricStat": {
"Metric": {
"Dimensions": [
{
"Name": "string",
"Value": "string"
}
],
"MetricName": "string",
"Namespace": "string"
},
"Stat": "string",
"Unit": "string"
},
"ReturnData": boolean
}
]
},
"CustomizedScalingMetricSpecification": {
"MetricDataQueries": [
{
"Expression": "string",
"Id": "string",
"Label": "string",
"MetricStat": {
"Metric": {
"Dimensions": [
{
"Name": "string",
"Value": "string"
}
],
"MetricName": "string",
"Namespace": "string"
},
"Stat": "string",
"Unit": "string"
},
"ReturnData": boolean
}
]
},
"PredefinedLoadMetricSpecification": {
"PredefinedMetricType": "string",
"ResourceLabel": "string"
},
"PredefinedMetricPairSpecification": {
"PredefinedMetricType": "string",
"ResourceLabel": "string"
},
"PredefinedScalingMetricSpecification": {
"PredefinedMetricType": "string",
"ResourceLabel": "string"
},
"TargetValue": number
},
"Timestamps": [ number ],
"Values": [ number ]
}
],
"UpdateTime": number
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- CapacityForecast
-
The capacity forecast.
Type: CapacityForecast object
- LoadForecast
-
The load forecast.
Type: Array of LoadForecast objects
- UpdateTime
-
The time the forecast was made.
Type: Timestamp
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServiceException
-
The service encountered an internal error.
HTTP Status Code: 400
- ValidationException
-
An exception was thrown for a validation issue. Review the available parameters for the API request.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: