cloudstack-cli 0.5.0 → 0.5.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 +2 -2
- data/cloudstack-cli.gemspec +1 -1
- data/lib/cloudstack-cli/commands/server.rb +21 -6
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce7f63bf939c5e8b796d69a2dbd188f3df889a5e
|
4
|
+
data.tar.gz: c0fe089fac7357eff4759194e97c6c22a77bf305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ddef3bcc73bc38a578105f2b93d94faa8a8f0052abf259f7492ffd2f78c9969abebe1c5a0c7bf5f7f1f70a00c28ad5a43a5f42bdd633b4e35f0c5292ada26a
|
7
|
+
data.tar.gz: e3a7b7e5928fd22a031c68088cec22c67cf793e1cf986c84e3147a3fc70dd46491990037cf974273c6c76ab6b64c6fdc5bdf4a4c565fec845f12a8a80df3b81e
|
data/Gemfile.lock
CHANGED
@@ -2,13 +2,13 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
cloudstack-cli (0.5.0)
|
5
|
-
cloudstack_client (~> 0.2
|
5
|
+
cloudstack_client (~> 0.3.2)
|
6
6
|
thor (~> 0.18.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
cloudstack_client (0.2
|
11
|
+
cloudstack_client (0.3.2)
|
12
12
|
json (1.8.1)
|
13
13
|
rake (10.0.4)
|
14
14
|
rdoc (4.0.1)
|
data/cloudstack-cli.gemspec
CHANGED
@@ -34,21 +34,22 @@ class Server < CloudstackCli::Base
|
|
34
34
|
print_table table
|
35
35
|
|
36
36
|
if options[:command]
|
37
|
+
args = { project_id: project_id, async: false, account: options[:account] }
|
37
38
|
case options[:command].downcase
|
38
39
|
when "start"
|
39
40
|
exit unless yes?("\nStart the server(s) above? [y/N]:", :magenta)
|
40
41
|
jobs = servers.map do |server|
|
41
|
-
{id: client.start_server(server['name'],
|
42
|
+
{id: client.start_server(server['name'], args)['jobid'], name: "Start server #{server['name']}"}
|
42
43
|
end
|
43
44
|
when "stop"
|
44
45
|
exit unless yes?("\nStop the server(s) above? [y/N]:", :magenta)
|
45
46
|
jobs = servers.map do |server|
|
46
|
-
{id: client.stop_server(server['name'],
|
47
|
+
{id: client.stop_server(server['name'], args)['jobid'], name: "Stop server #{server['name']}"}
|
47
48
|
end
|
48
49
|
when "restart"
|
49
50
|
exit unless yes?("\nRestart the server(s) above? [y/N]:", :magenta)
|
50
51
|
jobs = servers.map do |server|
|
51
|
-
{id: client.reboot_server(server['name'],
|
52
|
+
{id: client.reboot_server(server['name'], args)['jobid'], name: "Restart server #{server['name']}"}
|
52
53
|
end
|
53
54
|
else
|
54
55
|
say "\nCommand #{options[:command]} not supported.", :red
|
@@ -161,20 +162,34 @@ class Server < CloudstackCli::Base
|
|
161
162
|
end
|
162
163
|
|
163
164
|
desc "stop NAME", "stop a server"
|
165
|
+
option :project
|
166
|
+
option :account
|
167
|
+
option :force
|
164
168
|
def stop(name)
|
165
|
-
|
169
|
+
options[project_id] = find_project['id'] if options[:project]
|
170
|
+
exit unless options[:force] || yes?("Stop server #{name}? [y/N]:", :magenta)
|
171
|
+
client.stop_server(name, options)
|
166
172
|
puts
|
167
173
|
end
|
168
174
|
|
169
175
|
desc "start NAME", "start a server"
|
176
|
+
option :project
|
177
|
+
option :account
|
170
178
|
def start(name)
|
171
|
-
|
179
|
+
options[project_id] = find_project['id'] if options[:project]
|
180
|
+
say("Start server #{name}", :magenta)
|
181
|
+
client.start_server(name, options)
|
172
182
|
puts
|
173
183
|
end
|
174
184
|
|
175
185
|
desc "reboot NAME", "reboot a server"
|
186
|
+
option :project
|
187
|
+
option :account
|
188
|
+
option :force
|
176
189
|
def restart(name)
|
177
|
-
|
190
|
+
options[project_id] = find_project['id'] if options[:project]
|
191
|
+
exit unless options[:force] || yes?("Reboot server #{name}? [y/N]:", :magenta)
|
192
|
+
client.reboot_server(name, options)
|
178
193
|
puts
|
179
194
|
end
|
180
195
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstack-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.2
|
61
|
+
version: 0.3.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.2
|
68
|
+
version: 0.3.2
|
69
69
|
description: cloudstack-cli is a CloudStack API client written in Ruby.
|
70
70
|
email:
|
71
71
|
- nik.wolfgramm@gmail.com
|