Class: RightScaleCLI::Networks

Inherits:
Thor
  • Object
show all
Defined in:
lib/rightscale_cli/network/networks.rb

Overview

Represents Network Manager Networks

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Networks

Returns a new instance of Networks.



26
27
28
29
30
# File 'lib/rightscale_cli/network/networks.rb', line 26

def initialize(*args)
  super
  @client = RightScaleCLI::Client.new(options)
  @logger = RightScaleCLI::Logger.new
end

Class Method Details



57
58
59
# File 'lib/rightscale_cli/network/networks.rb', line 57

def self.banner(task, _namespace = true, subcommand = false)
  "#{basename} #{task.formatted_usage(self, true, subcommand)}"
end

Instance Method Details

#listObject



46
47
48
49
50
51
52
53
54
55
# File 'lib/rightscale_cli/network/networks.rb', line 46

def list
  filter = []
  @logger.debug "filter: #{filter}" if options[:debug]

  networks = []
  @client.client.networks.index(filter: filter).each do |network|
    networks.push(network)
  end
  @client.render(networks, 'networks')
end