{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.SageMaker.Waiters where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.SageMaker.DescribeEndpoint
import Network.AWS.SageMaker.DescribeEndpoint
import Network.AWS.SageMaker.DescribeNotebookInstance
import Network.AWS.SageMaker.DescribeNotebookInstance
import Network.AWS.SageMaker.DescribeNotebookInstance
import Network.AWS.SageMaker.DescribeTrainingJob
import Network.AWS.SageMaker.Types
import Network.AWS.Waiter
notebookInstanceDeleted :: Wait DescribeNotebookInstance
notebookInstanceDeleted =
Wait
{ _waitName = "NotebookInstanceDeleted"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchError "ValidationException" AcceptSuccess
, matchAll
"Failed"
AcceptFailure
(dnirsNotebookInstanceStatus . to toTextCI)
]
}
endpointDeleted :: Wait DescribeEndpoint
endpointDeleted =
Wait
{ _waitName = "EndpointDeleted"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchError "ValidationException" AcceptSuccess
, matchAll "Failed" AcceptFailure (dersEndpointStatus . to toTextCI)
]
}
endpointInService :: Wait DescribeEndpoint
endpointInService =
Wait
{ _waitName = "EndpointInService"
, _waitAttempts = 120
, _waitDelay = 30
, _waitAcceptors =
[ matchAll "InService" AcceptSuccess (dersEndpointStatus . to toTextCI)
, matchAll "Failed" AcceptFailure (dersEndpointStatus . to toTextCI)
, matchError "ValidationException" AcceptFailure
]
}
notebookInstanceInService :: Wait DescribeNotebookInstance
notebookInstanceInService =
Wait
{ _waitName = "NotebookInstanceInService"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchAll
"InService"
AcceptSuccess
(dnirsNotebookInstanceStatus . to toTextCI)
, matchAll
"Failed"
AcceptFailure
(dnirsNotebookInstanceStatus . to toTextCI)
]
}
trainingJobCompletedOrStopped :: Wait DescribeTrainingJob
trainingJobCompletedOrStopped =
Wait
{ _waitName = "TrainingJobCompletedOrStopped"
, _waitAttempts = 180
, _waitDelay = 120
, _waitAcceptors =
[ matchAll
"Completed"
AcceptSuccess
(dtjrsTrainingJobStatus . to toTextCI)
, matchAll
"Stopped"
AcceptSuccess
(dtjrsTrainingJobStatus . to toTextCI)
, matchAll "Failed" AcceptFailure (dtjrsTrainingJobStatus . to toTextCI)
, matchError "ValidationException" AcceptFailure
]
}
notebookInstanceStopped :: Wait DescribeNotebookInstance
notebookInstanceStopped =
Wait
{ _waitName = "NotebookInstanceStopped"
, _waitAttempts = 60
, _waitDelay = 30
, _waitAcceptors =
[ matchAll
"Stopped"
AcceptSuccess
(dnirsNotebookInstanceStatus . to toTextCI)
, matchAll
"Failed"
AcceptFailure
(dnirsNotebookInstanceStatus . to toTextCI)
]
}