cloudstack-cli 0.5.0 → 0.5.1

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: 52d453553a4f7b0d1ae7f1d925b4fb684f222d79
4
- data.tar.gz: 25f406366cacbd8cb6b0c6ac2c7265034b841d0b
3
+ metadata.gz: ce7f63bf939c5e8b796d69a2dbd188f3df889a5e
4
+ data.tar.gz: c0fe089fac7357eff4759194e97c6c22a77bf305
5
5
  SHA512:
6
- metadata.gz: 4406c555844a0ccfac4f8c6240c8d68332f48374b389485c20b822481a41e2ccdead30ff8751a560f0b00af9e0219572548ebd48af53f3686bf9d61e2906a3ad
7
- data.tar.gz: 0520556e1ba0a2624113019c5dbfcb8e40e9329ef3578063bd41803fec280c5906cbf79c92303455e041a6cc187d362363465f7e0a5a5b1f300b7850aa6ac075
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.16)
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.16)
11
+ cloudstack_client (0.3.2)
12
12
  json (1.8.1)
13
13
  rake (10.0.4)
14
14
  rdoc (4.0.1)
@@ -24,5 +24,5 @@ Gem::Specification.new do |gem|
24
24
  gem.add_development_dependency('rake', '~> 10.0.4')
25
25
 
26
26
  gem.add_dependency('thor', '~> 0.18.1')
27
- gem.add_dependency('cloudstack_client', '~> 0.2.16')
27
+ gem.add_dependency('cloudstack_client', '~> 0.3.2')
28
28
  end
@@ -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'], project_id, false)['jobid'], name: "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'], nil, project_id, false)['jobid'], name: "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'], project_id, false)['jobid'], name: "Restart 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
- client.stop_server(name)
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
- client.start_server(name)
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
- client.reboot_server(name)
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
 
@@ -1,3 +1,3 @@
1
1
  module CloudstackCli
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
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.0
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.16
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.16
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