

# GetPredictiveScalingForecast
<a name="API_GetPredictiveScalingForecast"></a>

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.

For more information, see [Predictive scaling for Amazon EC2 Auto Scaling](https://docs.amazonaws.cn/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) in the *Amazon EC2 Auto Scaling User Guide*.

## Request Parameters
<a name="API_GetPredictiveScalingForecast_RequestParameters"></a>

 For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

 ** AutoScalingGroupName **   
The name of the Auto Scaling group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`   
Required: Yes

 ** 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.   
Although this parameter can accept a date and time that is more than two days in the future, the availability of forecast data has limits. Amazon EC2 Auto Scaling only issues forecasts for periods of two days in advance.  
Type: Timestamp  
Required: Yes

 ** PolicyName **   
The name of the policy.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*`   
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 Elements
<a name="API_GetPredictiveScalingForecast_ResponseElements"></a>

The following elements are returned by the service.

 ** CapacityForecast **   
The capacity forecast.  
Type: [CapacityForecast](API_CapacityForecast.md) object

 **LoadForecast.member.N**   
The load forecast.  
Type: Array of [LoadForecast](API_LoadForecast.md) objects

 ** UpdateTime **   
The time the forecast was made.  
Type: Timestamp

## Errors
<a name="API_GetPredictiveScalingForecast_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceContention **   
You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).    
 ** message **   

HTTP Status Code: 500

## Examples
<a name="API_GetPredictiveScalingForecast_Examples"></a>

### Example
<a name="API_GetPredictiveScalingForecast_Example_1"></a>

This example illustrates one usage of GetPredictiveScalingForecast.

#### Sample Request
<a name="API_GetPredictiveScalingForecast_Example_1_Request"></a>

```
https://autoscaling.amazonaws.com/?Action=GetPredictiveScalingForecast
&AutoScalingGroupName=my-asg
&PolicyName=cpu40-predictive-scaling-policy
&StartTime=2021-04-29T08:00:00Z
&EndTIme=2021-05-29T08:00:00Z
&Version=2011-01-01
&AUTHPARAMS
```

## See Also
<a name="API_GetPredictiveScalingForecast_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon Command Line Interface V2](https://docs.amazonaws.cn/goto/cli2/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for .NET V4](https://docs.amazonaws.cn/goto/DotNetSDKV4/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for C\+\+](https://docs.amazonaws.cn/goto/SdkForCpp/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for Go v2](https://docs.amazonaws.cn/goto/SdkForGoV2/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for JavaScript V3](https://docs.amazonaws.cn/goto/SdkForJavaScriptV3/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for Kotlin](https://docs.amazonaws.cn/goto/SdkForKotlin/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for PHP V3](https://docs.amazonaws.cn/goto/SdkForPHPV3/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for Python](https://docs.amazonaws.cn/goto/boto3/autoscaling-2011-01-01/GetPredictiveScalingForecast) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/autoscaling-2011-01-01/GetPredictiveScalingForecast) 