Class: Knifecosmic::CosmicOstypeList

Inherits:
Chef::Knife show all
Includes:
Chef::Knife::KnifecosmicBaseList
Defined in:
lib/chef/knife/cosmic_ostype_list.rb

Instance Method Summary collapse

Methods included from Chef::Knife::KnifecosmicBaseList

included, #list_object, #list_object_fields, #output_format

Instance Method Details

#runObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/chef/knife/cosmic_ostype_list.rb', line 33

def run
  validate_base_options

  columns = [
    'Description     :description',
    'ID              :id',
    'OS Categorie ID :oscategoryid'
  ]

  params = { 'command' => "listOsTypes" }
  params['filter']  = locate_config_value(:filter)  if locate_config_value(:filter)
  params['listall'] = locate_config_value(:listall) if locate_config_value(:listall)
  params['keyword'] = locate_config_value(:keyword) if locate_config_value(:keyword)
  
  result = connection.list_object(params, "ostype")
  list_object(columns, result)
end