Sha256: fdf5fc5e824f7d460b02daa9119f5ed407c4a1ba1c781992207d8ee0d6c6ac42
Contents?: true
Size: 740 Bytes
Versions: 25
Compression:
Stored size: 740 Bytes
Contents
class Pod < CloudstackCli::Base desc 'list', 'list pods' option :zone option :format, default: "table", enum: %w(table json yaml) def list resolve_zone pods = client.list_pods(options) if pods.size < 1 say "No pods found." else case options[:format].to_sym when :yaml puts({pods: pods}.to_yaml) when :json puts JSON.pretty_generate(pods: pods) else table = [["Name", "Start-IP", "End-IP", "Zone"]] pods.each do |pod| table << [ pod['name'], pod['startip'], pod['endip'], pod['zonename'] ] end print_table table say "Total number of pods: #{pods.count}" end end end end
Version data entries
25 entries across 25 versions & 1 rubygems