{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.CloudWatch.Types
(
cloudWatch
, _LimitExceededFault
, _DashboardNotFoundError
, _InvalidNextToken
, _InternalServiceFault
, _DashboardInvalidInputError
, _InvalidParameterValueException
, _InvalidFormatFault
, _MissingRequiredParameterException
, _InvalidParameterCombinationException
, _ResourceNotFound
, ComparisonOperator (..)
, HistoryItemType (..)
, ScanBy (..)
, StandardUnit (..)
, StateValue (..)
, Statistic (..)
, StatusCode (..)
, AlarmHistoryItem
, alarmHistoryItem
, ahiAlarmName
, ahiHistoryItemType
, ahiHistoryData
, ahiHistorySummary
, ahiTimestamp
, DashboardEntry
, dashboardEntry
, deSize
, deDashboardName
, deLastModified
, deDashboardARN
, DashboardValidationMessage
, dashboardValidationMessage
, dvmDataPath
, dvmMessage
, Datapoint
, datapoint
, dSampleCount
, dMaximum
, dAverage
, dMinimum
, dExtendedStatistics
, dSum
, dUnit
, dTimestamp
, Dimension
, dimension
, dName
, dValue
, DimensionFilter
, dimensionFilter
, dfValue
, dfName
, MessageData
, messageData
, mValue
, mCode
, Metric
, metric
, mMetricName
, mNamespace
, mDimensions
, MetricAlarm
, metricAlarm
, maAlarmName
, maStateUpdatedTimestamp
, maTreatMissingData
, maPeriod
, maAlarmDescription
, maEvaluationPeriods
, maMetricName
, maNamespace
, maComparisonOperator
, maOKActions
, maEvaluateLowSampleCountPercentile
, maStateValue
, maDatapointsToAlarm
, maThreshold
, maAlarmConfigurationUpdatedTimestamp
, maActionsEnabled
, maInsufficientDataActions
, maStateReason
, maStateReasonData
, maDimensions
, maAlarmARN
, maAlarmActions
, maUnit
, maStatistic
, maExtendedStatistic
, MetricDataQuery
, metricDataQuery
, mdqReturnData
, mdqExpression
, mdqLabel
, mdqMetricStat
, mdqId
, MetricDataResult
, metricDataResult
, mdrValues
, mdrId
, mdrTimestamps
, mdrMessages
, mdrLabel
, mdrStatusCode
, MetricDatum
, metricDatum
, mdValue
, mdStorageResolution
, mdDimensions
, mdUnit
, mdTimestamp
, mdStatisticValues
, mdMetricName
, MetricStat
, metricStat
, msUnit
, msMetric
, msPeriod
, msStat
, StatisticSet
, statisticSet
, ssSampleCount
, ssSum
, ssMinimum
, ssMaximum
) where
import Network.AWS.CloudWatch.Types.Product
import Network.AWS.CloudWatch.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
cloudWatch :: Service
cloudWatch =
Service
{ _svcAbbrev = "CloudWatch"
, _svcSigner = v4
, _svcPrefix = "monitoring"
, _svcVersion = "2010-08-01"
, _svcEndpoint = defaultEndpoint cloudWatch
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseXMLError "CloudWatch"
, _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
_LimitExceededFault :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededFault =
_MatchServiceError cloudWatch "LimitExceeded" . hasStatus 400
_DashboardNotFoundError :: AsError a => Getting (First ServiceError) a ServiceError
_DashboardNotFoundError =
_MatchServiceError cloudWatch "ResourceNotFound" . hasStatus 404
_InvalidNextToken :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidNextToken =
_MatchServiceError cloudWatch "InvalidNextToken" . hasStatus 400
_InternalServiceFault :: AsError a => Getting (First ServiceError) a ServiceError
_InternalServiceFault =
_MatchServiceError cloudWatch "InternalServiceError" . hasStatus 500
_DashboardInvalidInputError :: AsError a => Getting (First ServiceError) a ServiceError
_DashboardInvalidInputError =
_MatchServiceError cloudWatch "InvalidParameterInput" . hasStatus 400
_InvalidParameterValueException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterValueException =
_MatchServiceError cloudWatch "InvalidParameterValue" . hasStatus 400
_InvalidFormatFault :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidFormatFault =
_MatchServiceError cloudWatch "InvalidFormat" . hasStatus 400
_MissingRequiredParameterException :: AsError a => Getting (First ServiceError) a ServiceError
_MissingRequiredParameterException =
_MatchServiceError cloudWatch "MissingParameter" . hasStatus 400
_InvalidParameterCombinationException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterCombinationException =
_MatchServiceError cloudWatch "InvalidParameterCombination" . hasStatus 400
_ResourceNotFound :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFound =
_MatchServiceError cloudWatch "ResourceNotFound" . hasStatus 404