Sha256: 19e5ab2a7428bdaa979908eb63c6e4a8960c96ede86e70fc3ffacb3a1ee04baf

Contents?: true

Size: 861 Bytes

Versions: 8

Compression:

Stored size: 861 Bytes

Contents

require 'vagrant-deltacloud-provider/command/utils'
require 'vagrant-deltacloud-provider/command/abstract_command'

module VagrantPlugins
  module Deltacloud
    module Command
      class HardwareProfileList < AbstractCommand
        include VagrantPlugins::Deltacloud::Command::Utils

        def self.synopsis
          I18n.t('vagrant_deltacloud.command.hardware_profile_list_synopsis')
        end
        def cmd(name, argv, env)
          fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0
          hardware_profiles = env[:deltacloud_client].list_hardware_profiles(env)

          rows = []
          hardware_profiles.each do |h|
            rows << [h.id, h.name, h.vcpus, h.ram, h.disk]
          end
          display_table(env, ['Id', 'Name', 'vCPU', 'RAM (Mo)', 'Disk size (Go)'], rows)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-deltacloud-provider-0.0.9 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.8 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.7 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.6 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.5 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.4 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.3 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb
vagrant-deltacloud-provider-0.0.2 lib/vagrant-deltacloud-provider/command/hardware_profile_list.rb