Class: HammerCLIForeman::ComputeResource::InfoCommand

Inherits:
InfoCommand
  • Object
show all
Defined in:
lib/hammer_cli_foreman/compute_resource.rb

Constant Summary collapse

PROVIDER_SPECIFIC_FIELDS =
{
  'ovirt' => [
    Fields::DataField.new(:label => 'UUID', :path => ["compute_resource", "uuid"])
  ],
  'ec2' => [
    Fields::DataField.new(:label => 'Region', :path => ["compute_resource", "region"])
  ],
  'vmware' => [
    Fields::DataField.new(:label => 'UUID', :path => ["compute_resource", "uuid"]),
    Fields::DataField.new(:label => 'Server', :path => ["compute_resource", "server"])
  ],
  'openstack' => [
    Fields::DataField.new(:label => 'Tenant', :path => ["compute_resource", "tenant"])
  ],
  'rackspace' => [
    Fields::DataField.new(:label => 'Region', :path => ["compute_resource", "region"])
  ],
  'libvirt' => [
  ]
}

Instance Method Summary collapse

Methods inherited from InfoCommand

command_name, #extend_data, #request_params, #retrieve_data

Instance Method Details



51
52
53
54
55
# File 'lib/hammer_cli_foreman/compute_resource.rb', line 51

def print_data(data)
  provider = data["provider"].downcase
  output_definition.fields.concat PROVIDER_SPECIFIC_FIELDS[provider]
  print_collection(output_definition, data)
end