gadabout 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gadabout/DSL/job.rb +5 -0
- data/lib/gadabout/client.rb +9 -6
- data/lib/gadabout/version.rb +1 -1
- 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: 7b12ea4b1c28e0fdc2cde0cd028fcf388abfc62d
|
4
|
+
data.tar.gz: 973046ed58a5b550cc69b6aca76593a280b0b16b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86cba8a2a484721e196901b4dbab37d1e65717280a616227373d0069a9f228660c0b623f0714a10699c84f46bc179c9c8345c50661db97363a0fecf1d5adeca5
|
7
|
+
data.tar.gz: 7eb62d47b6871fbe088bdbbd815bc7fdc94f2eddd674370a5705fafba22b9a4fdd2c1044da0cab5a0fd3ebf479af303180d70a0e6fc05b84f904da33b596726a
|
data/lib/gadabout/DSL/job.rb
CHANGED
@@ -9,6 +9,7 @@ module Gadabout
|
|
9
9
|
@constraints = []
|
10
10
|
@all_at_once = false
|
11
11
|
@meta = {}
|
12
|
+
@id = nil
|
12
13
|
@periodic = nil
|
13
14
|
@priority = 50
|
14
15
|
@region = "global"
|
@@ -63,6 +64,10 @@ module Gadabout
|
|
63
64
|
@type = type
|
64
65
|
end
|
65
66
|
|
67
|
+
def id(id)
|
68
|
+
@id = id
|
69
|
+
end
|
70
|
+
|
66
71
|
def priority(priority)
|
67
72
|
@priority = priority
|
68
73
|
end
|
data/lib/gadabout/client.rb
CHANGED
@@ -51,7 +51,7 @@ module Gadabout
|
|
51
51
|
|
52
52
|
#PUT/POST /v1/job
|
53
53
|
def register_job(spec)
|
54
|
-
path = "/job"
|
54
|
+
path = "/job/"
|
55
55
|
return put(path, nil, spec)
|
56
56
|
end
|
57
57
|
|
@@ -189,17 +189,20 @@ module Gadabout
|
|
189
189
|
begin
|
190
190
|
resp = @rest[path].get(:params => params)
|
191
191
|
rescue StandardError => e
|
192
|
-
raise "Error whilst making HTTP GET request to the Nomad Agent at #{path}: #{e.response}"
|
192
|
+
raise "Error whilst making HTTP GET request to the Nomad Agent at #{path}: #{e} #{e.response}"
|
193
193
|
end
|
194
194
|
|
195
195
|
return JSON.parse(resp)
|
196
196
|
end
|
197
197
|
|
198
|
-
def put(path, params
|
198
|
+
def put(path, params, body)
|
199
|
+
body ||= ''
|
200
|
+
params ||= {}
|
201
|
+
|
199
202
|
begin
|
200
|
-
resp = @rest[path].
|
203
|
+
resp = @rest[path].post(body, :params => params)
|
201
204
|
rescue StandardError => e
|
202
|
-
raise "Error whilst making HTTP PUT request to the Nomad Agent at #{path}: #{e.response}"
|
205
|
+
raise "Error whilst making HTTP PUT request to the Nomad Agent at #{path}: #{e} #{e.response.body}"
|
203
206
|
end
|
204
207
|
|
205
208
|
return JSON.parse(resp)
|
@@ -209,7 +212,7 @@ module Gadabout
|
|
209
212
|
begin
|
210
213
|
resp = @rest[path].delete(:params => params)
|
211
214
|
rescue StandardError => e
|
212
|
-
raise "Error whilst making HTTP DELETE request to the Nomad Agent at #{path}: #{e.response}"
|
215
|
+
raise "Error whilst making HTTP DELETE request to the Nomad Agent at #{path}: #{e} #{e.response}"
|
213
216
|
end
|
214
217
|
|
215
218
|
return JSON.parse(resp)
|
data/lib/gadabout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gadabout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh McGhee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|