Class: Chef::Knife::VcOrgShow
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::VcOrgShow
- Includes:
- VcCommon
- Defined in:
- lib/chef/knife/org/vc_org_show.rb
Instance Method Summary collapse
Methods included from VcCommon
#connection, #deprecation_msg, #generate_key, #get_password, included, #locate_config_value, #locate_org_option, #notice_msg, #out_msg, #pretty_symbol, #sort_by_key, #store_config, #store_password, #wait_task
Instance Method Details
#run ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/chef/knife/org/vc_org_show.rb', line 26 def run $stdout.sync = true org = locate_org_option connection.login header = [ ui.color('Name', :bold), ui.color('ID', :bold) ] organization = connection.get_organization_by_name org connection.logout list = ["#{ui.color('CATALOGS', :cyan)}", ''] list << header list.flatten! sort_by_key(organization[:catalogs]).each do |k, v| list << (k || '') list << (v || '') end list << ['', '', "#{ui.color('VDCs', :cyan)}", ''] list << header list.flatten! sort_by_key(organization[:vdcs]).each do |k, v| list << (k || '') list << (v || '') end list << ['', '', "#{ui.color('NETWORKS', :cyan)}", ''] list << header list.flatten! sort_by_key(organization[:networks]).each do |k, v| list << (k || '') list << (v || '') end list << ['', '', "#{ui.color('TASKLISTS', :cyan)}", ''] list << header list.flatten! sort_by_key(organization[:tasklists]).each do |k, v| list << (k || '<unnamed list>') list << (v || '') end ui.msg ui.list(list, :columns_across, 2) end |