rabbitmq_http_api_client 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +26 -0
- data/README.md +1 -1
- data/lib/rabbitmq/http/client.rb +5 -1
- data/lib/rabbitmq/http/client/version.rb +1 -1
- data/spec/integration/client_spec.rb +25 -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: 3b469accc29e88cb31b6a758bd41b8e5a4b23cdf
|
4
|
+
data.tar.gz: 0e937bf63faeb30172bee3008fe5ca3b7f05a776
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9049c26798c6aa7484216425676782e97f212ccb8ee2002867e0726aabe1b7f3c4ae0d14b737194b94b38263100376406f2107e68fa659a05f743b07205d1df0
|
7
|
+
data.tar.gz: d7aae20c64bbb343abe1beeb43e75840cac74318238fb3905ea9a624ee16b6bebdf46d7de772fcc2056d0dd509bdddc5c48fc86813955d5469942e961e657514
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
## Changes Between 1.5.0 and 1.6.0
|
2
|
+
|
3
|
+
### Definition Upload Support
|
4
|
+
|
5
|
+
The client now can upload definitions (of queues, exchanges, etc):
|
6
|
+
|
7
|
+
``` ruby
|
8
|
+
defs = {
|
9
|
+
:queues => [{
|
10
|
+
:name => 'my-definition-queue',
|
11
|
+
:vhost => '/',
|
12
|
+
:durable => true,
|
13
|
+
:auto_delete => false,
|
14
|
+
:arguments => {
|
15
|
+
"x-dead-letter-exchange" => 'dead'
|
16
|
+
}
|
17
|
+
}]
|
18
|
+
}.to_json
|
19
|
+
|
20
|
+
c.upload_definitions(defs)
|
21
|
+
```
|
22
|
+
|
23
|
+
Contributed by Pol Miro.
|
24
|
+
|
25
|
+
|
26
|
+
|
1
27
|
## Changes Between 1.4.0 and 1.5.0
|
2
28
|
|
3
29
|
### Support for URIs containing a path
|
data/README.md
CHANGED
data/lib/rabbitmq/http/client.rb
CHANGED
@@ -77,7 +77,11 @@ module RabbitMQ
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def upload_definitions(defs)
|
80
|
-
|
80
|
+
response = @connection.post("definitions") do |req|
|
81
|
+
req.headers['Content-Type'] = "application/json"
|
82
|
+
req.body = defs
|
83
|
+
end
|
84
|
+
response.success?
|
81
85
|
end
|
82
86
|
|
83
87
|
def list_connections
|
@@ -139,7 +139,31 @@ describe RabbitMQ::HTTP::Client do
|
|
139
139
|
end
|
140
140
|
|
141
141
|
describe "POST /api/definitions" do
|
142
|
-
|
142
|
+
let(:definition) do
|
143
|
+
{
|
144
|
+
:queues => [{
|
145
|
+
:name => 'my-definition-queue',
|
146
|
+
:vhost => '/',
|
147
|
+
:durable => true,
|
148
|
+
:auto_delete => false,
|
149
|
+
:arguments => {
|
150
|
+
"x-dead-letter-exchange" => 'dead'
|
151
|
+
}
|
152
|
+
}]
|
153
|
+
}.to_json
|
154
|
+
end
|
155
|
+
|
156
|
+
it "returns true when successful" do
|
157
|
+
r = subject.upload_definitions(definition)
|
158
|
+
expect(r).to eq(true)
|
159
|
+
end
|
160
|
+
|
161
|
+
it "stores the uploaded definitions" do
|
162
|
+
subject.upload_definitions(definition)
|
163
|
+
xs = subject.list_definitions
|
164
|
+
uploaded_queue = xs.queues.detect { |q| q.name = 'my-definition-queue' }
|
165
|
+
expect(uploaded_queue).not_to eq(nil)
|
166
|
+
end
|
143
167
|
end
|
144
168
|
|
145
169
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbitmq_http_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klishin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|