{-# LANGUAGE OverloadedStrings #-}
module Network.AWS.Batch.Types
(
batch
, _ServerException
, _ClientException
, ArrayJobDependency (..)
, CEState (..)
, CEStatus (..)
, CEType (..)
, CRType (..)
, JQState (..)
, JQStatus (..)
, JobDefinitionType (..)
, JobStatus (..)
, ArrayProperties
, arrayProperties
, apSize
, ArrayPropertiesDetail
, arrayPropertiesDetail
, apdSize
, apdStatusSummary
, apdIndex
, ArrayPropertiesSummary
, arrayPropertiesSummary
, apsSize
, apsIndex
, AttemptContainerDetail
, attemptContainerDetail
, acdTaskARN
, acdContainerInstanceARN
, acdReason
, acdLogStreamName
, acdExitCode
, AttemptDetail
, attemptDetail
, adStoppedAt
, adStartedAt
, adContainer
, adStatusReason
, ComputeEnvironmentDetail
, computeEnvironmentDetail
, cedStatus
, cedState
, cedComputeResources
, cedStatusReason
, cedType
, cedServiceRole
, cedComputeEnvironmentName
, cedComputeEnvironmentARN
, cedEcsClusterARN
, ComputeEnvironmentOrder
, computeEnvironmentOrder
, ceoOrder
, ceoComputeEnvironment
, ComputeResource
, computeResource
, crEc2KeyPair
, crBidPercentage
, crSpotIAMFleetRole
, crImageId
, crDesiredvCPUs
, crTags
, crType
, crMinvCPUs
, crMaxvCPUs
, crInstanceTypes
, crSubnets
, crSecurityGroupIds
, crInstanceRole
, ComputeResourceUpdate
, computeResourceUpdate
, cruMinvCPUs
, cruMaxvCPUs
, cruDesiredvCPUs
, ContainerDetail
, containerDetail
, cdImage
, cdCommand
, cdEnvironment
, cdTaskARN
, cdUlimits
, cdContainerInstanceARN
, cdPrivileged
, cdJobRoleARN
, cdMemory
, cdUser
, cdReason
, cdLogStreamName
, cdMountPoints
, cdExitCode
, cdVcpus
, cdReadonlyRootFilesystem
, cdVolumes
, ContainerOverrides
, containerOverrides
, coCommand
, coEnvironment
, coMemory
, coVcpus
, ContainerProperties
, containerProperties
, cpCommand
, cpEnvironment
, cpUlimits
, cpPrivileged
, cpJobRoleARN
, cpUser
, cpMountPoints
, cpReadonlyRootFilesystem
, cpVolumes
, cpImage
, cpVcpus
, cpMemory
, ContainerSummary
, containerSummary
, csReason
, csExitCode
, Host
, host
, hSourcePath
, JobDefinition
, jobDefinition
, jddStatus
, jddRetryStrategy
, jddParameters
, jddTimeout
, jddContainerProperties
, jddJobDefinitionName
, jddJobDefinitionARN
, jddRevision
, jddType
, JobDependency
, jobDependency
, jJobId
, jType
, JobDetail
, jobDetail
, jdStoppedAt
, jdCreatedAt
, jdRetryStrategy
, jdAttempts
, jdDependsOn
, jdContainer
, jdParameters
, jdStatusReason
, jdArrayProperties
, jdTimeout
, jdJobName
, jdJobId
, jdJobQueue
, jdStatus
, jdStartedAt
, jdJobDefinition
, JobQueueDetail
, jobQueueDetail
, jqdStatus
, jqdStatusReason
, jqdJobQueueName
, jqdJobQueueARN
, jqdState
, jqdPriority
, jqdComputeEnvironmentOrder
, JobSummary
, jobSummary
, jsStoppedAt
, jsStatus
, jsCreatedAt
, jsStartedAt
, jsContainer
, jsStatusReason
, jsArrayProperties
, jsJobId
, jsJobName
, JobTimeout
, jobTimeout
, jtAttemptDurationSeconds
, KeyValuePair
, keyValuePair
, kvpValue
, kvpName
, MountPoint
, mountPoint
, mpContainerPath
, mpSourceVolume
, mpReadOnly
, RetryStrategy
, retryStrategy
, rsAttempts
, Ulimit
, ulimit
, uHardLimit
, uName
, uSoftLimit
, Volume
, volume
, vName
, vHost
) where
import Network.AWS.Batch.Types.Product
import Network.AWS.Batch.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Sign.V4
batch :: Service
batch =
Service
{ _svcAbbrev = "Batch"
, _svcSigner = v4
, _svcPrefix = "batch"
, _svcVersion = "2016-08-10"
, _svcEndpoint = defaultEndpoint batch
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError "Batch"
, _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
_ServerException :: AsError a => Getting (First ServiceError) a ServiceError
_ServerException = _MatchServiceError batch "ServerException" . hasStatus 500
_ClientException :: AsError a => Getting (First ServiceError) a ServiceError
_ClientException = _MatchServiceError batch "ClientException" . hasStatus 400