Sha256: 4ca05e64a5417cbfb1a25375edf49bddf5dd0ef9d31a5caeb984dd7bc2e9ea33

Contents?: true

Size: 622 Bytes

Versions: 25

Compression:

Stored size: 622 Bytes

Contents

class PhysicalNetwork < CloudstackCli::Base

  desc "list", "list physical networks"
  option :project
  def list
    project = find_project if options[:project]
    networks = client.list_physical_networks
    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
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
cloudstack-cli-0.5.8 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.5.5 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.5.4 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.5.3 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.5.2 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.5.1 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.5.0 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.10 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.9 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.8 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.7 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.6 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.5 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.4 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.3 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.2 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.3.1 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.2.2 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.2.1 lib/cloudstack-cli/commands/physical_network.rb
cloudstack-cli-0.2.0 lib/cloudstack-cli/commands/physical_network.rb