lib/cloudstack-cli/commands/network.rb in cloudstack-cli-0.5.4 vs lib/cloudstack-cli/commands/network.rb in cloudstack-cli-0.5.5
- old
+ new
@@ -1,14 +1,13 @@
class Network < CloudstackCli::Base
desc "list", "list networks"
- option :project
- option :account
- option :zone
+ option :project, desc: 'the project name of the network'
+ option :account, desc: 'the owner of the network'
+ option :zone, desc: 'typehe name of the zone the network belongs to'
option :type, desc: 'the type of the network'
- option :showid, type: :boolean
- option :isdefault, type: :boolean
+ option :showid, type: :boolean, desc: 'show the network id'
def list
project = find_project if options[:project]
if options[:zone]
unless zone = client.get_zone(options[:zone])
say "Zone '#{options[:zone]}' not found.", :red
@@ -21,11 +20,11 @@
if project
networks = client.list_networks(project_id: project['id'], zone_id: zone_id)
elsif options[:account]
networks = client.list_networks(account: options[:account], zone_id: zone_id)
else
- networks = client.list_networks(isdefault: options[:isdefault], zone_id: zone_id)
- networks += client.list_networks(project_id: -1, isdefault: options[:isdefault], zone_id: zone_id)
+ networks = client.list_networks(zone_id: zone_id)
+ networks += client.list_networks(project_id: -1, zone_id: zone_id)
end
if options[:type]
networks = filter_by(networks, 'type', options[:type])
end
\ No newline at end of file