cloudstack-cli 0.13.0 → 0.13.1
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 +4 -4
- data/cloudstack-cli.gemspec +1 -1
- data/lib/cloudstack-cli/base.rb +6 -6
- data/lib/cloudstack-cli/commands/resource_limit.rb +1 -0
- data/lib/cloudstack-cli/commands/server.rb +3 -0
- data/lib/cloudstack-cli/commands/volume.rb +19 -1
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cae23abc9a8273ab51dabe0a7547b53c571fd45
|
4
|
+
data.tar.gz: b6fb172ab5e198a54dd94bfd9e20ef341e71a4a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1903a80864f56b3b7abfecd72752a43a1c50d27bd360af0b4df1292c6f7150d28cf38822cff14534a27b83c8a02f6b1dc781d9822670903ef4b9dcc70185386f
|
7
|
+
data.tar.gz: 86d74efc92137546e33906aa635abdcb5e3ff33c48d84f1fcd85563ffcbba438ac1fc0845f45eb9d3978423c0a3621306022a377add695129da15807651c06b3
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git@github.com:niwo/cloudstack_client.git
|
3
|
-
revision:
|
3
|
+
revision: b6fdbc1a50a06f3596b1e07c0e7973cb34bbf203
|
4
4
|
branch: master
|
5
5
|
specs:
|
6
|
-
cloudstack_client (0.9.
|
6
|
+
cloudstack_client (0.9.2)
|
7
7
|
|
8
8
|
PATH
|
9
9
|
remote: .
|
10
10
|
specs:
|
11
|
-
cloudstack-cli (0.13.
|
12
|
-
cloudstack_client (~> 0.9.
|
11
|
+
cloudstack-cli (0.13.1)
|
12
|
+
cloudstack_client (~> 0.9.2)
|
13
13
|
thor (~> 0.19.1)
|
14
14
|
|
15
15
|
GEM
|
data/cloudstack-cli.gemspec
CHANGED
data/lib/cloudstack-cli/base.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require "thor"
|
2
2
|
require "yaml"
|
3
3
|
|
4
|
-
module CloudstackCli
|
4
|
+
module CloudstackCli
|
5
5
|
class Base < Thor
|
6
6
|
include Thor::Actions
|
7
7
|
include CloudstackCli::Helper
|
8
|
-
|
8
|
+
|
9
9
|
attr_reader :config
|
10
10
|
|
11
11
|
# catch control-c and exit
|
@@ -19,7 +19,7 @@ module CloudstackCli
|
|
19
19
|
true
|
20
20
|
end
|
21
21
|
|
22
|
-
no_commands do
|
22
|
+
no_commands do
|
23
23
|
def client(opts = {})
|
24
24
|
@config ||= load_configuration
|
25
25
|
@client ||= CloudstackClient::Connection.new(
|
@@ -43,7 +43,7 @@ module CloudstackCli
|
|
43
43
|
say "Can't load configuration from file #{config_file}.", :red
|
44
44
|
exit 1
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
env ||= config[:default]
|
48
48
|
if env
|
49
49
|
unless config = config[env]
|
@@ -63,7 +63,7 @@ module CloudstackCli
|
|
63
63
|
def find_project(name = options[:project], allow_all = true)
|
64
64
|
return nil unless name
|
65
65
|
if allow_all && %w(ALL -1).include?(name)
|
66
|
-
return {'id' => '-1'}
|
66
|
+
return {'id' => '-1'}
|
67
67
|
end
|
68
68
|
unless project = client.get_project(name)
|
69
69
|
say "Project '#{name}' not found", :red
|
@@ -77,4 +77,4 @@ module CloudstackCli
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
80
|
-
end
|
80
|
+
end
|
@@ -7,6 +7,7 @@ class Server < CloudstackCli::Base
|
|
7
7
|
option :command, desc: "command to execute for each server: START, STOP or RESTART"
|
8
8
|
option :state
|
9
9
|
option :listall
|
10
|
+
option :storage_id
|
10
11
|
option :keyword, desc: "filter by keyword"
|
11
12
|
def list
|
12
13
|
if options[:project]
|
@@ -14,6 +15,8 @@ class Server < CloudstackCli::Base
|
|
14
15
|
options[:project_id] = project_id
|
15
16
|
options[:project] = nil
|
16
17
|
end
|
18
|
+
options[:custom] = { 'storageid' => options[:storage_id] } if options[:storage_id]
|
19
|
+
client.verbose = true
|
17
20
|
servers = client.list_servers(options)
|
18
21
|
if servers.size < 1
|
19
22
|
puts "No servers found."
|
@@ -28,4 +28,22 @@ class Volume < CloudstackCli::Base
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
desc "show NAME", "show volume details"
|
32
|
+
option :project, desc: 'project of volume'
|
33
|
+
def show(name)
|
34
|
+
options[:name] = name
|
35
|
+
options[:project_id] = find_project['id'] if options[:project]
|
36
|
+
volumes = client.list_volumes(options)
|
37
|
+
if volumes.size < 1
|
38
|
+
say "No volume with name \"#{name}\" found."
|
39
|
+
else
|
40
|
+
volume = volumes.first
|
41
|
+
table = volume.map do |key, value|
|
42
|
+
[ set_color("#{key}:", :yellow), "#{value}" ]
|
43
|
+
end
|
44
|
+
print_table table
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
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.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.9.
|
61
|
+
version: 0.9.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.9.
|
68
|
+
version: 0.9.2
|
69
69
|
description: cloudstack-cli is a CloudStack API command line client written in Ruby.
|
70
70
|
email:
|
71
71
|
- nik.wolfgramm@gmail.com
|