stacker_bee 1.0.1 → 2.0.0.pre.pre164

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +13 -5
  2. data/.travis.yml +14 -1
  3. data/README.md +117 -67
  4. data/bin/stacker_bee +4 -3
  5. data/lib/faraday_middleware/response/graylog.rb +35 -0
  6. data/lib/stacker_bee/body_parser.rb +11 -1
  7. data/lib/stacker_bee/client.rb +32 -4
  8. data/lib/stacker_bee/connection.rb +8 -9
  9. data/lib/stacker_bee/dictionary_flattener.rb +12 -12
  10. data/lib/stacker_bee/graylog_faraday_middleware.rb +13 -0
  11. data/lib/stacker_bee/request_error.rb +1 -1
  12. data/lib/stacker_bee/version.rb +1 -1
  13. data/lib/stacker_bee.rb +3 -0
  14. data/spec/cassettes/A_request_sent_to_CloudStack_for_console_access/returns_html_for_console_access.yml +34 -0
  15. data/spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/{a_request_parameter_with_a_Map → a_request_parameter_with_a_map}/can_create_an_object.yml +0 -0
  16. data/spec/integration/configure_middleware_spec.rb +30 -0
  17. data/spec/integration/console_spec.rb +23 -0
  18. data/spec/integration/request_spec.rb +2 -31
  19. data/spec/spec_helper.rb +4 -0
  20. data/spec/units/faraday_graylog_middleware_spec.rb +80 -0
  21. data/spec/units/stacker_bee/client_spec.rb +52 -9
  22. data/spec/units/stacker_bee/connection_spec.rb +14 -5
  23. data/spec/units/stacker_bee/console_spec.rb +0 -0
  24. data/spec/units/stacker_bee/graylog_faraday_middleware_spec.rb +51 -0
  25. data/spec/units/stacker_bee/request_error_spec.rb +7 -3
  26. data/spec/units/stacker_bee/response_spec.rb +18 -4
  27. data/stacker_bee.gemspec +9 -2
  28. metadata +58 -15
  29. data/lib/stacker_bee/middleware/logger.rb +0 -47
  30. data/spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_Map/object.yml +0 -153
  31. data/spec/units/stacker_bee/middleware/logger_spec.rb +0 -55
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stacker_bee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0.pre.pre164
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Sterndale
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-31 00:00:00.000000000 Z
12
+ date: 2014-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -18,6 +18,9 @@ dependencies:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0.8'
21
+ - - <
22
+ - !ruby/object:Gem::Version
23
+ version: '0.9'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,6 +28,9 @@ dependencies:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0.8'
31
+ - - <
32
+ - !ruby/object:Gem::Version
33
+ version: '0.9'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: multi_json
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -39,6 +45,20 @@ dependencies:
39
45
  - - ~>
40
46
  - !ruby/object:Gem::Version
41
47
  version: '1.8'
48
+ - !ruby/object:Gem::Dependency
49
+ name: faraday_middleware
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.9'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.9'
42
62
  - !ruby/object:Gem::Dependency
43
63
  name: bundler
44
64
  requirement: !ruby/object:Gem::Requirement
@@ -113,14 +133,28 @@ dependencies:
113
133
  name: rubocop
114
134
  requirement: !ruby/object:Gem::Requirement
115
135
  requirements:
116
- - - '>='
136
+ - - ! '>='
117
137
  - !ruby/object:Gem::Version
118
138
  version: '0'
119
139
  type: :development
120
140
  prerelease: false
121
141
  version_requirements: !ruby/object:Gem::Requirement
122
142
  requirements:
123
- - - '>='
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ - !ruby/object:Gem::Dependency
147
+ name: pry
148
+ requirement: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ type: :development
154
+ prerelease: false
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ! '>='
124
158
  - !ruby/object:Gem::Version
125
159
  version: '0'
126
160
  description: Ruby CloudStack client and CLI
@@ -142,6 +176,7 @@ files:
142
176
  - bin/stacker_bee
143
177
  - config.default.yml
144
178
  - config/4.2.json
179
+ - lib/faraday_middleware/response/graylog.rb
145
180
  - lib/stacker_bee.rb
146
181
  - lib/stacker_bee/api.rb
147
182
  - lib/stacker_bee/body_parser.rb
