Class: Knifecosmic::CosmicConfigList

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

Instance Method Summary collapse

Methods included from Chef::Knife::KnifecosmicBaseList

included, #list_object, #list_object_fields, #output_format

Instance Method Details

#runObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/chef/knife/cosmic_config_list.rb', line 37

def run
  validate_base_options

  columns = [
    'Category :category',
    'Name     :name',
    'Value    :value'
  ]

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