Sha256: 0b9357874a2893d4c5b11366fd7b768c21513f383d9075fdacf20018f8cb68d7

Contents?: true

Size: 659 Bytes

Versions: 27

Compression:

Stored size: 659 Bytes

Contents

class PhysicalNetwork < CloudstackCli::Base

  desc "list", "list physical networks"
  option :project
  def list
    resolve_project
    networks = client.list_physical_networks(options)
    zones = client.list_zones
    if networks.size < 1
      puts "No networks found"
    else
      table = [['Name', 'State', 'Zone', 'ID']]
      networks.each do |network|
        table << [
          network["name"],
          network["state"],
          zones.select{|zone| zone['id'] == network["zoneid"]}.first["name"],
          network["id"]
        ]
      end
      print_table table
      say "Total number of networks: #{networks.count}"
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cloudstack-cli-1.4.1 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.4.0 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.3.3 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.3.2 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.3.1 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.3.0 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.7 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.6 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.5 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.4 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.3 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.1 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.2.0 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.1.0 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.0.8 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.0.7 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.0.6 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.0.5 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.0.4 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-1.0.3 lib/cloudstack-cli/commands/physical_network.rb