Class: VagrantPlugins::Deltacloud::Command::InstanceList
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- VagrantPlugins::Deltacloud::Command::InstanceList
- Includes:
- Utils
- Defined in:
- lib/vagrant-deltacloud-provider/command/instance_list.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Utils
#display_item_list, #display_table, #get_ip_address
Methods inherited from AbstractCommand
#execute, #initialize, #normalize_args
Constructor Details
This class inherits a constructor from VagrantPlugins::Deltacloud::Command::AbstractCommand
Class Method Details
.synopsis ⇒ Object
10 11 12 |
# File 'lib/vagrant-deltacloud-provider/command/instance_list.rb', line 10 def self.synopsis I18n.t('vagrant_deltacloud.command.instance_list_synopsis') end |
Instance Method Details
#cmd(name, argv, env) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/vagrant-deltacloud-provider/command/instance_list.rb', line 13 def cmd(name, argv, env) fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 rows = [] headers = %w(Id Name Status Key_name IP_address) images = env[:deltacloud_client].list_instances(env) images.each { |instance| rows << [instance.id, instance.name, instance.status, instance.key_name, instance.ip_address] } display_table(env, headers, rows) end |