Class: Awful::Changesets
Constant Summary collapse
- COLORS =
{ create_in_progress: :yellow, delete_in_progress: :yellow, update_in_progress: :yellow, update_complete_cleanup_in_progress: :yellow, create_failed: :red, delete_failed: :red, update_failed: :red, create_complete: :green, delete_complete: :green, update_complete: :green, delete_skipped: :yellow, rollback_in_progress: :red, rollback_complete: :red, add: :green, modify: :yellow, remove: :red, }
Instance Method Summary collapse
- #changes(stack_name, change_set_name) ⇒ Object
-
#list(stack_name, change_set_name = nil) ⇒ Object
if no task given , run this.
- #ls(stack_name) ⇒ Object
Instance Method Details
#changes(stack_name, change_set_name) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/awful/changesets.rb', line 67 def changes(stack_name, change_set_name) cf.describe_change_set(stack_name: stack_name, change_set_name: change_set_name).tap do |set| print_table set.changes.map { |change| rc = change.resource_change [ color(rc.action), rc.logical_resource_id, rc.physical_resource_id, rc.resource_type, rc.replacement ] } end end |
#list(stack_name, change_set_name = nil) ⇒ Object
if no task given , run this
37 |
# File 'lib/awful/changesets.rb', line 37 default_task :list |
#ls(stack_name) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/awful/changesets.rb', line 50 def ls(stack_name) cf.list_change_sets(stack_name: stack_name).summaries.tap do |list| if [:long] print_table list.map { |cs| [ cs.change_set_name, color(cs.status), cs.creation_time ] } else puts list.map(&:change_set_name) end end end |