@@ -149,8 +184,8 @@ files:
149
184
  - lib/stacker_bee/configuration.rb
150
185
  - lib/stacker_bee/connection.rb
151
186
  - lib/stacker_bee/dictionary_flattener.rb
187
+ - lib/stacker_bee/graylog_faraday_middleware.rb
152
188
  - lib/stacker_bee/middleware/detokenizer.rb
153
- - lib/stacker_bee/middleware/logger.rb
154
189
  - lib/stacker_bee/middleware/signed_query.rb
155
190
  - lib/stacker_bee/rash.rb
156
191
  - lib/stacker_bee/request.rb
@@ -158,10 +193,10 @@ files:
158
193
  - lib/stacker_bee/response.rb
159
194
  - lib/stacker_bee/utilities.rb
160
195
  - lib/stacker_bee/version.rb
196
+ - spec/cassettes/A_request_sent_to_CloudStack_for_console_access/returns_html_for_console_access.yml
161
197
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/.yml
162
198
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_nil_request_parameter/properly_executes_the_request.yml
163
- - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_Map/can_create_an_object.yml
164
- - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_Map/object.yml
199
+ - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_map/can_create_an_object.yml
165
200
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_an_Array/.yml
166
201
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_and_empty_string/properly_executes_the_request.yml
167
202
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/containing_an_error/.yml
@@ -175,14 +210,18 @@ files:
175
210
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/space_character_in_a_request_parameter/properly_signs_the_request.yml
176
211
  - spec/fixtures/4.2.json
177
212
  - spec/fixtures/simple.json
213
+ - spec/integration/configure_middleware_spec.rb
214
+ - spec/integration/console_spec.rb
178
215
  - spec/integration/request_spec.rb
179
216
  - spec/spec_helper.rb
217
+ - spec/units/faraday_graylog_middleware_spec.rb
180
218
  - spec/units/stacker_bee/api_spec.rb
181
219
  - spec/units/stacker_bee/client_spec.rb
182
220
  - spec/units/stacker_bee/configuration_spec.rb
183
221
  - spec/units/stacker_bee/connection_spec.rb
222
+ - spec/units/stacker_bee/console_spec.rb
184
223
  - spec/units/stacker_bee/dictionary_flattener_spec.rb
185
- - spec/units/stacker_bee/middleware/logger_spec.rb
224
+ - spec/units/stacker_bee/graylog_faraday_middleware_spec.rb
186
225
  - spec/units/stacker_bee/rash_spec.rb
187
226
  - spec/units/stacker_bee/request_error_spec.rb
188
227
  - spec/units/stacker_bee/request_spec.rb
@@ -200,25 +239,25 @@ require_paths:
200
239
  - lib
201
240
  required_ruby_version: !ruby/object:Gem::Requirement
202
241
  requirements:
203
- - - '>='
242
+ - - ! '>='
204
243
  - !ruby/object:Gem::Version
205
244
  version: '0'
206
245
  required_rubygems_version: !ruby/object:Gem::Requirement
207
246
  requirements:
208
- - - '>='
247
+ - - ! '>'
209
248
  - !ruby/object:Gem::Version
210
- version: '0'
249
+ version: 1.3.1
211
250
  requirements: []
212
251
  rubyforge_project:
213
- rubygems_version: 2.0.3
252
+ rubygems_version: 2.2.2
214
253
  signing_key:
215
254
  specification_version: 4
216
255
  summary: Ruby CloudStack client
217
256
  test_files:
257
+ - spec/cassettes/A_request_sent_to_CloudStack_for_console_access/returns_html_for_console_access.yml
218
258
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/.yml
219
259
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_nil_request_parameter/properly_executes_the_request.yml
220
- - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_Map/can_create_an_object.yml
221
- - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_Map/object.yml
260
+ - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_a_map/can_create_an_object.yml
222
261
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_an_Array/.yml
223
262
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/a_request_parameter_with_and_empty_string/properly_executes_the_request.yml
224
263
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/containing_an_error/.yml
@@ -232,14 +271,18 @@ test_files:
232
271
  - spec/cassettes/A_response_to_a_request_sent_to_the_CloudStack_API/space_character_in_a_request_parameter/properly_signs_the_request.yml
233
272
  - spec/fixtures/4.2.json
234
273
  - spec/fixtures/simple.json
