Class: Opsicle::MoveEip
- Inherits:
-
Object
- Object
- Opsicle::MoveEip
- Defined in:
- lib/opsicle/commands/move_eip.rb
Instance Method Summary collapse
- #execute(options = {}) ⇒ Object
-
#initialize(environment) ⇒ MoveEip
constructor
A new instance of MoveEip.
Constructor Details
#initialize(environment) ⇒ MoveEip
Returns a new instance of MoveEip.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/opsicle/commands/move_eip.rb', line 12 def initialize(environment) @client = Client.new(environment) @opsworks_adapter = OpsworksAdapter.new(@client) stack_id = @client.config.opsworks_config[:stack_id] @cli = HighLine.new @stack = ManageableStack.new(stack_id, @opsworks_adapter, @cli) @eip_inquiry = Questionnaire::EipInquiry.new( opsworks_adapter: @opsworks_adapter, highline_client: @cli ) end |
Instance Method Details
#execute(options = {}) ⇒ Object
25 26 27 28 29 |
# File 'lib/opsicle/commands/move_eip.rb', line 25 def execute(={}) puts "Stack ID = #{@stack.id}" moved_values = move_eip puts "\nEIP #{moved_values[:ip_address]} was moved to instance #{moved_values[:target_instance_id]}" end |