7 def list
8 resolve_zone
9 pods = client.list_pods(options)
10 if pods.size < 1
11 say "No pods found."
12 else
13 case options[:format].to_sym
14 when :yaml
15 puts({pods: pods}.to_yaml)
16 when :json
17 puts JSON.pretty_generate(pods: pods)
18 else
19 table = [["Name", "Start-IP", "End-IP", "Zone"]]
20 pods.each do |pod|
21 table << [
22 pod['name'], pod['startip'],
23 pod['endip'], pod['zonename']
24 ]
25 end
26 print_table table
27 say "Total number of pods: #{pods.count}"
28 end
29 end
30 end