274
+ - spec/integration/configure_middleware_spec.rb
275
+ - spec/integration/console_spec.rb
235
276
  - spec/integration/request_spec.rb
236
277
  - spec/spec_helper.rb
278
+ - spec/units/faraday_graylog_middleware_spec.rb
237
279
  - spec/units/stacker_bee/api_spec.rb
238
280
  - spec/units/stacker_bee/client_spec.rb
239
281
  - spec/units/stacker_bee/configuration_spec.rb
240
282
  - spec/units/stacker_bee/connection_spec.rb
283
+ - spec/units/stacker_bee/console_spec.rb
241
284
  - spec/units/stacker_bee/dictionary_flattener_spec.rb
242
- - spec/units/stacker_bee/middleware/logger_spec.rb
285
+ - spec/units/stacker_bee/graylog_faraday_middleware_spec.rb
243
286
  - spec/units/stacker_bee/rash_spec.rb
244
287
  - spec/units/stacker_bee/request_error_spec.rb
245
288
  - spec/units/stacker_bee/request_spec.rb
@@ -1,47 +0,0 @@
1
- require "forwardable"
2
- require "logger"
3
- require "pp"
4
-
5
- module StackerBee
6
- module Middleware
7
- class Logger < Faraday::Response::Middleware
8
- extend Forwardable
9
- PROGNAME = "StackerBee"
10
-
11
- attr_accessor :logger
12
-
13
- def initialize(app, _logger = nil)
14
- super(app)
15
- self.logger = _logger
16
- logger.progname ||= PROGNAME
17
- end
18
-
19
- def logger
20
- @logger ||= ::Logger.new($stdout)
21
- end
22
-
23
- def_delegators :logger, :debug, :info, :warn, :error, :fatal
24
-
25
- def call(env)
26
- log_request(env)
27
- super
28
- end
29
-
30
- def on_complete(env)
31
- log_response(env)
32
- end
33
-
34
- def log_request(env)
35
- info "#{env[:method]} #{env[:url]}"
36
- debug env[:request_headers].pretty_inspect
37
- end
38
-
39
- def log_response(env)
40
- status_message = "Status: #{env[:status]}"
41
- env[:status] < 400 ? info(status_message) : error(status_message)
42
- debug env[:response_headers].pretty_inspect
43
- debug env[:body]
44
- end
45
- end
46
- end
47
- end
@@ -1,153 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: <CLOUD_STACK_URL>?apiKey=<CLOUD_STACK_API_KEY>&command=listZones&response=json&signature=/MnHgTBKGc%2BXx0Z8KwMllvw92vg=
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- User-Agent:
11
- - Faraday v0.8.8
12
- Accept-Encoding:
13
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
- Accept:
15
- - ! '*/*'
16
- response:
17
- status:
18
- code: 200
19
- message: OK
20
- headers:
21
- Content-Type:
22
- - text/javascript; charset=UTF-8
23
- Content-Length:
24
- - '403'
25
- Server:
26
- - Jetty(6.1.26)
27
- body:
28
- encoding: US-ASCII
29
- string: ! '{ "listzonesresponse" : { "count":1 ,"zone" : [ {"id":"39e9e31e-925c-4b55-8d33-f99912b73dfc","name":"Sandbox-simulator","dns1":"10.147.28.6","internaldns1":"10.147.28.6","guestcidraddress":"10.1.1.0/24","networktype":"Advanced","securitygroupsenabled":false,"allocationstate":"Enabled","zonetoken":"ea3acbc4-cae8-3b82-b42f-7492ddfede00","dhcpprovider":"VirtualRouter","localstorageenabled":false}
30
- ] } }'
31
- http_version:
32
- recorded_at: Wed, 18 Dec 2013 21:25:06 GMT
33
- - request:
34
- method: get
35
- uri: <CLOUD_STACK_URL>?apiKey=<CLOUD_STACK_API_KEY>&command=listNetworkOfferings&response=json&signature=BAdYatJ5Rjcffi6sU8P%2BZtLhSF8=&supportedServices=sourcenat&type=isolated
36
- body:
37
- encoding: US-ASCII
38
- string: ''
39
- headers:
40
- User-Agent:
41
- - Faraday v0.8.8
42
- Accept-Encoding:
43
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
44
- Accept:
45
- - ! '*/*'
46
- response:
47
- status:
48
- code: 200
49
- message: OK
50
- headers:
51
- Content-Type:
52
- - text/javascript; charset=UTF-8
53
- Content-Length:
54
- - '6006'
55
- Server:
56
- - Jetty(6.1.26)
57
- body:
58
- encoding: US-ASCII
59
- string: ! '{ "listnetworkofferingsresponse" : { "count":4 ,"networkoffering"
60
- : [ {"id":"fa126319-f822-4786-9cd3-30bd0c55ca94","name":"DefaultIsolatedNetworkOfferingWithSourceNatService","displaytext":"Offering
61
- for Isolated networks with Source Nat service enabled","traffictype":"Guest","isdefault":true,"specifyvlan":false,"conservemode":true,"specifyipranges":false,"availability":"Required","networkrate":200,"state":"Enabled","guestiptype":"Isolated","serviceofferingid":"983410fa-b51b-439c-b8ba-be973804c38f","service":[{"name":"SourceNat","provider":[{"name":"VirtualRouter"}],"capability":[{"name":"SupportedSourceNatTypes","value":"peraccount","canchooseservicecapability":false},{"name":"RedundantRouter","value":"false","canchooseservicecapability":false}]},{"name":"Dns","provider":[{"name":"VirtualRouter"}]},{"name":"UserData","provider":[{"name":"VirtualRouter"}]},{"name":"PortForwarding","provider":[{"name":"VirtualRouter"}]},{"name":"Firewall","provider":[{"name":"VirtualRouter"}]},{"name":"Lb","provider":[{"name":"VirtualRouter"}],"capability":[{"name":"SupportedLBIsolation","value":"dedicated","canchooseservicecapability":false},{"name":"ElasticLb","value":"false","canchooseservicecapability":false},{"name":"InlineMode","value":"false","canchooseservicecapability":false}]},{"name":"Dhcp","provider":[{"name":"VirtualRouter"}]},{"name":"Vpn","provider":[{"name":"VirtualRouter"}]},{"name":"StaticNat","provider":[{"name":"VirtualRouter"}],"capability":[{"name":"ElasticIp","value":"false","canchooseservicecapability":false},{"name":"AssociatePublicIP","value":"true","canchooseservicecapability":false}]}],"forvpc":false,"ispersistent":false,"egressdefaultpolicy":false},
62
- {"id":"7e70b3b5-5e2c-42cb-9b49-93a87c13a675","name":"DefaultIsolatedNetworkOfferingForVpcNetworks","displaytext":"Offering
63
- for Isolated Vpc networks with Source Nat service enabled","traffictype":"Guest","isdefault":true,"specifyvlan":false,"conservemode":false,"specifyipranges":false,"availability":"Optional","networkrate":200,"state":"Enabled","guestiptype":"Isolated","serviceofferingid":"983410fa-b51b-439c-b8ba-be973804c38f","service":[{"name":"SourceNat","provider":[{"name":"VpcVirtualRouter"}],"capability":[{"name":"SupportedSourceNatTypes","value":"peraccount","canchooseservicecapability":false},{"name":"RedundantRouter","value":"false","canchooseservicecapability":false}]},{"name":"Dns","provider":[{"name":"VpcVirtualRouter"}]},{"name":"UserData","provider":[{"name":"VpcVirtualRouter"}]},{"name":"PortForwarding","provider":[{"name":"VpcVirtualRouter"}]},{"name":"Lb","provider":[{"name":"VpcVirtualRouter"}],"capability":[{"name":"SupportedLBIsolation","value":"dedicated","canchooseservicecapability":false},{"name":"ElasticLb","value":"false","canchooseservicecapability":false},{"name":"InlineMode","value":"false","canchooseservicecapability":false}]},{"name":"Dhcp","provider":[{"name":"VpcVirtualRouter"}]},{"name":"Vpn","provider":[{"name":"VpcVirtualRouter"}]},{"name":"StaticNat","provider":[{"name":"VpcVirtualRouter"}],"capability":[{"name":"ElasticIp","value":"false","canchooseservicecapability":false},{"name":"AssociatePublicIP","value":"true","canchooseservicecapability":false}]},{"name":"NetworkACL","provider":[{"name":"VpcVirtualRouter"}]}],"forvpc":true,"ispersistent":false,"egressdefaultpolicy":false},
64
- {"id":"a9d78d52-f306-44c5-bb6d-c121a507db05","name":"DefaultIsolatedNetworkOfferingForVpcNetworksNoLB","displaytext":"Offering
65
- for Isolated Vpc networks with Source Nat service enabled and LB service Disabled","traffictype":"Guest","isdefault":true,"specifyvlan":false,"conservemode":false,"specifyipranges":false,"availability":"Optional","networkrate":200,"state":"Enabled","guestiptype":"Isolated","serviceofferingid":"983410fa-b51b-439c-b8ba-be973804c38f","service":[{"name":"SourceNat","provider":[{"name":"VpcVirtualRouter"}],"capability":[{"name":"SupportedSourceNatTypes","value":"peraccount","canchooseservicecapability":false},{"name":"RedundantRouter","value":"false","canchooseservicecapability":false}]},{"name":"Dns","provider":[{"name":"VpcVirtualRouter"}]},{"name":"UserData","provider":[{"name":"VpcVirtualRouter"}]},{"name":"PortForwarding","provider":[{"name":"VpcVirtualRouter"}]},{"name":"Dhcp","provider":[{"name":"VpcVirtualRouter"}]},{"name":"Vpn","provider":[{"name":"VpcVirtualRouter"}]},{"name":"StaticNat","provider":[{"name":"VpcVirtualRouter"}],"capability":[{"name":"ElasticIp","value":"false","canchooseservicecapability":false},{"name":"AssociatePublicIP","value":"true","canchooseservicecapability":false}]},{"name":"NetworkACL","provider":[{"name":"VpcVirtualRouter"}]}],"forvpc":true,"ispersistent":false,"egressdefaultpolicy":false},
66
- {"id":"f9a7b0d0-ce61-4f8d-a360-be1040d67287","name":"DefaultIsolatedNetworkOfferingForVpcNetworksWithInternalLB","displaytext":"Offering
67
- for Isolated Vpc networks with Internal LB support","traffictype":"Guest","isdefault":true,"specifyvlan":false,"conservemode":false,"specifyipranges":false,"availability":"Optional","networkrate":200,"state":"Enabled","guestiptype":"Isolated","serviceofferingid":"983410fa-b51b-439c-b8ba-be973804c38f","service":[{"name":"SourceNat","provider":[{"name":"VpcVirtualRouter"}],"capability":[{"name":"SupportedSourceNatTypes","value":"peraccount","canchooseservicecapability":false},{"name":"RedundantRouter","value":"false","canchooseservicecapability":false}]},{"name":"Dns","provider":[{"name":"VpcVirtualRouter"}]},{"name":"UserData","provider":[{"name":"VpcVirtualRouter"}]},{"name":"Lb","provider":[{"name":"InternalLbVm"}],"capability":[{"name":"SupportedLBIsolation","value":"dedicated","canchooseservicecapability":false},{"name":"ElasticLb","value":"false","canchooseservicecapability":false},{"name":"InlineMode","value":"false","canchooseservicecapability":false}]},{"name":"Dhcp","provider":[{"name":"VpcVirtualRouter"}]},{"name":"NetworkACL","provider":[{"name":"VpcVirtualRouter"}]}],"forvpc":true,"ispersistent":false,"egressdefaultpolicy":false}
68
- ] } }'
69
- http_version:
70
- recorded_at: Wed, 18 Dec 2013 21:25:06 GMT
71
- - request:
72
- method: get
73
- uri: <CLOUD_STACK_URL>?apiKey=<CLOUD_STACK_API_KEY>&command=createNetwork&displaytext=John&name=John&networkOfferingId=fa126319-f822-4786-9cd3-30bd0c55ca94&response=json&signature=UDcfFqlzwpHJib/9kLKzR0%2BCbyc=&zoneId=39e9e31e-925c-4b55-8d33-f99912b73dfc
74
- body:
75
- encoding: US-ASCII
76
- string: ''
77
- headers:
78
- User-Agent:
79
- - Faraday v0.8.8
80
- Accept-Encoding:
81
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
82
- Accept:
83
- - ! '*/*'
84
- response:
85
- status:
86
- code: 200
87
- message: OK
88
- headers:
89
- Content-Type:
90
- - text/javascript; charset=UTF-8
91
- Content-Length:
92
- - '4441'
93
- Server:
94
- - Jetty(6.1.26)
95
- body:
96
- encoding: US-ASCII
97
- string: ! '{ "createnetworkresponse" : { "network" : {"id":"02e5fd84-e9ea-49f7-ba6a-6d63ea23a27f","name":"John","displaytext":"John","broadcastdomaintype":"Vlan","traffictype":"Guest","gateway":"10.1.1.1","netmask":"255.255.255.0","cidr":"10.1.1.0/24","zoneid":"39e9e31e-925c-4b55-8d33-f99912b73dfc","zonename":"Sandbox-simulator","networkofferingid":"fa126319-f822-4786-9cd3-30bd0c55ca94","networkofferingname":"DefaultIsolatedNetworkOfferingWithSourceNatService","networkofferingdisplaytext":"Offering
98
- for Isolated networks with Source Nat service enabled","networkofferingconservemode":true,"networkofferingavailability":"Required","issystem":false,"state":"Allocated","related":"02e5fd84-e9ea-49f7-ba6a-6d63ea23a27f","dns1":"10.147.28.6","type":"Isolated","acltype":"Account","account":"admin","domainid":"ce4585b8-41f5-11e3-aaa7-d6558ad1fb9f","domain":"ROOT","service":[{"name":"SourceNat","capability":[{"name":"SupportedSourceNatTypes","value":"peraccount","canchooseservicecapability":false},{"name":"RedundantRouter","value":"true","canchooseservicecapability":false}]},{"name":"Dns","capability":[{"name":"AllowDnsSuffixModification","value":"true","canchooseservicecapability":false}]},{"name":"UserData"},{"name":"PortForwarding"},{"name":"Firewall","capability":[{"name":"TrafficStatistics","value":"per
99
- public ip","canchooseservicecapability":false},{"name":"SupportedTrafficDirection","value":"ingress,
100
- egress","canchooseservicecapability":false},{"name":"SupportedProtocols","value":"tcp,udp,icmp","canchooseservicecapability":false},{"name":"MultipleIps","value":"true","canchooseservicecapability":false},{"name":"SupportedEgressProtocols","value":"tcp,udp,icmp,
101
- all","canchooseservicecapability":false}]},{"name":"Lb","capability":[{"name":"SupportedLbAlgorithms","value":"roundrobin,leastconn,source","canchooseservicecapability":false},{"name":"LbSchemes","value":"Public","canchooseservicecapability":false},{"name":"SupportedStickinessMethods","value":"[{\"methodname\":\"LbCookie\",\"paramlist\":[{\"paramname\":\"cookie-name\",\"required\":false,\"isflag\":false,\"description\":\"
102
- \"},{\"paramname\":\"mode\",\"required\":false,\"isflag\":false,\"description\":\"
103
- \"},{\"paramname\":\"nocache\",\"required\":false,\"isflag\":true,\"description\":\"
104
- \"},{\"paramname\":\"indirect\",\"required\":false,\"isflag\":true,\"description\":\"
105
- \"},{\"paramname\":\"postonly\",\"required\":false,\"isflag\":true,\"description\":\"
106
- \"},{\"paramname\":\"domain\",\"required\":false,\"isflag\":false,\"description\":\"
107
- \"}],\"description\":\"This is loadbalancer cookie based stickiness method.\"},{\"methodname\":\"AppCookie\",\"paramlist\":[{\"paramname\":\"cookie-name\",\"required\":false,\"isflag\":false,\"description\":\"
108
- \"},{\"paramname\":\"length\",\"required\":false,\"isflag\":false,\"description\":\"
109
- \"},{\"paramname\":\"holdtime\",\"required\":false,\"isflag\":false,\"description\":\"
110
- \"},{\"paramname\":\"request-learn\",\"required\":false,\"isflag\":true,\"description\":\"
111
- \"},{\"paramname\":\"prefix\",\"required\":false,\"isflag\":true,\"description\":\"
112
- \"},{\"paramname\":\"mode\",\"required\":false,\"isflag\":false,\"description\":\"
113
- \"}],\"description\":\"This is App session based sticky method. Define session
114
- stickiness on an existing application cookie. It can be used only for a specific
115
- http traffic\"},{\"methodname\":\"SourceBased\",\"paramlist\":[{\"paramname\":\"tablesize\",\"required\":false,\"isflag\":false,\"description\":\"
116
- \"},{\"paramname\":\"expire\",\"required\":false,\"isflag\":false,\"description\":\"
117
- \"}],\"description\":\"This is source based Stickiness method, it can be used
118
- for any type of protocol.\"}]","canchooseservicecapability":false},{"name":"SupportedProtocols","value":"tcp,
119
- udp","canchooseservicecapability":false},{"name":"SupportedLBIsolation","value":"dedicated","canchooseservicecapability":false}]},{"name":"Dhcp","capability":[{"name":"DhcpAccrossMultipleSubnets","value":"true","canchooseservicecapability":false}]},{"name":"Vpn","capability":[{"name":"SupportedVpnTypes","value":"pptp,l2tp,ipsec","canchooseservicecapability":false},{"name":"VpnTypes","value":"removeaccessvpn","canchooseservicecapability":false}]},{"name":"StaticNat"}],"networkdomain":"cs2sandbox.simulator","physicalnetworkid":"46d08659-81e9-4f31-a589-a15aca972af0","restartrequired":false,"specifyipranges":false,"canusefordeploy":true,"ispersistent":false,"tags":[],"displaynetwork":true}
120
- } }'
121
- http_version:
122
- recorded_at: Wed, 18 Dec 2013 21:25:06 GMT
123
- - request:
124
- method: get
125
- uri: <CLOUD_STACK_URL>?apiKey=<CLOUD_STACK_API_KEY>&command=createTags&resourceIds=02e5fd84-e9ea-49f7-ba6a-6d63ea23a27f&resourceType=Network&response=json&signature=KnWoymoA3Q34Iz%2BZ9iFEc8R0lEo=&tags%5B0%5D%5B.key%5D=speed&tags%5B0%5D%5B.name%5D=speed&tags%5B0%5D%5B.value%5D=fast
126
- body:
127
- encoding: US-ASCII
128
- string: ''
129
- headers:
130
- User-Agent:
131
- - Faraday v0.8.8
132
- Accept-Encoding:
133
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
134
- Accept:
135
- - ! '*/*'
136
- response:
137
- status:
138
- code: 200
139
- message: OK
140
- headers:
141
- Content-Type:
142
- - text/javascript; charset=UTF-8
143
- Content-Length:
144
- - '75'
145
- Server:
146
- - Jetty(6.1.26)
147
- body:
148
- encoding: US-ASCII
149
- string: ! '{ "createtagsresponse" : {"jobid":"90bdb3e9-dcd5-4aac-9aa9-1879863082cc"}
150
- }'
151
- http_version:
152
- recorded_at: Wed, 18 Dec 2013 21:25:07 GMT
153
- recorded_with: VCR 2.8.0
@@ -1,55 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe StackerBee::Middleware::Logger do
4
- let(:app) { double }
5
- let(:io) { StringIO.new }
6
- let(:logger) { Logger.new(io) }
7
- let(:log_string) { io.string }
8
- let(:middleware) { described_class.new app, logger }
9
- subject { middleware }
10
-
11
- context "with a no logger specified" do
12
- let(:middleware) { described_class.new app, nil }
13
- its(:logger) { should be_a Logger }
14
- end
15
-
16
- describe "logging request" do
17
- let(:env) do
18
- {
19
- method: "PATCH",
20
- url: "http://localhost",
21
- request_headers: { "User-Agent" => "RSpec" }
22
- }
23
- end
24
- before do
25
- middleware.log_request(env)
26
- end
27
- subject { log_string }
28
- it { should include "PATCH" }
29
- it { should include "localhost" }
30
- it { should include "User-Agent" }
31
- end
32
-
33
- describe "logging a response" do
34
- let(:status) { 200 }
35
- let(:env) do
36
- {
37
- status: status,
38
- body: "OK",
39
- response_headers: { "Server" => "RSpec" }
40
- }
41
- end
42
- before do
43
- middleware.log_response(env)
44
- end
45
- subject { log_string }
46
- it { should =~ /INFO.*#{status}/ }
47
- it { should include "OK" }
48
- it { should include "Server" }
49
-
50
- context "failing status" do
51
- let(:status) { 401 }
52
- it { should =~ /ERROR.*#{status}/ }
53
- end
54
- end
55
- end