cloudstack_client 0.2.15 → 0.2.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0c4c9cb05893c1de7b957fe90cbecbecc0568c8
4
- data.tar.gz: 34477110c6f9b11e92669b4ffd5a68726f95ab44
3
+ metadata.gz: 5a54023e0e305d388823c7303ffe6c803c2a59bc
4
+ data.tar.gz: ed2dded3f88230f3bbc02b408cf19cf8ab1e30ca
5
5
  SHA512:
6
- metadata.gz: 98376eacd0af0b4ee80398eb2b7075b34713decce757ed0bd481a97cc217bc8a7e02ecd84ab27ddc82be83dd707327b5a5430b2672614a712bd72b7d3c885fa4
7
- data.tar.gz: e6eb17b645087dfdfa6be368ce363e470572667f939a264a9c90a1f0bc755685fe5ae12324585d6c60674c67d8e9826830663b4c9a099c725475f3fa04b63a70
6
+ metadata.gz: 6d49a959f95b0494611ab4acccc30789b0983bcc8da2b16ce835b050db28bbeae581c91818dca0e7a78ffb74329a9725a2d7d305fbbf69ca5afa1b42db976c27
7
+ data.tar.gz: 2f95d6a9754c727f2834ed4c246ff82912ad2ea0b21e68bb92be37f5cda07a756ffe45a555a34056bd1aba96f5fdc2937321ffc824dbf1cc91a057b55b59973c
@@ -236,7 +236,7 @@ module CloudstackClient
236
236
  # Stops the server with the specified name.
237
237
  #
238
238
 
239
- def stop_server(name, forced=nil, project_id=nil)
239
+ def stop_server(name, forced=nil, project_id=nil, async=true)
240
240
  server = get_server(name, project_id)
241
241
  if !server || !server['id']
242
242
  puts "Error: Virtual machine '#{name}' does not exist"
@@ -249,15 +249,14 @@ module CloudstackClient
249
249
  }
250
250
  params['forced'] = true if forced
251
251
 
252
- json = send_async_request(params)
253
- json['virtualmachine']
252
+ async ? send_async_request(params)['virtualmachine'] : send_request(params)
254
253
  end
255
254
 
256
255
  ##
257
256
  # Start the server with the specified name.
258
257
  #
259
258
 
260
- def start_server(name, project_id=nil)
259
+ def start_server(name, project_id=nil, async=true)
261
260
  server = get_server(name, project_id)
262
261
  if !server || !server['id']
263
262
  puts "Error: Virtual machine '#{name}' does not exist"
@@ -269,15 +268,14 @@ module CloudstackClient
269
268
  'id' => server['id']
270
269
  }
271
270
 
272
- json = send_async_request(params)
273
- json['virtualmachine']
271
+ async ? send_async_request(params)['virtualmachine'] : send_request(params)
274
272
  end
275
273
 
276
274
  ##
277
275
  # Reboot the server with the specified name.
278
276
  #
279
277
 
280
- def reboot_server(name, project_id=nil)
278
+ def reboot_server(name, project_id=nil, async=true)
281
279
  server = get_server(name, project_id)
282
280
  if !server || !server['id']
283
281
  puts "Error: Virtual machine '#{name}' does not exist"
@@ -289,8 +287,7 @@ module CloudstackClient
289
287
  'id' => server['id']
290
288
  }
291
289
 
292
- json = send_async_request(params)
293
- json['virtualmachine']
290
+ async ? send_async_request(params)['virtualmachine'] : send_request(params)
294
291
  end
295
292
 
296
293
  ##
@@ -302,7 +299,7 @@ module CloudstackClient
302
299
  'command' => 'destroyVirtualMachine',
303
300
  'id' => id
304
301
  }
305
-
302
+
306
303
  async ? send_async_request(params)['virtualmachine'] : send_request(params)
307
304
  end
308
305
 
@@ -1,3 +1,3 @@
1
1
  module CloudstackClient
2
- VERSION = "0.2.15"
2
+ VERSION = "0.2.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm