diplomat 2.1.1 → 2.1.2
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/lib/diplomat/acl.rb +2 -2
- data/lib/diplomat/check.rb +6 -6
- data/lib/diplomat/kv.rb +1 -1
- data/lib/diplomat/node.rb +2 -2
- data/lib/diplomat/query.rb +1 -1
- data/lib/diplomat/rest_client.rb +1 -1
- data/lib/diplomat/service.rb +2 -2
- data/lib/diplomat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac09c50fba20a1d2d81202396ec7ff4e22ad8012e1fed38e24d163352567cda
|
4
|
+
data.tar.gz: 3d4f798107ce788f6e0ab82cb3660ebe3b44a79f9642ff7d1ae51d2a10cbbc38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e75c18e604a9b2974fc81f633b33b9620ea6e30d79a2eab59d7c9c664b49ec43e5131efeab5d904cdb881eb39b790481b544fbe88b032aa322051264237861e
|
7
|
+
data.tar.gz: 7691606b247688cf9691ffc75c7eec665c5bac8af53de5037df7832dbd42b31876f9741f4e9ffc8da5425ea1ac36c7760965b6d1225c7a689c9846719d81c090
|
data/lib/diplomat/acl.rb
CHANGED
@@ -54,7 +54,7 @@ module Diplomat
|
|
54
54
|
raise Diplomat::IdParameterRequired unless value['ID'] || value[:ID]
|
55
55
|
|
56
56
|
custom_params = use_cas(@options)
|
57
|
-
@raw = send_put_request(@conn, ['/v1/acl/update'], options, value, custom_params)
|
57
|
+
@raw = send_put_request(@conn, ['/v1/acl/update'], options, value.to_json, custom_params)
|
58
58
|
parse_body
|
59
59
|
end
|
60
60
|
|
@@ -64,7 +64,7 @@ module Diplomat
|
|
64
64
|
# @return [Hash] The result Acl
|
65
65
|
def create(value, options = {})
|
66
66
|
custom_params = use_cas(@options)
|
67
|
-
@raw = send_put_request(@conn, ['/v1/acl/create'], options, value, custom_params)
|
67
|
+
@raw = send_put_request(@conn, ['/v1/acl/create'], options, value.to_json, custom_params)
|
68
68
|
parse_body
|
69
69
|
end
|
70
70
|
|
data/lib/diplomat/check.rb
CHANGED
@@ -25,13 +25,13 @@ module Diplomat
|
|
25
25
|
raise(Diplomat::DeprecatedArgument, 'Script usage is deprecated, replace by an array of args')
|
26
26
|
end
|
27
27
|
|
28
|
-
definition =
|
28
|
+
definition = JSON.generate(
|
29
29
|
'ID' => check_id,
|
30
30
|
'Name' => name,
|
31
31
|
'Notes' => notes,
|
32
32
|
'Args' => args,
|
33
33
|
'Interval' => interval
|
34
|
-
|
34
|
+
)
|
35
35
|
ret = send_put_request(@conn, ['/v1/agent/check/register'], options, definition)
|
36
36
|
ret.status == 200
|
37
37
|
end
|
@@ -45,12 +45,12 @@ module Diplomat
|
|
45
45
|
# @param options [Hash] options parameter hash
|
46
46
|
# @return [Boolean] Success
|
47
47
|
def register_ttl(check_id, name, notes, ttl, options = {})
|
48
|
-
definition =
|
48
|
+
definition = JSON.generate(
|
49
49
|
'ID' => check_id,
|
50
50
|
'Name' => name,
|
51
51
|
'Notes' => notes,
|
52
52
|
'TTL' => ttl
|
53
|
-
|
53
|
+
)
|
54
54
|
ret = send_put_request(@conn, ['/v1/agent/check/register'], options, definition)
|
55
55
|
ret.status == 200
|
56
56
|
end
|
@@ -71,10 +71,10 @@ module Diplomat
|
|
71
71
|
# @param options [Hash] options parameter hash
|
72
72
|
# @return [Integer] Status code
|
73
73
|
def update_ttl(check_id, status, output = nil, options = {})
|
74
|
-
definition =
|
74
|
+
definition = JSON.generate(
|
75
75
|
'Status' => status,
|
76
76
|
'Output' => output
|
77
|
-
|
77
|
+
)
|
78
78
|
ret = send_put_request(@conn, ["/v1/agent/check/update/#{check_id}"], options, definition)
|
79
79
|
ret.status == 200
|
80
80
|
end
|
data/lib/diplomat/kv.rb
CHANGED
@@ -167,7 +167,7 @@ module Diplomat
|
|
167
167
|
custom_params = []
|
168
168
|
custom_params << dc(options)
|
169
169
|
custom_params << transaction_consistency(options)
|
170
|
-
raw = send_put_request(@conn_no_err, ['/v1/txn'], options, value, custom_params)
|
170
|
+
raw = send_put_request(@conn_no_err, ['/v1/txn'], options, JSON.generate(value), custom_params)
|
171
171
|
transaction_return JSON.parse(raw.body), options
|
172
172
|
end
|
173
173
|
|
data/lib/diplomat/node.rb
CHANGED
@@ -27,7 +27,7 @@ module Diplomat
|
|
27
27
|
# @param options [Hash] options parameter hash
|
28
28
|
# @return [Boolean]
|
29
29
|
def register(definition, options = {})
|
30
|
-
register = send_put_request(@conn, ['/v1/catalog/register'], options, definition)
|
30
|
+
register = send_put_request(@conn, ['/v1/catalog/register'], options, JSON.dump(definition))
|
31
31
|
register.status == 200
|
32
32
|
end
|
33
33
|
|
@@ -36,7 +36,7 @@ module Diplomat
|
|
36
36
|
# @param options [Hash] options parameter hash
|
37
37
|
# @return [Boolean]
|
38
38
|
def deregister(definition, options = {})
|
39
|
-
deregister = send_put_request(@conn, ['/v1/catalog/deregister'], options, definition)
|
39
|
+
deregister = send_put_request(@conn, ['/v1/catalog/deregister'], options, JSON.dump(definition))
|
40
40
|
deregister.status == 200
|
41
41
|
end
|
42
42
|
end
|
data/lib/diplomat/query.rb
CHANGED
@@ -51,7 +51,7 @@ module Diplomat
|
|
51
51
|
# @return [Boolean]
|
52
52
|
def update(key, definition, options = {})
|
53
53
|
custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil
|
54
|
-
ret = send_put_request(@conn, ["/v1/query/#{key}"], options, definition, custom_params)
|
54
|
+
ret = send_put_request(@conn, ["/v1/query/#{key}"], options, JSON.dump(definition), custom_params)
|
55
55
|
ret.status == 200
|
56
56
|
end
|
57
57
|
|
data/lib/diplomat/rest_client.rb
CHANGED
@@ -214,7 +214,7 @@ module Diplomat
|
|
214
214
|
connection.put do |req|
|
215
215
|
req.url rest_options[:url_prefix] ? rest_options[:url_prefix] + concat_url(url) : concat_url(url)
|
216
216
|
rest_options[:headers].map { |k, v| req.headers[k.to_sym] = v } unless rest_options[:headers].nil?
|
217
|
-
req.body =
|
217
|
+
req.body = data unless data.nil?
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
data/lib/diplomat/service.rb
CHANGED
@@ -47,7 +47,7 @@ module Diplomat
|
|
47
47
|
# @return [Boolean]
|
48
48
|
def register(definition, options = {})
|
49
49
|
url = options[:path] || ['/v1/agent/service/register']
|
50
|
-
register = send_put_request(@conn, url, options, definition)
|
50
|
+
register = send_put_request(@conn, url, options, JSON.dump(definition))
|
51
51
|
register.status == 200
|
52
52
|
end
|
53
53
|
|
@@ -74,7 +74,7 @@ module Diplomat
|
|
74
74
|
# @param options [Hash] options parameter hash
|
75
75
|
# @return [Boolean]
|
76
76
|
def deregister_external(definition, options = {})
|
77
|
-
deregister = send_put_request(@conn, ['/v1/catalog/deregister'], options, definition)
|
77
|
+
deregister = send_put_request(@conn, ['/v1/catalog/deregister'], options, JSON.dump(definition))
|
78
78
|
deregister.status == 200
|
79
79
|
end
|
80
80
|
|
data/lib/diplomat/version.rb
CHANGED