{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AutoScalingPlans.Types
(
defaultService,
_ConcurrentUpdateException,
_InternalServiceException,
_InvalidNextTokenException,
_LimitExceededException,
_ObjectNotFoundException,
_ValidationException,
ForecastDataType (..),
LoadMetricType (..),
MetricStatistic (..),
PolicyType (..),
PredictiveScalingMaxCapacityBehavior (..),
PredictiveScalingMode (..),
ScalableDimension (..),
ScalingMetricType (..),
ScalingPlanStatusCode (..),
ScalingPolicyUpdateBehavior (..),
ScalingStatusCode (..),
ServiceNamespace (..),
ApplicationSource (..),
newApplicationSource,
applicationSource_cloudFormationStackARN,
applicationSource_tagFilters,
CustomizedLoadMetricSpecification (..),
newCustomizedLoadMetricSpecification,
customizedLoadMetricSpecification_dimensions,
customizedLoadMetricSpecification_unit,
customizedLoadMetricSpecification_metricName,
customizedLoadMetricSpecification_namespace,
customizedLoadMetricSpecification_statistic,
CustomizedScalingMetricSpecification (..),
newCustomizedScalingMetricSpecification,
customizedScalingMetricSpecification_dimensions,
customizedScalingMetricSpecification_unit,
customizedScalingMetricSpecification_metricName,
customizedScalingMetricSpecification_namespace,
customizedScalingMetricSpecification_statistic,
Datapoint (..),
newDatapoint,
datapoint_timestamp,
datapoint_value,
MetricDimension (..),
newMetricDimension,
metricDimension_name,
metricDimension_value,
PredefinedLoadMetricSpecification (..),
newPredefinedLoadMetricSpecification,
predefinedLoadMetricSpecification_resourceLabel,
predefinedLoadMetricSpecification_predefinedLoadMetricType,
PredefinedScalingMetricSpecification (..),
newPredefinedScalingMetricSpecification,
predefinedScalingMetricSpecification_resourceLabel,
predefinedScalingMetricSpecification_predefinedScalingMetricType,
ScalingInstruction (..),
newScalingInstruction,
scalingInstruction_customizedLoadMetricSpecification,
scalingInstruction_disableDynamicScaling,
scalingInstruction_predefinedLoadMetricSpecification,
scalingInstruction_predictiveScalingMaxCapacityBehavior,
scalingInstruction_predictiveScalingMaxCapacityBuffer,
scalingInstruction_predictiveScalingMode,
scalingInstruction_scalingPolicyUpdateBehavior,
scalingInstruction_scheduledActionBufferTime,
scalingInstruction_serviceNamespace,
scalingInstruction_resourceId,
scalingInstruction_scalableDimension,
scalingInstruction_minCapacity,
scalingInstruction_maxCapacity,
scalingInstruction_targetTrackingConfigurations,
ScalingPlan (..),
newScalingPlan,
scalingPlan_creationTime,
scalingPlan_statusMessage,
scalingPlan_statusStartTime,
scalingPlan_scalingPlanName,
scalingPlan_scalingPlanVersion,
scalingPlan_applicationSource,
scalingPlan_scalingInstructions,
scalingPlan_statusCode,
ScalingPlanResource (..),
newScalingPlanResource,
scalingPlanResource_scalingPolicies,
scalingPlanResource_scalingStatusMessage,
scalingPlanResource_scalingPlanName,
scalingPlanResource_scalingPlanVersion,
scalingPlanResource_serviceNamespace,
scalingPlanResource_resourceId,
scalingPlanResource_scalableDimension,
scalingPlanResource_scalingStatusCode,
ScalingPolicy (..),
newScalingPolicy,
scalingPolicy_targetTrackingConfiguration,
scalingPolicy_policyName,
scalingPolicy_policyType,
TagFilter (..),
newTagFilter,
tagFilter_key,
tagFilter_values,
TargetTrackingConfiguration (..),
newTargetTrackingConfiguration,
targetTrackingConfiguration_customizedScalingMetricSpecification,
targetTrackingConfiguration_disableScaleIn,
targetTrackingConfiguration_estimatedInstanceWarmup,
targetTrackingConfiguration_predefinedScalingMetricSpecification,
targetTrackingConfiguration_scaleInCooldown,
targetTrackingConfiguration_scaleOutCooldown,
targetTrackingConfiguration_targetValue,
)
where
import Amazonka.AutoScalingPlans.Types.ApplicationSource
import Amazonka.AutoScalingPlans.Types.CustomizedLoadMetricSpecification
import Amazonka.AutoScalingPlans.Types.CustomizedScalingMetricSpecification
import Amazonka.AutoScalingPlans.Types.Datapoint
import Amazonka.AutoScalingPlans.Types.ForecastDataType
import Amazonka.AutoScalingPlans.Types.LoadMetricType
import Amazonka.AutoScalingPlans.Types.MetricDimension
import Amazonka.AutoScalingPlans.Types.MetricStatistic
import Amazonka.AutoScalingPlans.Types.PolicyType
import Amazonka.AutoScalingPlans.Types.PredefinedLoadMetricSpecification
import Amazonka.AutoScalingPlans.Types.PredefinedScalingMetricSpecification
import Amazonka.AutoScalingPlans.Types.PredictiveScalingMaxCapacityBehavior
import Amazonka.AutoScalingPlans.Types.PredictiveScalingMode
import Amazonka.AutoScalingPlans.Types.ScalableDimension
import Amazonka.AutoScalingPlans.Types.ScalingInstruction
import Amazonka.AutoScalingPlans.Types.ScalingMetricType
import Amazonka.AutoScalingPlans.Types.ScalingPlan
import Amazonka.AutoScalingPlans.Types.ScalingPlanResource
import Amazonka.AutoScalingPlans.Types.ScalingPlanStatusCode
import Amazonka.AutoScalingPlans.Types.ScalingPolicy
import Amazonka.AutoScalingPlans.Types.ScalingPolicyUpdateBehavior
import Amazonka.AutoScalingPlans.Types.ScalingStatusCode
import Amazonka.AutoScalingPlans.Types.ServiceNamespace
import Amazonka.AutoScalingPlans.Types.TagFilter
import Amazonka.AutoScalingPlans.Types.TargetTrackingConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
defaultService :: Core.Service
defaultService :: Service
defaultService =
Core.Service
{ $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"AutoScalingPlans",
$sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
$sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"autoscaling-plans",
$sel:signingName:Service :: ByteString
Core.signingName = ByteString
"autoscaling-plans",
$sel:version:Service :: ByteString
Core.version = ByteString
"2018-01-06",
$sel:s3AddressingStyle:Service :: S3AddressingStyle
Core.s3AddressingStyle = S3AddressingStyle
Core.S3AddressingStyleAuto,
$sel:endpoint:Service :: Region -> Endpoint
Core.endpoint = Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:timeout:Service :: Maybe Seconds
Core.timeout = forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:check:Service :: Status -> Bool
Core.check = Status -> Bool
Core.statusSuccess,
$sel:error:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core.error = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"AutoScalingPlans",
$sel:retry:Service :: Retry
Core.retry = Retry
retry
}
where
retry :: Retry
retry =
Core.Exponential
{ $sel:base:Exponential :: Double
Core.base = Double
5.0e-2,
$sel:growth:Exponential :: Int
Core.growth = Int
2,
$sel:attempts:Exponential :: Int
Core.attempts = Int
5,
$sel:check:Exponential :: ServiceError -> Maybe Text
Core.check = forall {a}. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Bool
Prelude.otherwise = forall a. Maybe a
Prelude.Nothing
_ConcurrentUpdateException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ConcurrentUpdateException :: forall a. AsError a => Fold a ServiceError
_ConcurrentUpdateException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ConcurrentUpdateException"
_InternalServiceException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InternalServiceException :: forall a. AsError a => Fold a ServiceError
_InternalServiceException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InternalServiceException"
_InvalidNextTokenException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InvalidNextTokenException :: forall a. AsError a => Fold a ServiceError
_InvalidNextTokenException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidNextTokenException"
_LimitExceededException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_LimitExceededException :: forall a. AsError a => Fold a ServiceError
_LimitExceededException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"LimitExceededException"
_ObjectNotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ObjectNotFoundException :: forall a. AsError a => Fold a ServiceError
_ObjectNotFoundException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ObjectNotFoundException"
_ValidationException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ValidationException :: forall a. AsError a => Fold a ServiceError
_ValidationException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ValidationException"