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.
Parameters:
-
service_namespace
(ServiceNamespace)
–
The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use custom-resource instead.
-
resource_id
(ResourceIdMaxLen1600)
–
The identifier of the resource.
-
scalable_dimension
(ScalableDimension)
–
-
policy_name
(PolicyName)
–
-
start_time
(TimestampType)
–
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
-
end_time
(TimestampType)
–
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.
Raises:
Source code in docs_src/capo_application_auto_scaling/_services/application_auto_scaling.py
| def get_predictive_scaling_forecast(
self,
service_namespace: "capo_application_auto_scaling.types.service_namespace.ServiceNamespace",
resource_id: "capo_application_auto_scaling.types.resource_id_max_len1600.ResourceIdMaxLen1600",
scalable_dimension: "capo_application_auto_scaling.types.scalable_dimension.ScalableDimension",
policy_name: "capo_application_auto_scaling.types.policy_name.PolicyName",
start_time: "capo_application_auto_scaling.types.timestamp_type.TimestampType",
end_time: "capo_application_auto_scaling.types.timestamp_type.TimestampType",
*,
config_overrides: Optional[ApplicationAutoScalingClientConfig] = None,
) -> "capo_application_auto_scaling.types.get_predictive_scaling_forecast_response.GetPredictiveScalingForecastResponse":
"""<p>Retrieves the forecast data for a predictive scaling policy.</p> <p>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.</p> <p>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.</p>
Args:
service_namespace: <p> The namespace of the Amazon Web Services service that provides the resource. For a resource provided by your own application or service, use <code>custom-resource</code> instead. </p>
resource_id: <p> The identifier of the resource. </p>
scalable_dimension: <p> The scalable dimension. </p>
policy_name: <p>The name of the policy.</p>
start_time: <p> 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 </p>
end_time: <p> 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. </p>
Raises:
capo_application_auto_scaling.errors.internal_service_exception.InternalServiceException: <p>The service encountered an internal error.</p>
capo_application_auto_scaling.errors.validation_exception.ValidationException: <p>An exception was thrown for a validation issue. Review the available parameters for the API request.</p>
capo_application_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_application_auto_scaling.types.get_predictive_scaling_forecast_request.GetPredictiveScalingForecastRequest]",
) -> OperationResponse[
"capo_application_auto_scaling.types.get_predictive_scaling_forecast_response.GetPredictiveScalingForecastResponse"
]:
import capo_application_auto_scaling._operations.any_scale_frontend_service.get_predictive_scaling_forecast
output, http_response = (
capo_application_auto_scaling._operations.any_scale_frontend_service.get_predictive_scaling_forecast.get_predictive_scaling_forecast(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetPredictiveScalingForecast")
)
input_: capo_application_auto_scaling.types.get_predictive_scaling_forecast_request.GetPredictiveScalingForecastRequest = {
"service_namespace": service_namespace,
"resource_id": resource_id,
"scalable_dimension": scalable_dimension,
"policy_name": policy_name,
"start_time": start_time,
"end_time": end_time,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|