Sha256: 62652bd10a8f4edd2887c341e24b25e210beea5af1ce702cebe48b454eb2c131

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

class Volume < Thor
  desc "list", "list networks"
  option :project
  def list
    cs_cli = CloudstackCli::Helper.new
    if options[:project]
      project = cs_cli.projects.select { |p| p['name'] == options[:project] }.first
      raise "Project '#{options[:project]}' not found" unless project
    end
    
    networks = cs_cli.networks(project ? project['id'] : nil)
    if networks.size < 1
      puts "No networks found"
    else
      networks.each do |network|
        puts "#{network['name']} - #{network['displaytext']} #{' - Default' if network['isdefault']}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cloudstack-cli-0.0.1 lib/cloudstack-cli/commands/volume.rb