{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ApplicationAutoScaling.Types
(
defaultService,
_ValidationException,
_FailedResourceAccessException,
_InvalidNextTokenException,
_ConcurrentUpdateException,
_InternalServiceException,
_ObjectNotFoundException,
_LimitExceededException,
AdjustmentType (..),
MetricAggregationType (..),
MetricStatistic (..),
MetricType (..),
PolicyType (..),
ScalableDimension (..),
ScalingActivityStatusCode (..),
ServiceNamespace (..),
Alarm (..),
newAlarm,
alarm_alarmName,
alarm_alarmARN,
CustomizedMetricSpecification (..),
newCustomizedMetricSpecification,
customizedMetricSpecification_dimensions,
customizedMetricSpecification_unit,
customizedMetricSpecification_metricName,
customizedMetricSpecification_namespace,
customizedMetricSpecification_statistic,
MetricDimension (..),
newMetricDimension,
metricDimension_name,
metricDimension_value,
PredefinedMetricSpecification (..),
newPredefinedMetricSpecification,
predefinedMetricSpecification_resourceLabel,
predefinedMetricSpecification_predefinedMetricType,
ScalableTarget (..),
newScalableTarget,
scalableTarget_suspendedState,
scalableTarget_serviceNamespace,
scalableTarget_resourceId,
scalableTarget_scalableDimension,
scalableTarget_minCapacity,
scalableTarget_maxCapacity,
scalableTarget_roleARN,
scalableTarget_creationTime,
ScalableTargetAction (..),
newScalableTargetAction,
scalableTargetAction_maxCapacity,
scalableTargetAction_minCapacity,
ScalingActivity (..),
newScalingActivity,
scalingActivity_statusMessage,
scalingActivity_endTime,
scalingActivity_details,
scalingActivity_activityId,
scalingActivity_serviceNamespace,
scalingActivity_resourceId,
scalingActivity_scalableDimension,
scalingActivity_description,
scalingActivity_cause,
scalingActivity_startTime,
scalingActivity_statusCode,
ScalingPolicy (..),
newScalingPolicy,
scalingPolicy_targetTrackingScalingPolicyConfiguration,
scalingPolicy_stepScalingPolicyConfiguration,
scalingPolicy_alarms,
scalingPolicy_policyARN,
scalingPolicy_policyName,
scalingPolicy_serviceNamespace,
scalingPolicy_resourceId,
scalingPolicy_scalableDimension,
scalingPolicy_policyType,
scalingPolicy_creationTime,
ScheduledAction (..),
newScheduledAction,
scheduledAction_scalableDimension,
scheduledAction_startTime,
scheduledAction_endTime,
scheduledAction_scalableTargetAction,
scheduledAction_timezone,
scheduledAction_scheduledActionName,
scheduledAction_scheduledActionARN,
scheduledAction_serviceNamespace,
scheduledAction_schedule,
scheduledAction_resourceId,
scheduledAction_creationTime,
StepAdjustment (..),
newStepAdjustment,
stepAdjustment_metricIntervalLowerBound,
stepAdjustment_metricIntervalUpperBound,
stepAdjustment_scalingAdjustment,
StepScalingPolicyConfiguration (..),
newStepScalingPolicyConfiguration,
stepScalingPolicyConfiguration_stepAdjustments,
stepScalingPolicyConfiguration_adjustmentType,
stepScalingPolicyConfiguration_cooldown,
stepScalingPolicyConfiguration_metricAggregationType,
stepScalingPolicyConfiguration_minAdjustmentMagnitude,
SuspendedState (..),
newSuspendedState,
suspendedState_dynamicScalingInSuspended,
suspendedState_scheduledScalingSuspended,
suspendedState_dynamicScalingOutSuspended,
TargetTrackingScalingPolicyConfiguration (..),
newTargetTrackingScalingPolicyConfiguration,
targetTrackingScalingPolicyConfiguration_predefinedMetricSpecification,
targetTrackingScalingPolicyConfiguration_scaleInCooldown,
targetTrackingScalingPolicyConfiguration_customizedMetricSpecification,
targetTrackingScalingPolicyConfiguration_disableScaleIn,
targetTrackingScalingPolicyConfiguration_scaleOutCooldown,
targetTrackingScalingPolicyConfiguration_targetValue,
)
where
import Amazonka.ApplicationAutoScaling.Types.AdjustmentType
import Amazonka.ApplicationAutoScaling.Types.Alarm
import Amazonka.ApplicationAutoScaling.Types.CustomizedMetricSpecification
import Amazonka.ApplicationAutoScaling.Types.MetricAggregationType
import Amazonka.ApplicationAutoScaling.Types.MetricDimension
import Amazonka.ApplicationAutoScaling.Types.MetricStatistic
import Amazonka.ApplicationAutoScaling.Types.MetricType
import Amazonka.ApplicationAutoScaling.Types.PolicyType
import Amazonka.ApplicationAutoScaling.Types.PredefinedMetricSpecification
import Amazonka.ApplicationAutoScaling.Types.ScalableDimension
import Amazonka.ApplicationAutoScaling.Types.ScalableTarget
import Amazonka.ApplicationAutoScaling.Types.ScalableTargetAction
import Amazonka.ApplicationAutoScaling.Types.ScalingActivity
import Amazonka.ApplicationAutoScaling.Types.ScalingActivityStatusCode
import Amazonka.ApplicationAutoScaling.Types.ScalingPolicy
import Amazonka.ApplicationAutoScaling.Types.ScheduledAction
import Amazonka.ApplicationAutoScaling.Types.ServiceNamespace
import Amazonka.ApplicationAutoScaling.Types.StepAdjustment
import Amazonka.ApplicationAutoScaling.Types.StepScalingPolicyConfiguration
import Amazonka.ApplicationAutoScaling.Types.SuspendedState
import Amazonka.ApplicationAutoScaling.Types.TargetTrackingScalingPolicyConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
defaultService :: Core.Service
defaultService :: Service
defaultService =
Service :: Abbrev
-> Signer
-> ByteString
-> ByteString
-> ByteString
-> (Region -> Endpoint)
-> Maybe Seconds
-> (Status -> Bool)
-> (Status -> [Header] -> ByteStringLazy -> Error)
-> Retry
-> Service
Core.Service
{ $sel:_serviceAbbrev:Service :: Abbrev
Core._serviceAbbrev =
Abbrev
"ApplicationAutoScaling",
$sel:_serviceSigner:Service :: Signer
Core._serviceSigner = Signer
Sign.v4,
$sel:_serviceEndpointPrefix:Service :: ByteString
Core._serviceEndpointPrefix =
ByteString
"application-autoscaling",
$sel:_serviceSigningName:Service :: ByteString
Core._serviceSigningName = ByteString
"application-autoscaling",
$sel:_serviceVersion:Service :: ByteString
Core._serviceVersion = ByteString
"2016-02-06",
$sel:_serviceEndpoint:Service :: Region -> Endpoint
Core._serviceEndpoint =
Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:_serviceTimeout:Service :: Maybe Seconds
Core._serviceTimeout = Seconds -> Maybe Seconds
forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:_serviceCheck:Service :: Status -> Bool
Core._serviceCheck = Status -> Bool
Core.statusSuccess,
$sel:_serviceError:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core._serviceError =
Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"ApplicationAutoScaling",
$sel:_serviceRetry:Service :: Retry
Core._serviceRetry = Retry
retry
}
where
retry :: Retry
retry =
Exponential :: Double -> Int -> Int -> (ServiceError -> Maybe Text) -> Retry
Core.Exponential
{ $sel:_retryBase:Exponential :: Double
Core._retryBase = Double
5.0e-2,
$sel:_retryGrowth:Exponential :: Int
Core._retryGrowth = Int
2,
$sel:_retryAttempts:Exponential :: Int
Core._retryAttempts = Int
5,
$sel:_retryCheck:Exponential :: ServiceError -> Maybe Text
Core._retryCheck = ServiceError -> Maybe Text
forall a. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| Bool
Prelude.otherwise = Maybe a
forall a. Maybe a
Prelude.Nothing
_ValidationException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ValidationException :: Getting (First ServiceError) a ServiceError
_ValidationException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ValidationException"
_FailedResourceAccessException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_FailedResourceAccessException :: Getting (First ServiceError) a ServiceError
_FailedResourceAccessException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"FailedResourceAccessException"
_InvalidNextTokenException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidNextTokenException :: Getting (First ServiceError) a ServiceError
_InvalidNextTokenException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InvalidNextTokenException"
_ConcurrentUpdateException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ConcurrentUpdateException :: Getting (First ServiceError) a ServiceError
_ConcurrentUpdateException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ConcurrentUpdateException"
_InternalServiceException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InternalServiceException :: Getting (First ServiceError) a ServiceError
_InternalServiceException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InternalServiceException"
_ObjectNotFoundException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ObjectNotFoundException :: Getting (First ServiceError) a ServiceError
_ObjectNotFoundException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ObjectNotFoundException"
_LimitExceededException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_LimitExceededException :: Getting (First ServiceError) a ServiceError
_LimitExceededException =
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"LimitExceededException"