cloudstack-cli 0.7.3 → 0.7.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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/cloudstack-cli/cli.rb +3 -2
- data/lib/cloudstack-cli/commands/stack.rb +1 -1
- data/lib/cloudstack-cli/commands/storage_pool.rb +11 -3
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f2298c84a2760737a6a3b3e7b3a8104f3fe383e
|
4
|
+
data.tar.gz: c3eba72da15dd9fbcf61a162dfd723330ceabdee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26f8de3dec1b5f9f937cc2dabc8d1b189e43439ccff01e47a504f4fac8b393f97814a49fe7acafa86d5a4b8d2643e7f703e6f97169a4df6ef4453b4d92818765
|
7
|
+
data.tar.gz: 7cc8fa873dc54a6962b9a63b9bb05d36af7c05b69ad349189a24ae29ee369a70ec75ec5309bcdb84c1869ba1a97dab4fd8ce55584d15f5511b8960feab9f8acf
|
data/Gemfile.lock
CHANGED
data/lib/cloudstack-cli/cli.rb
CHANGED
@@ -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",
|
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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|