Class: Mccloud::Command::IpCommand

Inherits:
GroupBase
  • Object
show all
Defined in:
lib/mccloud/command/ip.rb

Instance Attribute Summary

Attributes inherited from GroupBase

#env

Instance Method Summary collapse

Methods inherited from GroupBase

#initialize, register

Methods included from Helpers

#initialize_environment

Constructor Details

This class inherits a constructor from Mccloud::Command::GroupBase

Instance Method Details

#associate(selection = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/mccloud/command/ip.rb', line 7

def associate(selection=nil)
  env.load!

  env.config.providers.each do |name,provider|
    env.logger.debug("Asking provider #{name} to associate to #{selection}")
    provider.on_selected_components("ip",selection) do |id,ip|
      ip.associate(options)
    end
  end
end

#list(selection = nil) ⇒ Object

method_options :test => :boolean



20
21
22
23
24
25
26
27
# File 'lib/mccloud/command/ip.rb', line 20

def list(selection=nil)
  env.load!

    env.config.providers.each do |name,provider|
      env.logger.debug("Asking provider #{name} to list ip #{selection}")
      provider.ip_list(selection,options)
    end
end