cloudstack-cli 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 940953edd369af42120f5e967b84248b36694803
4
- data.tar.gz: 9f0263eac9b1e29e04b339d3c688a0a4bf73e941
3
+ metadata.gz: 6f2298c84a2760737a6a3b3e7b3a8104f3fe383e
4
+ data.tar.gz: c3eba72da15dd9fbcf61a162dfd723330ceabdee
5
5
  SHA512:
6
- metadata.gz: 27e2084f232a5d904e43f70bb3c1954ba47558687058cdfa144358d968a261119354a263791392f6c5384520cc1d0d868291eccc28df27382885cd501ee2cba1
7
- data.tar.gz: 1be273488a81a146270b523174856c68977393e903607fbf0452b0d36893fcca9556b3397d0a29e9b3bd02459ef159deab07f0ad93a565cb05f62ae0d5f907b6
6
+ metadata.gz: 26f8de3dec1b5f9f937cc2dabc8d1b189e43439ccff01e47a504f4fac8b393f97814a49fe7acafa86d5a4b8d2643e7f703e6f97169a4df6ef4453b4d92818765
7
+ data.tar.gz: 7cc8fa873dc54a6962b9a63b9bb05d36af7c05b69ad349189a24ae29ee369a70ec75ec5309bcdb84c1869ba1a97dab4fd8ce55584d15f5511b8960feab9f8acf
data/Gemfile.lock CHANGED
@@ -8,8 +8,8 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- cloudstack-cli (0.7.1)
12
- cloudstack_client (~> 0.4, >= 0.4.1)
11
+ cloudstack-cli (0.7.3)
12
+ cloudstack_client (~> 0.4, >= 0.4.4)
13
13
  thor (~> 0.18)
14
14
 
15
15
  GEM
@@ -24,8 +24,9 @@ module CloudstackCli
24
24
  map %w(-v --version) => :version
25
25
 
26
26
  desc "setup", "initial configuration of Cloudstack connection settings"
27
- def setup
28
- invoke "environment:add", :environment => options[:environment]
27
+ def setup(env = options[:environment])
28
+ invoke "environment:add", [env],
29
+ :config_file => options[:config_file]
29
30
  end
30
31
 
31
32
  desc "command COMMAND [arg1=val1 arg2=val2...]", "run a custom api command"
@@ -77,7 +77,7 @@ class Stack < CloudstackCli::Base
77
77
  server["name"].gsub(', ', ',').split(',').each {|name| servers << name}
78
78
  end
79
79
 
80
- if options[:force] || yes?("Destroy the following servers #{servers.join(', ')}?", :yellow)
80
+ if options[:force] || yes?("Destroy the following servers #{servers.join(', ')}? [y/N]:", :yellow)
81
81
  jobs = []
82
82
  servers.each do |name|
83
83
  server = client(quiet: true).get_server(name, project_id: projectid)
@@ -3,23 +3,31 @@ class StoragePool < CloudstackCli::Base
3
3
  desc 'list', 'list storage_pool'
4
4
  option :zone, desc: "zone name for the storage pool"
5
5
  option :name, desc: "name of the storage pool"
6
- option :keyword, desc: "list by keyword"
6
+ option :keyword, desc: "list by keyword"
7
+ option :state, desc: "filter by state (Up, Maintenance)"
7
8
  def list
8
9
  storage_pools = client.list_storage_pools(options)
9
10
  if storage_pools.size < 1
10
11
  say "No storage pools found."
11
12
  else
12
- table = [%w(Name Pod_Name State Zone)]
13
+ storage_pools = filter_by(storage_pools, "state", options[:state]) if options[:state]
14
+ table = [%w(Name Pod State Zone)]
13
15
  table[0] << "Size [GB]"
14
16
  table[0] << "Used [GB]"
15
17
  table[0] << "Used [%]"
18
+ table[0] << "Alocated [GB]"
19
+ table[0] << "Alocated [%]"
20
+ table[0] << "Type"
16
21
  storage_pools.each do |storage_pool|
17
22
  total = storage_pool['disksizetotal'] / 1024**3
18
23
  used = (storage_pool['disksizeused'] / 1024**3) rescue 0
24
+ allocated = (storage_pool['disksizeallocated'] / 1024**3) rescue 0
19
25
  table << [
20
26
  storage_pool['name'], storage_pool['podname'],
21
27
  storage_pool['state'], storage_pool['zonename'],
22
- total, used, (100.0 / total * used).round(0)
28
+ total, used, (100.0 / total * used).round(0),
29
+ allocated, (100.0 / total * allocated).round(0),
30
+ storage_pool['type']
23
31
  ]
24
32
  end
25
33
  print_table table
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.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.7.3
4
+ version: 0.7.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-02-19 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc