vmfloaty 0.7.5 → 0.7.7

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: 1023c46824f773496c553024460d07e0c0e43e96
4
- data.tar.gz: f70276a66a33cbe1ca93e6c9b0e2b51edc5d8c19
3
+ metadata.gz: 03a25ef4cef2a9df0fce0fc18f91c696d56d3bfe
4
+ data.tar.gz: 1c449470e5469fd8bf415bd2e79b90bacc6fa69e
5
5
  SHA512:
6
- metadata.gz: 9eb4fdb7fb89b3a4658d0157acc5d7dc421a1b956cebfb8dbfbe077a4f5455b06d935718537475f2b982c73659accd80d8c377700290c70ee08bb9e607a4f98a
7
- data.tar.gz: e6743d018ebb1ea06fd7b92f9c72545094af00ed25e055d70a13e3feaaaefb7f16fd08aebadd85abbeefa204f035a6b8a938520cfaffbb5f652c5fff73f5dad1
6
+ metadata.gz: e790212f307e49a638dba038437c444be54765615bf6edb6d9f82f6285ea33afe1c91388d0451c7f8e316c77b56404a8ce19ae6b328f99718d6388cb9d4e10be
7
+ data.tar.gz: 207f58b4fb6317ebec9df825bdf3d966fba8adc8b1561b463b85168b44ab3ed1a3931228f46369aa6673154b860e8c5cd41f451494d8ebcd88586f6a279ab150
data/README.md CHANGED
@@ -22,17 +22,17 @@ $ floaty --help
22
22
 
23
23
  ```
24
24
  delete Schedules the deletion of a host or hosts
25
- get Gets a vm or vms based on the os flag
25
+ get Gets a vm or vms based on the os argument
26
26
  help Display global or [command] help documentation
27
- list Shows a list of available vms from the pooler
28
- modify Modify a vms tags and TTL
27
+ list Shows a list of available vms from the pooler or vms obtained with a token
28
+ modify Modify a vms tags, time to live, and disk space
29
29
  query Get information about a given vm
30
30
  revert Reverts a vm to a specified snapshot
31
31
  snapshot Takes a snapshot of a given vm
32
32
  ssh Grabs a single vm and sshs into it
33
- status Prints the status of vmpooler
34
- summary Prints the summary of vmpooler
35
- token Retrieves or deletes a token
33
+ status Prints the status of pools in vmpooler
34
+ summary Prints a summary of vmpooler
35
+ token Retrieves or deletes a token or checks token status
36
36
 
37
37
  GLOBAL OPTIONS:
38
38
 
@@ -59,7 +59,7 @@ This command will then ask you to log in. If successful, it will return a token
59
59
  Grabbing vms:
60
60
 
61
61
  ```
