{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.EMR.Waiters where
import Network.AWS.EMR.DescribeCluster
import Network.AWS.EMR.DescribeCluster
import Network.AWS.EMR.DescribeStep
import Network.AWS.EMR.Types
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Waiter
stepComplete :: Wait DescribeStep
stepComplete =
Wait
{ _waitName = "StepComplete"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchAll
"COMPLETED"
AcceptSuccess
(dsrsStep . _Just . sStatus . _Just . ssState . _Just . to toTextCI)
, matchAll
"FAILED"
AcceptFailure
(dsrsStep . _Just . sStatus . _Just . ssState . _Just . to toTextCI)
, matchAll
"CANCELLED"
AcceptFailure
(dsrsStep . _Just . sStatus . _Just . ssState . _Just . to toTextCI)
]
}
clusterTerminated :: Wait DescribeCluster
clusterTerminated =
Wait
{ _waitName = "ClusterTerminated"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchAll
"TERMINATED"
AcceptSuccess
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
, matchAll
"TERMINATED_WITH_ERRORS"
AcceptFailure
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
]
}
clusterRunning :: Wait DescribeCluster
clusterRunning =
Wait
{ _waitName = "ClusterRunning"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchAll
"RUNNING"
AcceptSuccess
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
, matchAll
"WAITING"
AcceptSuccess
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
, matchAll
"TERMINATING"
AcceptFailure
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
, matchAll
"TERMINATED"
AcceptFailure
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
, matchAll
"TERMINATED_WITH_ERRORS"
AcceptFailure
(dcrsCluster . cluStatus . csState . _Just . to toTextCI)
]
}