cloudstack-cli 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51c08f0890333055353aa278e75285c2427bf19c
4
- data.tar.gz: 981ea8a195ebab835f91dc214b5aad289ab87a70
3
+ metadata.gz: b4fd382092e6b838e263390534e9ce894d76e74b
4
+ data.tar.gz: d97473fb465c269be305e4f6a24722503616dff9
5
5
  SHA512:
6
- metadata.gz: b139212a371f5d19dd0b9e9fc603f211f523dd8fbb054b72cbbdd8fa8e42d5c6eaf5529c7f6dcbc718a3921edd196f3def8b2f85c279b247a5024d2d685fdbcd
7
- data.tar.gz: d9649201da6880b84f7f84db55dc7954cc299088995c0d8113f3b37f185bb8a105a115928ae717c308795b4b2dae8d00098ea249f127fcc8c10189e742577eb3
6
+ metadata.gz: 9d192a430759b011154bc20d8f2a9290b810f30783b3d50e65569c68164ea66edaa1bf678d437a1b5e4d14418081bfa408ddad3016cdb96a5172ee89e8596eab
7
+ data.tar.gz: f27eaad931a0f977a63159b1cccf9f3074edcb526f6a3c6712914ec6ebd56de1d1740fedfa8829ec343fad065d556f650b8155902e5dc08bd64b2e1d5faad185
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudstack-cli (0.5.3)
4
+ cloudstack-cli (0.5.4)
5
5
  cloudstack_client (~> 0.3)
6
6
  thor (~> 0.18)
7
7
 
@@ -3,31 +3,45 @@ class Network < CloudstackCli::Base
3
3
  desc "list", "list networks"
4
4
  option :project
5
5
  option :account
6
+ option :zone
7
+ option :type, desc: 'the type of the network'
6
8
  option :showid, type: :boolean
7
9
  option :isdefault, type: :boolean
8
10
  def list
9
11
  project = find_project if options[:project]
12
+ if options[:zone]
13
+ unless zone = client.get_zone(options[:zone])
14
+ say "Zone '#{options[:zone]}' not found.", :red
15
+ exit 1
16
+ end
17
+ zone_id = zone['id']
18
+ end
19
+
10
20
  networks = []
11
21
  if project
12
- networks = client.list_networks(project_id: project['id'])
22
+ networks = client.list_networks(project_id: project['id'], zone_id: zone_id)
13
23
  elsif options[:account]
14
- networks = client.list_networks(account: options[:account])
24
+ networks = client.list_networks(account: options[:account], zone_id: zone_id)
15
25
  else
16
- networks = client.list_networks(isdefault: options[:isdefault])
17
- networks += client.list_networks(project_id: -1, isdefault: options[:isdefault])
26
+ networks = client.list_networks(isdefault: options[:isdefault], zone_id: zone_id)
27
+ networks += client.list_networks(project_id: -1, isdefault: options[:isdefault], zone_id: zone_id)
28
+ end
29
+
30
+ if options[:type]
31
+ networks = filter_by(networks, 'type', options[:type])
18
32
  end
19
33
 
20
34
  if networks.size < 1
21
35
  puts "No networks found."
22
36
  else
23
- table = [["Name", "Displaytext", "Account", "Project", "Domain", "State", "Type"]]
37
+ table = [["Name", "Displaytext", "Account/Project", "Zone", "Domain", "State", "Type"]]
24
38
  table[0] << "ID" if options[:showid]
25
39
  networks.each do |network|
26
40
  table << [
27
41
  network["name"],
28
42
  network["displaytext"],
29
- network["account"],
30
- network["project"],
43
+ network["account"] || network["project"],
44
+ network["zonename"],
31
45
  network["domain"],
32
46
  network["state"],
33
47
  network["type"]
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-12 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc