Module: CfnCli::CfnStates
Instance Method Summary collapse
-
#failed? ⇒ Boolean
Indicates if the state is failed.
-
#failed_states ⇒ Object
List of failed or unknown states.
-
#finished? ⇒ Boolean
Indicates if the state is finished.
-
#finished_states ⇒ Object
List of finished states.
-
#in_progress? ⇒ Boolean
Indicates if the state is a transition.
-
#states ⇒ Object
List of possible states.
-
#succeeded? ⇒ Boolean
Indicates if the state is successful.
-
#success_states ⇒ Object
List of successful states.
-
#transitive_states ⇒ Object
List of transitive states.
Instance Method Details
#failed? ⇒ Boolean
Indicates if the state is failed
19 20 21 |
# File 'lib/cfncli/states.rb', line 19 def failed? !succeeded? && !in_progress? end |
#failed_states ⇒ Object
List of failed or unknown states
69 70 71 |
# File 'lib/cfncli/states.rb', line 69 def failed_states states - success_states - transitive_states end |
#finished? ⇒ Boolean
Indicates if the state is finished
4 5 6 |
# File 'lib/cfncli/states.rb', line 4 def finished? finished_states.include? status end |
#finished_states ⇒ Object
List of finished states
64 65 66 |
# File 'lib/cfncli/states.rb', line 64 def finished_states states - transitive_states end |
#in_progress? ⇒ Boolean
Indicates if the state is a transition
14 15 16 |
# File 'lib/cfncli/states.rb', line 14 def in_progress? transitive_states.include? status end |
#states ⇒ Object
List of possible states
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cfncli/states.rb', line 24 def states [ 'CREATE_IN_PROGRESS', 'CREATE_IN_PROGRESS', 'CREATE_FAILED', 'CREATE_COMPLETE', 'ROLLBACK_IN_PROGRESS', 'ROLLBACK_FAILED', 'ROLLBACK_COMPLETE', 'DELETE_IN_PROGRESS', 'DELETE_FAILED', 'DELETE_COMPLETE', 'UPDATE_IN_PROGRESS', 'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS', 'UPDATE_COMPLETE', 'UPDATE_ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_FAILED', 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS', 'UPDATE_ROLLBACK_COMPLETE', 'REVIEW_IN_PROGRESS' ] end |
#succeeded? ⇒ Boolean
Indicates if the state is successful
9 10 11 |
# File 'lib/cfncli/states.rb', line 9 def succeeded? success_states.include? status end |
#success_states ⇒ Object
List of successful states
48 49 50 51 52 53 54 |
# File 'lib/cfncli/states.rb', line 48 def success_states [ 'CREATE_COMPLETE', 'DELETE_COMPLETE', 'UPDATE_COMPLETE' ] end |
#transitive_states ⇒ Object
List of transitive states
57 58 59 60 61 |
# File 'lib/cfncli/states.rb', line 57 def transitive_states states.select do |state| state.end_with? 'IN_PROGRESS' end end |