62
- floaty get centos-7-x86_64=2 debian-7-x86_64=1 windows-10=3 --token mytokenstring --url https://vmpooler.mycompany.net/api/v1
62
+ floaty get centos-7-x86_64=2 debian-7-x86_64 windows-10=3 --token mytokenstring --url https://vmpooler.mycompany.net/api/v1
63
63
  ```
64
64
 
65
65
  ### vmfloaty dotfile
data/lib/vmfloaty.rb CHANGED
@@ -22,21 +22,23 @@ class Vmfloaty
22
22
  config = Conf.read_config
23
23
 
24
24
  command :get do |c|
25
- c.syntax = 'floaty get os_type1=x ox_type2=y ...'
26
- c.summary = 'Gets a vm or vms based on the os flag'
27
- c.description = ''
25
+ c.syntax = 'floaty get os_type0 os_type1=x ox_type2=y [options]'
26
+ c.summary = 'Gets a vm or vms based on the os argument'
27
+ c.description = 'A command to retrieve vms from vmpooler. Can either be a single vm, or multiple with the `=` syntax.'
28
28
  c.example 'Gets a few vms', 'floaty get centos=3 debian --user brian --url http://vmpooler.example.com'
29
29
  c.option '--verbose', 'Enables verbose output'
30
30
  c.option '--user STRING', String, 'User to authenticate with'
31
31
  c.option '--url STRING', String, 'URL of vmpooler'
32
32
  c.option '--token STRING', String, 'Token for vmpooler'
33
33
  c.option '--notoken', 'Makes a request without a token'
34
+ c.option '--force', 'Forces vmfloaty to get requested vms'
34
35
  c.action do |args, options|
35
36
  verbose = options.verbose || config['verbose']
36
37
  token = options.token || config['token']
37
38
  user = options.user ||= config['user']
38
39
  url = options.url ||= config['url']
39
40
  no_token = options.notoken
41
+ force = options.force
40
42
 
41
43
  if args.empty?
42
44
  STDERR.puts "No operating systems provided to obtain. See `floaty get --help` for more information on how to get VMs."
@@ -45,6 +47,14 @@ class Vmfloaty
45
47
 
46
48
  os_types = Utils.generate_os_hash(args)
47
49
 
50
+ max_pool_request = 5
51
+ large_pool_requests = os_types.select{|k,v| v > max_pool_request}
52
+ if ! large_pool_requests.empty? and ! force
53
+ STDERR.puts "Requesting vms over #{max_pool_request} requires a --force flag."
54
+ STDERR.puts "Try again with `floaty get --force`"
55
+ exit 1
56
+ end
57
+
48
58
  unless os_types.empty?
49
59
  if no_token
50
60
  begin
@@ -98,8 +108,8 @@ class Vmfloaty
98
108
 
99
109
  command :list do |c|
100
110
  c.syntax = 'floaty list [options]'
101
- c.summary = 'Shows a list of available vms from the pooler'
102
- c.description = ''
111
+ c.summary = 'Shows a list of available vms from the pooler or vms obtained with a token'
112
+ c.description = 'List will either show all vm templates available in vmpooler, or with the --active flag it will list vms obtained with a vmpooler token.'
103
113
  c.example 'Filter the list on centos', 'floaty list centos --url http://vmpooler.example.com'
104
114
  c.option '--verbose', 'Enables verbose output'
105
115
  c.option '--active', 'Prints information about active vms for a given token'
@@ -136,9 +146,9 @@ class Vmfloaty
136
146
  end
137
147
 
138
148
  command :query do |c|
139
- c.syntax = 'floaty query [hostname] [options]'
149
+ c.syntax = 'floaty query hostname [options]'
140
150
  c.summary = 'Get information about a given vm'
141
- c.description = ''
151
+ c.description = 'Given a hostname from vmpooler, vmfloaty with query vmpooler to get various details about the vm.'
142
152
  c.example 'Get information about a sample host', 'floaty query hostname --url http://vmpooler.example.com'
143
153
  c.option '--verbose', 'Enables verbose output'
144
154
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -153,9 +163,9 @@ class Vmfloaty
153
163
  end
154
164
 
155
165
  command :modify do |c|
156
- c.syntax = 'floaty modify [hostname] [options]'
157
- c.summary = 'Modify a vms tags, TTL, and disk space'
158
- c.description = ''
166
+ c.syntax = 'floaty modify hostname [options]'
167
+ c.summary = 'Modify a vms tags, time to live, and disk space'
168
+ c.description = 'This command makes modifications to the virtual machines state in vmpooler. You can either append tags to the vm, increase how long it stays active for, or increase the amount of disk space.'
159
169
  c.example 'Modifies myhost1 to have a TTL of 12 hours and adds a custom tag', 'floaty modify myhost1 --lifetime 12 --url https://myurl --token mytokenstring --tags \'{"tag":"myvalue"}\''
160
170
  c.option '--verbose', 'Enables verbose output'
161
171
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -277,9 +287,9 @@ class Vmfloaty
277
287
  end
278
288
 
279
289
  command :delete do |c|
280
- c.syntax = 'floaty delete [hostname,...]'
290
+ c.syntax = 'floaty delete hostname,hostname2 [options]'
281
291
  c.summary = 'Schedules the deletion of a host or hosts'
282
- c.description = ''
292
+ c.description = 'Given a comma separated list of hostnames, or --all for all vms, vmfloaty makes a request to vmpooler to schedule the deletion of those vms.'
283
293
  c.example 'Schedules the deletion of a host or hosts', 'floaty delete myhost1,myhost2 --url http://vmpooler.example.com'
284
294
  c.option '--verbose', 'Enables verbose output'
285
295
  c.option '--all', 'Deletes all vms acquired by a token'
@@ -352,9 +362,9 @@ class Vmfloaty
352
362
  end
353
363
 
354
364
  command :snapshot do |c|
355
- c.syntax = 'floaty snapshot [hostname] [options]'
365
+ c.syntax = 'floaty snapshot hostname [options]'
356
366
  c.summary = 'Takes a snapshot of a given vm'
357
- c.description = ''
367
+ c.description = 'Will request a snapshot be taken of the given hostname in vmpooler. This command is known to take a while depending on how much load is on vmpooler.'
358
368
  c.example 'Takes a snapshot for a given host', 'floaty snapshot myvm.example.com --url http://vmpooler.example.com --token a9znth9dn01t416hrguu56ze37t790bl'
359
369
  c.option '--verbose', 'Enables verbose output'
360
370
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -378,9 +388,9 @@ class Vmfloaty
378
388
  end
379
389
 
380
390
  command :revert do |c|
381
- c.syntax = 'floaty revert [hostname] [snapshot] [options]'
391
+ c.syntax = 'floaty revert hostname snapshot [options]'
382
392
  c.summary = 'Reverts a vm to a specified snapshot'
383
- c.description = ''
393
+ c.description = 'Given a snapshot SHA, vmfloaty will request a revert to vmpooler to go back to a previous snapshot.'
384
394
  c.example 'Reverts to a snapshot for a given host', 'floaty revert myvm.example.com n4eb4kdtp7rwv4x158366vd9jhac8btq --url http://vmpooler.example.com --token a9znth9dn01t416hrguu56ze37t790bl'
385
395
  c.option '--verbose', 'Enables verbose output'
386
396
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -410,8 +420,8 @@ class Vmfloaty
410
420
 
411
421
  command :status do |c|
412
422
  c.syntax = 'floaty status [options]'
413
- c.summary = 'Prints the status of vmpooler'
414
- c.description = ''
423
+ c.summary = 'Prints the status of pools in vmpooler'
424
+ c.description = 'Makes a request to vmpooler to request the information about vm pools and how many are ready to be used, what pools are empty, etc.'
415
425
  c.example 'Gets the current vmpooler status', 'floaty status --url http://vmpooler.example.com'
416
426
  c.option '--verbose', 'Enables verbose output'
417
427
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -436,8 +446,8 @@ class Vmfloaty
436
446
 
437
447
  command :summary do |c|
438
448
  c.syntax = 'floaty summary [options]'
439
- c.summary = 'Prints the summary of vmpooler'
440
- c.description = ''
449
+ c.summary = 'Prints a summary of vmpooler'
450
+ c.description = 'Gives a very detailed summary of information related to vmpooler.'
441
451
  c.example 'Gets the current day summary of vmpooler', 'floaty summary --url http://vmpooler.example.com'
442
452
  c.option '--verbose', 'Enables verbose output'
443
453
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -452,9 +462,9 @@ class Vmfloaty
452
462
  end
453
463
 
454
464
  command :token do |c|
455
- c.syntax = 'floaty token [get | delete | status] [token]'
456
- c.summary = 'Retrieves or deletes a token'
457
- c.description = ''
465
+ c.syntax = 'floaty token <get delete status> [options]'
466
+ c.summary = 'Retrieves or deletes a token or checks token status'
467
+ c.description = 'This command is used to manage your vmpooler token. Through the various options, you are able to get a new token, delete an existing token, and request a tokens status.'
458
468
  c.example 'Gets a token from the pooler', 'floaty token get'
459
469
  c.option '--verbose', 'Enables verbose output'
460
470
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -506,9 +516,9 @@ class Vmfloaty
506
516
  end
507
517
 
508
518
  command :ssh do |c|
509
- c.syntax = 'floaty ssh os_type'
519
+ c.syntax = 'floaty ssh os_type [options]'
510
520
  c.summary = 'Grabs a single vm and sshs into it'
511
- c.description = ''
521
+ c.description = 'This command simply will grab a vm template that was requested, and then ssh the user into the machine all at once.'
512
522
  c.example 'SSHs into a centos vm', 'floaty ssh centos7 --url https://vmpooler.example.com'
513
523
  c.option '--verbose', 'Enables verbose output'
514
524
  c.option '--url STRING', String, 'URL of vmpooler'
@@ -1,6 +1,6 @@
1
1
 
2
2
  class Version
3
- @version = '0.7.5'
3
+ @version = '0.7.7'
4
4
 
5
5
  def self.get
6
6
  @version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmfloaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Cain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-06 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander