Class: VagrantPlugins::Openstack::Command::VolumeList
- Inherits:
-
OpenstackCommand
- Object
- AbstractCommand
- OpenstackCommand
- VagrantPlugins::Openstack::Command::VolumeList
- Defined in:
- lib/vagrant-openstack-provider/command/volume_list.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from OpenstackCommand
Methods included from Utils
#display_item_list, #display_table
Methods inherited from AbstractCommand
#before_cmd, #execute, #initialize, #normalize_args
Constructor Details
This class inherits a constructor from VagrantPlugins::Openstack::Command::AbstractCommand
Class Method Details
.synopsis ⇒ Object
7 8 9 |
# File 'lib/vagrant-openstack-provider/command/volume_list.rb', line 7 def self.synopsis I18n.t('vagrant_openstack.command.volume_list_synopsis') end |
Instance Method Details
#cmd(name, argv, env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/vagrant-openstack-provider/command/volume_list.rb', line 11 def cmd(name, argv, env) fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 volumes = env[:openstack_client].cinder.get_all_volumes(env) rows = [] volumes.each do |v| = "#{v.instance_id} (#{v.device})" unless v.instance_id.nil? rows << [v.id, v.name, v.size, v.status, ] end display_table(env, ['ID', 'Name', 'Size (Go)', 'Status', 'Attachment (instance ID and device)'], rows) end |