rest_connection 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/lib/rest_connection.rb +3 -2
- data/lib/rest_connection/version.rb +1 -1
- metadata +108 -157
data/CHANGELOG.md
ADDED
data/lib/rest_connection.rb
CHANGED
@@ -104,6 +104,7 @@ module RestConnection
|
|
104
104
|
def rest_connect(&block)
|
105
105
|
uri = URI.parse(@settings[:api_href])
|
106
106
|
http = Net::HTTP.new(uri.host, uri.port)
|
107
|
+
http.read_timeout = 300
|
107
108
|
if uri.scheme == 'https'
|
108
109
|
http.use_ssl = true
|
109
110
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
@@ -133,13 +134,13 @@ module RestConnection
|
|
133
134
|
def error_handler(e)
|
134
135
|
case e
|
135
136
|
when EOFError, Timeout::Error
|
136
|
-
if @max_retries
|
137
|
+
if @max_retries > 0
|
137
138
|
logger("Caught #{e}. Retrying...")
|
138
139
|
@max_retries -= 1
|
139
140
|
return true
|
140
141
|
end
|
141
142
|
when RestConnection::Errors::Forbidden
|
142
|
-
if @max_retries
|
143
|
+
if @max_retries > 0
|
143
144
|
if e.response.body =~ /(session|cookie).*(invalid|expired)/i
|
144
145
|
logger("Caught '#{e.response.body}'. Refreshing cookie...")
|
145
146
|
refresh_cookie if respond_to?(:refresh_cookie)
|
metadata
CHANGED
@@ -1,184 +1,137 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_connection
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.16
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 15
|
10
|
-
version: 1.0.15
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- RightScale, Inc.
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
requirement: &
|
12
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: net-ssh
|
16
|
+
requirement: &17311140 !ruby/object:Gem::Requirement
|
22
17
|
none: false
|
23
|
-
requirements:
|
24
|
-
- -
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
30
22
|
type: :runtime
|
31
|
-
name: net-ssh
|
32
|
-
version_requirements: *id001
|
33
23
|
prerelease: false
|
34
|
-
|
35
|
-
|
24
|
+
version_requirements: *17311140
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: json
|
27
|
+
requirement: &17310620 !ruby/object:Gem::Requirement
|
36
28
|
none: false
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
segments:
|
42
|
-
- 0
|
43
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
44
33
|
type: :runtime
|
45
|
-
name: json
|
46
|
-
version_requirements: *id002
|
47
34
|
prerelease: false
|
48
|
-
|
49
|
-
|
35
|
+
version_requirements: *17310620
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: highline
|
38
|
+
requirement: &17310120 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
segments:
|
56
|
-
- 0
|
57
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
58
44
|
type: :runtime
|
59
|
-
name: highline
|
60
|
-
version_requirements: *id003
|
61
45
|
prerelease: false
|
62
|
-
|
63
|
-
|
46
|
+
version_requirements: *17310120
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rest-client
|
49
|
+
requirement: &17309680 !ruby/object:Gem::Requirement
|
64
50
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
segments:
|
70
|
-
- 0
|
71
|
-
version: "0"
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
72
55
|
type: :runtime
|
73
|
-
name: rest-client
|
74
|
-
version_requirements: *id004
|
75
56
|
prerelease: false
|
76
|
-
|
77
|
-
|
57
|
+
version_requirements: *17309680
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rake
|
60
|
+
requirement: &17309040 !ruby/object:Gem::Requirement
|
78
61
|
none: false
|
79
|
-
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
hash: 49
|
83
|
-
segments:
|
84
|
-
- 0
|
85
|
-
- 8
|
86
|
-
- 7
|
62
|
+
requirements:
|
63
|
+
- - =
|
64
|
+
- !ruby/object:Gem::Version
|
87
65
|
version: 0.8.7
|
88
66
|
type: :development
|
89
|
-
name: rake
|
90
|
-
version_requirements: *id005
|
91
67
|
prerelease: false
|
92
|
-
|
93
|
-
|
68
|
+
version_requirements: *17309040
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: &17308580 !ruby/object:Gem::Requirement
|
94
72
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
99
|
-
segments:
|
100
|
-
- 0
|
101
|
-
version: "0"
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
102
77
|
type: :development
|
103
|
-
name: bundler
|
104
|
-
version_requirements: *id006
|
105
78
|
prerelease: false
|
106
|
-
|
107
|
-
|
79
|
+
version_requirements: *17308580
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rspec
|
82
|
+
requirement: &17307940 !ruby/object:Gem::Requirement
|
108
83
|
none: false
|
109
|
-
requirements:
|
110
|
-
- -
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
hash: 27
|
113
|
-
segments:
|
114
|
-
- 1
|
115
|
-
- 3
|
116
|
-
- 0
|
84
|
+
requirements:
|
85
|
+
- - =
|
86
|
+
- !ruby/object:Gem::Version
|
117
87
|
version: 1.3.0
|
118
88
|
type: :development
|
119
|
-
name: rspec
|
120
|
-
version_requirements: *id007
|
121
89
|
prerelease: false
|
122
|
-
|
123
|
-
|
90
|
+
version_requirements: *17307940
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: activesupport
|
93
|
+
requirement: &17307480 !ruby/object:Gem::Requirement
|
124
94
|
none: false
|
125
|
-
requirements:
|
126
|
-
- -
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
|
129
|
-
segments:
|
130
|
-
- 1
|
131
|
-
- 6
|
132
|
-
- 0
|
133
|
-
version: 1.6.0
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
134
99
|
type: :runtime
|
135
|
-
name: nokogiri
|
136
|
-
version_requirements: *id008
|
137
100
|
prerelease: false
|
138
|
-
|
139
|
-
|
101
|
+
version_requirements: *17307480
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: nokogiri
|
104
|
+
requirement: &17306960 !ruby/object:Gem::Requirement
|
140
105
|
none: false
|
141
|
-
requirements:
|
142
|
-
- -
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
|
145
|
-
segments:
|
146
|
-
- 4
|
147
|
-
- 0
|
148
|
-
- 0
|
149
|
-
version: 4.0.0
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
150
110
|
type: :runtime
|
151
|
-
name: activesupport
|
152
|
-
version_requirements: *id009
|
153
111
|
prerelease: false
|
154
|
-
|
155
|
-
|
112
|
+
version_requirements: *17306960
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: ruby-debug19
|
115
|
+
requirement: &17306480 !ruby/object:Gem::Requirement
|
156
116
|
none: false
|
157
|
-
requirements:
|
158
|
-
- -
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
|
161
|
-
segments:
|
162
|
-
- 0
|
163
|
-
version: "0"
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
164
121
|
type: :development
|
165
|
-
name: ruby-debug
|
166
|
-
version_requirements: *id010
|
167
122
|
prerelease: false
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
email:
|
123
|
+
version_requirements: *17306480
|
124
|
+
description: ! "\nThis gem is deprecated! Please use right_api_client instead.\nThe
|
125
|
+
rest_connection gem simplifies the use of RESTful APIs.\nIt currently has support
|
126
|
+
for RightScale API 1.0 and 1.5.\n "
|
127
|
+
email:
|
173
128
|
- rubygems@rightscale.com
|
174
129
|
executables: []
|
175
|
-
|
176
130
|
extensions: []
|
177
|
-
|
178
131
|
extra_rdoc_files: []
|
179
|
-
|
180
|
-
files:
|
132
|
+
files:
|
181
133
|
- .gitignore
|
134
|
+
- CHANGELOG.md
|
182
135
|
- Gemfile
|
183
136
|
- README.md
|
184
137
|
- Rakefile
|
@@ -286,39 +239,37 @@ files:
|
|
286
239
|
- spec/spec_helper.rb
|
287
240
|
- spec/tag_spec.rb
|
288
241
|
homepage: https://github.com/rightscale/rest_connection
|
289
|
-
licenses:
|
242
|
+
licenses:
|
290
243
|
- MIT
|
291
244
|
post_install_message:
|
292
245
|
rdoc_options: []
|
293
|
-
|
294
|
-
require_paths:
|
246
|
+
require_paths:
|
295
247
|
- lib
|
296
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
248
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
297
249
|
none: false
|
298
|
-
requirements:
|
299
|
-
- -
|
300
|
-
- !ruby/object:Gem::Version
|
301
|
-
|
302
|
-
segments:
|
250
|
+
requirements:
|
251
|
+
- - ! '>='
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: '0'
|
254
|
+
segments:
|
303
255
|
- 0
|
304
|
-
|
305
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
256
|
+
hash: 1156946434580208479
|
257
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
306
258
|
none: false
|
307
|
-
requirements:
|
308
|
-
- -
|
309
|
-
- !ruby/object:Gem::Version
|
310
|
-
|
311
|
-
segments:
|
259
|
+
requirements:
|
260
|
+
- - ! '>='
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: '0'
|
263
|
+
segments:
|
312
264
|
- 0
|
313
|
-
|
265
|
+
hash: 1156946434580208479
|
314
266
|
requirements: []
|
315
|
-
|
316
267
|
rubyforge_project:
|
317
|
-
rubygems_version: 1.8.
|
268
|
+
rubygems_version: 1.8.11
|
318
269
|
signing_key:
|
319
270
|
specification_version: 3
|
320
271
|
summary: A Modular RESTful API library.
|
321
|
-
test_files:
|
272
|
+
test_files:
|
322
273
|
- config/rest_api_config.yaml.sample
|
323
274
|
- spec/ec2_server_array_spec.rb
|
324
275
|
- spec/ec2_ssh_key_internal_spec.rb
|