48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/chef/knife/cs_zone_list.rb', line 48
def run
connection = CloudstackClient::Connection.new(
locate_config_value(:cloudstack_url),
locate_config_value(:cloudstack_api_key),
locate_config_value(:cloudstack_secret_key)
)
zone_list = [
ui.color('Name', :bold),
ui.color('Network Type', :bold),
ui.color('Security Groups', :bold)
]
zones = connection.list_zones
zones.each do |z|
zone_list << z['name']
zone_list << z['networktype']
zone_list << z['securitygroupsenabled'].to_s
end
puts ui.list(zone_list, :columns_across, 3)
end
|