vmfloaty 0.2.6 → 0.2.7
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/README.md +1 -1
- data/lib/vmfloaty/pooler.rb +10 -2
- data/lib/vmfloaty/version.rb +1 -1
- data/lib/vmfloaty.rb +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d5f11511ad84f602cc136d8d905e913229cf95
|
4
|
+
data.tar.gz: 07e4766f0f69c219ab3d9d8cd797d5595f6f254c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc3e2dfec7fa52efe13908c89b1ecee23d74daec52e1b989aea6fb06a21c8d5bcfc9ceb69cad02bd58be34c1bb50d9caad9e7fe16a5ea41600d960f3ec8a2d2
|
7
|
+
data.tar.gz: b0cbf57fedf7d227914c0de9aa3616fabbcb3b7c7d45be4d0f621330d14d86957060e38898b0684feac3eaccce9fd64e0b8564758984beaa7c3ec2becfef6f05
|
data/README.md
CHANGED
@@ -53,7 +53,7 @@ This command will then ask you to log in. If successful, it will return a token
|
|
53
53
|
Grabbing vms:
|
54
54
|
|
55
55
|
```
|
56
|
-
floaty get centos-7
|
56
|
+
floaty get centos-7-x86_64=2 debian-7-x86_64=1 windows-10=3 --token mytokenstring --url https://vmpooler.mycompany.net
|
57
57
|
```
|
58
58
|
|
59
59
|
### vmfloaty dotfile
|
data/lib/vmfloaty/pooler.rb
CHANGED
@@ -19,13 +19,21 @@ class Pooler
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.retrieve(verbose, os_type, token, url)
|
22
|
-
os = os_type.gsub(',','+')
|
23
22
|
conn = Http.get_conn(verbose, url)
|
24
23
|
if token
|
25
24
|
conn.headers['X-AUTH-TOKEN'] = token
|
26
25
|
end
|
27
26
|
|
28
|
-
|
27
|
+
os_string = ""
|
28
|
+
os_type.each do |os,num|
|
29
|
+
num.times do |i|
|
30
|
+
os_string << os+"+"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
os_string = os_string.chomp("+")
|
35
|
+
|
36
|
+
response = conn.post "/vm/#{os_string}"
|
29
37
|
|
30
38
|
res_body = JSON.parse(response.body)
|
31
39
|
res_body
|
data/lib/vmfloaty/version.rb
CHANGED
data/lib/vmfloaty.rb
CHANGED
@@ -18,10 +18,10 @@ class Vmfloaty
|
|
18
18
|
config = Conf.read_config
|
19
19
|
|
20
20
|
command :get do |c|
|
21
|
-
c.syntax = 'floaty get
|
21
|
+
c.syntax = 'floaty get os_type1=x ox_type2=y ...'
|
22
22
|
c.summary = 'Gets a vm or vms based on the os flag'
|
23
23
|
c.description = ''
|
24
|
-
c.example 'Gets 3 vms', 'floaty get centos
|
24
|
+
c.example 'Gets 3 vms', 'floaty get centos=3 debian=1 --user brian --url http://vmpooler.example.com'
|
25
25
|
c.option '--verbose', 'Enables verbose output'
|
26
26
|
c.option '--user STRING', String, 'User to authenticate with'
|
27
27
|
c.option '--url STRING', String, 'URL of vmpooler'
|
@@ -32,7 +32,13 @@ class Vmfloaty
|
|
32
32
|
token = options.token || config['token']
|
33
33
|
user = options.user ||= config['user']
|
34
34
|
url = options.url ||= config['url']
|
35
|
-
|
35
|
+
|
36
|
+
os_types = {}
|
37
|
+
args.each do |arg|
|
38
|
+
os_arr = arg.split("=")
|
39
|
+
os_types[os_arr[0]] = os_arr[1].to_i
|
40
|
+
end
|
41
|
+
|
36
42
|
no_token = options.notoken
|
37
43
|
|
38
44
|
if no_token
|
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.2.
|
4
|
+
version: 0.2.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: 2015-10-
|
11
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|