Class: VagrantPlugins::Openstack::Command::FlavorList
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- VagrantPlugins::Openstack::Command::FlavorList
- Includes:
- Utils
- Defined in:
- lib/vagrant-openstack-provider/command/flavor_list.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Utils
#display_item_list, #display_table
Methods inherited from AbstractCommand
#execute, #initialize, #normalize_args
Constructor Details
This class inherits a constructor from VagrantPlugins::Openstack::Command::AbstractCommand
Class Method Details
.synopsis ⇒ Object
10 11 12 |
# File 'lib/vagrant-openstack-provider/command/flavor_list.rb', line 10 def self.synopsis I18n.t('vagrant_openstack.command.flavor_list_synopsis') end |
Instance Method Details
#cmd(name, argv, env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-openstack-provider/command/flavor_list.rb', line 13 def cmd(name, argv, env) fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 flavors = env[:openstack_client].nova.get_all_flavors(env) rows = [] flavors.each do |f| rows << [f.id, f.name, f.vcpus, f.ram, f.disk] end display_table(env, ['Id', 'Name', 'vCPU', 'RAM (Mo)', 'Disk size (Go)'], rows) end |