amazonka-redshift 0.0.7 → 0.0.8
raw patch · 4 files changed
+104/−11 lines, 4 filesdep ~amazonka-corePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: amazonka-core
API changes (from Hackage documentation)
+ Network.AWS.Redshift.Waiters: clusterAvailable :: Wait DescribeClusters
+ Network.AWS.Redshift.Waiters: clusterDeleted :: Wait DescribeClusters
+ Network.AWS.Redshift.Waiters: snapshotAvailable :: Wait DescribeClusterSnapshots
Files
- amazonka-redshift.cabal +3/−2
- gen/Network/AWS/Redshift.hs +2/−0
- gen/Network/AWS/Redshift/Types.hs +35/−9
- gen/Network/AWS/Redshift/Waiters.hs +64/−0
amazonka-redshift.cabal view
@@ -1,5 +1,5 @@ name: amazonka-redshift-version: 0.0.7+version: 0.0.8 synopsis: Amazon Redshift SDK. homepage: https://github.com/brendanhay/amazonka license: OtherLicense@@ -95,9 +95,10 @@ , Network.AWS.Redshift.RevokeSnapshotAccess , Network.AWS.Redshift.RotateEncryptionKey , Network.AWS.Redshift.Types+ , Network.AWS.Redshift.Waiters other-modules: build-depends:- amazonka-core == 0.0.7.*+ amazonka-core == 0.0.8.* , base >= 4.7 && < 5
gen/Network/AWS/Redshift.hs view
@@ -74,6 +74,7 @@ , module Network.AWS.Redshift.RevokeSnapshotAccess , module Network.AWS.Redshift.RotateEncryptionKey , module Network.AWS.Redshift.Types+ , module Network.AWS.Redshift.Waiters ) where import Network.AWS.Redshift.AuthorizeClusterSecurityGroupIngress@@ -133,3 +134,4 @@ import Network.AWS.Redshift.RevokeSnapshotAccess import Network.AWS.Redshift.RotateEncryptionKey import Network.AWS.Redshift.Types+import Network.AWS.Redshift.Waiters
gen/Network/AWS/Redshift/Types.hs view
@@ -7,6 +7,7 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} @@ -384,7 +385,6 @@ , pSource ) where -import Network.AWS.Error import Network.AWS.Prelude import Network.AWS.Signing import qualified GHC.Exts@@ -396,18 +396,44 @@ type Sg Redshift = V4 type Er Redshift = RESTError - service = Service- { _svcAbbrev = "Redshift"- , _svcPrefix = "redshift"- , _svcVersion = "2012-12-01"- , _svcTargetPrefix = Nothing- , _svcJSONVersion = Nothing- }+ service = service'+ where+ service' :: Service Redshift+ service' = Service+ { _svcAbbrev = "Redshift"+ , _svcPrefix = "redshift"+ , _svcVersion = "2012-12-01"+ , _svcTargetPrefix = Nothing+ , _svcJSONVersion = Nothing+ , _svcHandle = handle+ , _svcRetry = retry+ } - handle = restError statusSuccess+ handle :: Status+ -> Maybe (LazyByteString -> ServiceError RESTError)+ handle = restError statusSuccess service' + retry :: Retry Redshift+ retry = Exponential+ { _retryBase = 0.05+ , _retryGrowth = 2+ , _retryAttempts = 5+ , _retryCheck = check+ }++ check :: Status+ -> RESTError+ -> Bool+ check (statusCode -> s) (awsErrorCode -> e)+ | s == 400 && "Throttling" == e = True -- Throttling+ | s == 500 = True -- General Server Error+ | s == 509 = True -- Limit Exceeded+ | s == 503 = True -- Service Unavailable+ | otherwise = False+ ns :: Text ns = "http://redshift.amazonaws.com/doc/2012-12-01/"+{-# INLINE ns #-} data Snapshot = Snapshot { _sAccountsWithRestoreAccess :: List "member" AccountWithRestoreAccess
+ gen/Network/AWS/Redshift/Waiters.hs view
@@ -0,0 +1,64 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeFamilies #-}++-- Module : Network.AWS.Redshift.Waiters+-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License : This Source Code Form is subject to the terms of+-- the Mozilla Public License, v. 2.0.+-- A copy of the MPL can be found in the LICENSE file or+-- you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++module Network.AWS.Redshift.Waiters where++import Network.AWS.Redshift.DescribeClusterSnapshots+import Network.AWS.Redshift.DescribeClusters+import Network.AWS.Redshift.Types+import Network.AWS.Waiters++clusterAvailable :: Wait DescribeClusters+clusterAvailable = Wait+ { _waitName = "ClusterAvailable"+ , _waitAttempts = 30+ , _waitDelay = 60+ , _waitAcceptors =+ [ matchAll "available" AcceptSuccess+ (folding (concatOf dcrClusters) . cClusterStatus . _Just)+ , matchAny "deleting" AcceptFailure+ (folding (concatOf dcrClusters) . cClusterStatus . _Just)+ , matchError "ClusterNotFound" AcceptRetry+ ]+ }++clusterDeleted :: Wait DescribeClusters+clusterDeleted = Wait+ { _waitName = "ClusterDeleted"+ , _waitAttempts = 30+ , _waitDelay = 60+ , _waitAcceptors =+ [ matchError "ClusterNotFound" AcceptSuccess+ , matchAny "creating" AcceptFailure+ (folding (concatOf dcrClusters) . cClusterStatus . _Just)+ , matchAny "rebooting" AcceptFailure+ (folding (concatOf dcrClusters) . cClusterStatus . _Just)+ ]+ }++snapshotAvailable :: Wait DescribeClusterSnapshots+snapshotAvailable = Wait+ { _waitName = "SnapshotAvailable"+ , _waitAttempts = 20+ , _waitDelay = 15+ , _waitAcceptors =+ [ matchAll "available" AcceptSuccess+ (folding (concatOf dcsrSnapshots) . sStatus . _Just)+ , matchAny "failed" AcceptFailure+ (folding (concatOf dcsrSnapshots) . sStatus . _Just)+ , matchAny "deleted" AcceptFailure+ (folding (concatOf dcsrSnapshots) . sStatus . _Just)+ ]+ }