Sha256: 04462ce42b429e7e6562b2ece0f09709080e0258927810cf3a2b9f01e05872f7

Contents?: true

Size: 669 Bytes

Versions: 25

Compression:

Stored size: 669 Bytes

Contents

class Zone < CloudstackCli::Base

  desc "list", "list zones"
  option :format, default: "table",
    enum: %w(table json yaml)
  def list
    zones = client.list_zones
    if zones.size < 1
      puts "No projects found"
    else
      case options[:format].to_sym
      when :yaml
        puts({zones: zones}.to_yaml)
      when :json
        puts JSON.pretty_generate(zones: zones)
      else
        table = [%w(Name Network-Type Description)]
        zones.each do |zone|
          table << [
            zone['name'],
            zone['networktype'],
            zone['description']
          ]
        end
        print_table(table)
      end
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
cloudstack-cli-1.6.10 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.9 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.8 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.7 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.6 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.5 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.4 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.3 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.2 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.1 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.6.0 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.13 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.12 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.10 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.9 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.8 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.7 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.6 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.5 lib/cloudstack-cli/commands/zone.rb
cloudstack-cli-1.5.4 lib/cloudstack-cli/commands/zone.rb