{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.ElasticSearch.Types
(
elasticSearch
, _ValidationException
, _ResourceAlreadyExistsException
, _BaseException
, _DisabledOperationException
, _InternalException
, _InvalidTypeException
, _ResourceNotFoundException
, _LimitExceededException
, ESPartitionInstanceType (..)
, OptionState (..)
, VolumeType (..)
, AccessPoliciesStatus
, accessPoliciesStatus
, apsOptions
, apsStatus
, AdvancedOptionsStatus
, advancedOptionsStatus
, aosOptions
, aosStatus
, DomainInfo
, domainInfo
, diDomainName
, EBSOptions
, ebsOptions
, eoVolumeSize
, eoIOPS
, eoVolumeType
, eoEBSEnabled
, EBSOptionsStatus
, ebsOptionsStatus
, eosOptions
, eosStatus
, ElasticsearchClusterConfig
, elasticsearchClusterConfig
, eccDedicatedMasterCount
, eccDedicatedMasterType
, eccDedicatedMasterEnabled
, eccInstanceCount
, eccZoneAwarenessEnabled
, eccInstanceType
, ElasticsearchClusterConfigStatus
, elasticsearchClusterConfigStatus
, eccsOptions
, eccsStatus
, ElasticsearchDomainConfig
, elasticsearchDomainConfig
, edcEBSOptions
, edcAccessPolicies
, edcElasticsearchClusterConfig
, edcSnapshotOptions
, edcAdvancedOptions
, edcElasticsearchVersion
, ElasticsearchDomainStatus
, elasticsearchDomainStatus
, edsEBSOptions
, edsAccessPolicies
, edsCreated
, edsSnapshotOptions
, edsDeleted
, edsProcessing
, edsEndpoint
, edsAdvancedOptions
, edsElasticsearchVersion
, edsDomainId
, edsDomainName
, edsARN
, edsElasticsearchClusterConfig
, ElasticsearchVersionStatus
, elasticsearchVersionStatus
, evsOptions
, evsStatus
, OptionStatus
, optionStatus
, osPendingDeletion
, osUpdateVersion
, osCreationDate
, osUpdateDate
, osState
, SnapshotOptions
, snapshotOptions
, soAutomatedSnapshotStartHour
, SnapshotOptionsStatus
, snapshotOptionsStatus
, sosOptions
, sosStatus
, Tag
, tag
, tagKey
, tagValue
) where
import Network.AWS.ElasticSearch.Types.Product
import Network.AWS.ElasticSearch.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
elasticSearch :: Service
elasticSearch =
Service
{ _svcAbbrev = "ElasticSearch"
, _svcSigner = v4
, _svcPrefix = "es"
, _svcVersion = "2015-01-01"
, _svcEndpoint = defaultEndpoint elasticSearch
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "ElasticSearch"
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| 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 (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 =
_ServiceError . hasStatus 400 . hasCode "ValidationException"
_ResourceAlreadyExistsException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceAlreadyExistsException =
_ServiceError . hasStatus 409 . hasCode "ResourceAlreadyExistsException"
_BaseException :: AsError a => Getting (First ServiceError) a ServiceError
_BaseException = _ServiceError . hasCode "BaseException"
_DisabledOperationException :: AsError a => Getting (First ServiceError) a ServiceError
_DisabledOperationException =
_ServiceError . hasStatus 409 . hasCode "DisabledOperationException"
_InternalException :: AsError a => Getting (First ServiceError) a ServiceError
_InternalException =
_ServiceError . hasStatus 500 . hasCode "InternalException"
_InvalidTypeException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidTypeException =
_ServiceError . hasStatus 409 . hasCode "InvalidTypeException"
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
_ServiceError . hasStatus 409 . hasCode "ResourceNotFoundException"
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
_LimitExceededException =
_ServiceError . hasStatus 409 . hasCode "LimitExceededException"