{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.ApplicationAutoScaling.Types
(
applicationAutoScaling
, _ValidationException
, _FailedResourceAccessException
, _InvalidNextTokenException
, _ConcurrentUpdateException
, _InternalServiceException
, _ObjectNotFoundException
, _LimitExceededException
, AdjustmentType (..)
, MetricAggregationType (..)
, MetricStatistic (..)
, MetricType (..)
, PolicyType (..)
, ScalableDimension (..)
, ScalingActivityStatusCode (..)
, ServiceNamespace (..)
, Alarm
, alarm
, aAlarmName
, aAlarmARN
, CustomizedMetricSpecification
, customizedMetricSpecification
, cmsDimensions
, cmsUnit
, cmsMetricName
, cmsNamespace
, cmsStatistic
, MetricDimension
, metricDimension
, mdName
, mdValue
, PredefinedMetricSpecification
, predefinedMetricSpecification
, pmsResourceLabel
, pmsPredefinedMetricType
, ScalableTarget
, scalableTarget
, stServiceNamespace
, stResourceId
, stScalableDimension
, stMinCapacity
, stMaxCapacity
, stRoleARN
, stCreationTime
, ScalableTargetAction
, scalableTargetAction
, staMaxCapacity
, staMinCapacity
, ScalingActivity
, scalingActivity
, sStatusMessage
, sEndTime
, sDetails
, sActivityId
, sServiceNamespace
, sResourceId
, sScalableDimension
, sDescription
, sCause
, sStartTime
, sStatusCode
, ScalingPolicy
, scalingPolicy
, spTargetTrackingScalingPolicyConfiguration
, spStepScalingPolicyConfiguration
, spAlarms
, spPolicyARN
, spPolicyName
, spServiceNamespace
, spResourceId
, spScalableDimension
, spPolicyType
, spCreationTime
, ScheduledAction
, scheduledAction
, saScalableDimension
, saStartTime
, saEndTime
, saScalableTargetAction
, saScheduledActionName
, saScheduledActionARN
, saServiceNamespace
, saSchedule
, saResourceId
, saCreationTime
, StepAdjustment
, stepAdjustment
, saMetricIntervalLowerBound
, saMetricIntervalUpperBound
, saScalingAdjustment
, StepScalingPolicyConfiguration
, stepScalingPolicyConfiguration
, sspcStepAdjustments
, sspcAdjustmentType
, sspcCooldown
, sspcMetricAggregationType
, sspcMinAdjustmentMagnitude
, TargetTrackingScalingPolicyConfiguration
, targetTrackingScalingPolicyConfiguration
, ttspcPredefinedMetricSpecification
, ttspcScaleInCooldown
, ttspcCustomizedMetricSpecification
, ttspcDisableScaleIn
, ttspcScaleOutCooldown
, ttspcTargetValue
) where
import Network.AWS.ApplicationAutoScaling.Types.Product
import Network.AWS.ApplicationAutoScaling.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
applicationAutoScaling :: Service
applicationAutoScaling =
Service
{ _svcAbbrev = "ApplicationAutoScaling"
, _svcSigner = v4
, _svcPrefix = "autoscaling"
, _svcVersion = "2016-02-06"
, _svcEndpoint = defaultEndpoint applicationAutoScaling
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "ApplicationAutoScaling"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottledException" . hasStatus 400) e =
Just "throttled_exception"
| has (hasStatus 429) e = Just "too_many_requests"
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 504) e = Just "gateway_timeout"
| has (hasCode "RequestThrottledException" . hasStatus 400) e =
Just "request_throttled_exception"
| has (hasStatus 502) e = Just "bad_gateway"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
_ValidationException :: AsError a => Getting (First ServiceError) a ServiceError
_ValidationException =
_MatchServiceError applicationAutoScaling "ValidationException"
_FailedResourceAccessException :: AsError a => Getting (First ServiceError) a ServiceError
_FailedResourceAccessException =
_MatchServiceError applicationAutoScaling "FailedResourceAccessException"
_InvalidNextTokenException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNextTokenException =
_MatchServiceError applicationAutoScaling "InvalidNextTokenException"
_ConcurrentUpdateException :: AsError a => Getting (First ServiceError) a ServiceError
_ConcurrentUpdateException =
_MatchServiceError applicationAutoScaling "ConcurrentUpdateException"
_InternalServiceException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServiceException =
_MatchServiceError applicationAutoScaling "InternalServiceException"
_ObjectNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ObjectNotFoundException =
_MatchServiceError applicationAutoScaling "ObjectNotFoundException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException =
_MatchServiceError applicationAutoScaling "LimitExceededException"