arborist-webservice 0.0.1.pre20161005112659 → 0.0.1.pre20180815100446
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +34 -1
- data/Manifest.txt +3 -0
- data/README.md +6 -6
- data/Rakefile +1 -1
- data/lib/arborist/monitor/webservice.rb +122 -85
- data/lib/arborist/node/webservice.rb +84 -17
- data/lib/arborist/webservice.rb +3 -1
- data/spec/arborist/node/webservice_spec.rb +11 -1
- metadata +30 -30
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1006dfaf9b120fa2720a2637603c4f75397cbe36d62f2039c35d4a1f8c39b56
|
4
|
+
data.tar.gz: 46b34fd363f89a60bcfa7cdafceeec8d2a68c00e9e0b79d2c5126b9fc4b47137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d5b067c522b37beb004f549c98fba58ba7e64806a79baa05be708344ef9cc6801d982ec083bedfacbed75f6e30eb5fa4ef09ebf0b744f88272d032f1ea2dc9a
|
7
|
+
data.tar.gz: 49457c9714ce9c128be66eb3e04a9f7bc280ebbf4c0359e2d3719e73415eb21ce62189eb07ff68e095f876f5b8b2dadf996b46dedf230d3084baa0aa4bf5d299
|
data/ChangeLog
CHANGED
@@ -1,3 +1,36 @@
|
|
1
|
+
2018-08-15 Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
* .gems, Rakefile, lib/arborist/monitor/webservice.rb,
|
4
|
+
lib/arborist/node/webservice.rb, lib/arborist/webservice.rb,
|
5
|
+
lib/arborist/webservice/connection.rb,
|
6
|
+
lib/arborist/webservice/constants.rb,
|
7
|
+
lib/arborist/webservice/monkeypatches.rb:
|
8
|
+
Checkpoint commit before switching to Typhoeus
|
9
|
+
[d2e9ed791434] [tip]
|
10
|
+
|
11
|
+
2018-08-01 Mahlon E. Smith <mahlon@martini.nu>
|
12
|
+
|
13
|
+
* .ruby-version, lib/arborist/node/webservice.rb:
|
14
|
+
Keep the URI as a string when serializing.
|
15
|
+
[04839f2b49b5]
|
16
|
+
|
17
|
+
2017-12-29 Michael Granger <ged@FaerieMUD.org>
|
18
|
+
|
19
|
+
* README.md:
|
20
|
+
Fix incorrect URLs in the README
|
21
|
+
[7bdc40158b25] [github/master]
|
22
|
+
|
23
|
+
* .gems, .pryrc, .ruby-gemset, .ruby-version, .rvm.gems, .rvmrc,
|
24
|
+
ChangeLog, History.md, LICENSE.txt, Manifest.txt, README.md,
|
25
|
+
Rakefile, arborist-webservice.gemspec, certs/ged.pem,
|
26
|
+
lib/arborist/monitor/webservice.rb, lib/arborist/node/webservice.rb,
|
27
|
+
lib/arborist/webservice.rb,
|
28
|
+
lib/arborist/webservice/monkeypatches.rb,
|
29
|
+
spec/arborist/monitor/webservice_spec.rb,
|
30
|
+
spec/arborist/webservice_spec.rb, spec/spec_helper.rb:
|
31
|
+
Finished up initial implementation
|
32
|
+
[dd3e9ea1e09f]
|
33
|
+
|
1
34
|
2016-02-08 Michael Granger <ged@FaerieMUD.org>
|
2
35
|
|
3
36
|
* .document, .editorconfig, .hgignore, .pryrc, .rdoc_options,
|
@@ -5,4 +38,4 @@
|
|
5
38
|
certs/ged.pem, lib/arborist/node/webservice.rb,
|
6
39
|
spec/arborist/node/webservice_spec.rb, spec/spec_helper.rb:
|
7
40
|
Initial commit.
|
8
|
-
[d318b4f0d795]
|
41
|
+
[d318b4f0d795]
|
data/Manifest.txt
CHANGED
@@ -10,5 +10,8 @@ Rakefile
|
|
10
10
|
lib/arborist/monitor/webservice.rb
|
11
11
|
lib/arborist/node/webservice.rb
|
12
12
|
lib/arborist/webservice.rb
|
13
|
+
lib/arborist/webservice/constants.rb
|
14
|
+
spec/arborist/monitor/webservice_spec.rb
|
13
15
|
spec/arborist/node/webservice_spec.rb
|
16
|
+
spec/arborist/webservice_spec.rb
|
14
17
|
spec/spec_helper.rb
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# Arborist-Webservices
|
2
2
|
|
3
3
|
home
|
4
|
-
: http://bitbucket.org/ged/Arborist-
|
4
|
+
: http://bitbucket.org/ged/Arborist-Webservice
|
5
5
|
|
6
6
|
github
|
7
|
-
: https://github.com/ged/arborist-
|
7
|
+
: https://github.com/ged/arborist-webservice
|
8
8
|
|
9
9
|
docs
|
10
|
-
: http://deveiate.org/code/arborist-
|
10
|
+
: http://deveiate.org/code/arborist-webservice
|
11
11
|
|
12
12
|
|
13
13
|
## Description
|
@@ -50,14 +50,14 @@ This would check that an OPTIONS HTTP request to `http://api.example.com/v1/hear
|
|
50
50
|
|
51
51
|
## Installation
|
52
52
|
|
53
|
-
$ gem install arborist-
|
53
|
+
$ gem install arborist-webservice
|
54
54
|
|
55
55
|
|
56
56
|
## Contributing
|
57
57
|
|
58
58
|
You can check out the current development source with Mercurial via its
|
59
|
-
{project page}[http://bitbucket.org/ged/arborist-
|
60
|
-
{its Github mirror}[https://github.com/ged/arborist-
|
59
|
+
{project page}[http://bitbucket.org/ged/arborist-webservice]. Or if you prefer Git, via
|
60
|
+
{its Github mirror}[https://github.com/ged/arborist-webservice].
|
61
61
|
|
62
62
|
After checking out the source, run:
|
63
63
|
|
data/Rakefile
CHANGED
@@ -31,7 +31,7 @@ hoespec = Hoe.spec 'arborist-webservice' do |spec|
|
|
31
31
|
|
32
32
|
spec.dependency 'arborist', '~> 0'
|
33
33
|
spec.dependency 'loggability', '~> 0.11'
|
34
|
-
spec.dependency '
|
34
|
+
spec.dependency 'typhoeus', '~> 1.3'
|
35
35
|
|
36
36
|
spec.dependency 'hoe-deveiate', '~> 0.3', :developer
|
37
37
|
spec.dependency 'simplecov', '~> 0.7', :developer
|
@@ -1,25 +1,49 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
#encoding: utf-8
|
3
3
|
|
4
|
-
require '
|
5
|
-
require 'httpclient'
|
4
|
+
require 'typhoeus'
|
6
5
|
|
7
6
|
require 'arborist'
|
8
|
-
require 'arborist/webservice'
|
9
7
|
require 'arborist/mixins'
|
10
8
|
require 'arborist/monitor' unless defined?( Arborist::Monitor )
|
11
9
|
|
10
|
+
require 'arborist/webservice'
|
11
|
+
require 'arborist/webservice/constants'
|
12
|
+
|
13
|
+
|
14
|
+
using Arborist::TimeRefinements
|
15
|
+
|
12
16
|
|
13
17
|
# A web-service monitor type for Arborist
|
14
18
|
module Arborist::Monitor::Webservice
|
19
|
+
extend Configurability
|
20
|
+
|
21
|
+
|
22
|
+
configurability( 'arborist.monitors.webservice' ) do
|
23
|
+
|
24
|
+
##
|
25
|
+
# The default timeout employed by the socket monitors, in floating-point
|
26
|
+
# seconds.
|
27
|
+
setting :default_timeout, default: 2.0 do |val|
|
28
|
+
Float( val )
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# The maximum number of ongoing HTTP requests
|
33
|
+
setting :max_concurrency, default: 100 do |val|
|
34
|
+
Integer( val )
|
35
|
+
end
|
15
36
|
|
16
|
-
|
37
|
+
end
|
17
38
|
|
18
39
|
|
19
40
|
|
20
41
|
# Arborist HTML web service monitor logic
|
21
42
|
class HTML
|
22
43
|
extend Loggability
|
44
|
+
include Arborist::Webservice::Constants
|
45
|
+
|
46
|
+
|
23
47
|
log_to :arborist_webservice
|
24
48
|
|
25
49
|
|
@@ -28,6 +52,15 @@ module Arborist::Monitor::Webservice
|
|
28
52
|
timeout: 5.seconds
|
29
53
|
}
|
30
54
|
|
55
|
+
# The array of node properites used by this monitor
|
56
|
+
NODE_PROPERTIES = %i[ uri http_method body body_mimetype ].freeze
|
57
|
+
|
58
|
+
|
59
|
+
### Return an array of attributes to fetch from nodes for this monitor.
|
60
|
+
def self::node_properties
|
61
|
+
return NODE_PROPERTIES
|
62
|
+
end
|
63
|
+
|
31
64
|
|
32
65
|
### Instantiate a monitor check and run it for the specified +nodes+.
|
33
66
|
def self::run( nodes )
|
@@ -39,16 +72,8 @@ module Arborist::Monitor::Webservice
|
|
39
72
|
###
|
40
73
|
### +:timeout+
|
41
74
|
### Set the number of seconds to wait for a connection for each node.
|
42
|
-
def initialize(
|
43
|
-
|
44
|
-
|
45
|
-
options.each do |name, value|
|
46
|
-
self.public_send( "#{name}=", value )
|
47
|
-
end
|
48
|
-
|
49
|
-
agent = "%p/%s via %s" %
|
50
|
-
[ self.class, Arborist::Webservice::VERSION, HTTPClient::DEFAULT_AGENT_NAME ]
|
51
|
-
@client = HTTPClient.new( agent_name: agent )
|
75
|
+
def initialize( timeout: Arborist::Monitor::Webservice.default_timeout )
|
76
|
+
self.timeout = timeout
|
52
77
|
end
|
53
78
|
|
54
79
|
|
@@ -59,9 +84,6 @@ module Arborist::Monitor::Webservice
|
|
59
84
|
# The timeout for connecting, in seconds.
|
60
85
|
attr_accessor :timeout
|
61
86
|
|
62
|
-
# The HTTPClient object to use for HTTP
|
63
|
-
attr_accessor :client
|
64
|
-
|
65
87
|
|
66
88
|
### Return a clone of this object with its timeout set to +new_timeout+.
|
67
89
|
def with_timeout( new_timeout )
|
@@ -71,99 +93,114 @@ module Arborist::Monitor::Webservice
|
|
71
93
|
end
|
72
94
|
|
73
95
|
|
74
|
-
###
|
75
|
-
### updates for them based on trying to connect to them.
|
96
|
+
### Test HTTP connections for the specified +nodes+.
|
76
97
|
def run( nodes )
|
77
|
-
|
98
|
+
results = {}
|
99
|
+
hydra = Typhoeus::Hydra.new( self.runner_settings )
|
100
|
+
|
101
|
+
nodes.each do |identifier, node|
|
102
|
+
self.log.debug "Making request for node %s" % [ identifier ]
|
103
|
+
request = self.request_for_node( node )
|
104
|
+
request.on_complete do |response|
|
105
|
+
self.log.debug "Handling response for %s" % [ identifier ]
|
106
|
+
results[ identifier ] = self.make_response_results( response )
|
107
|
+
end
|
108
|
+
hydra.queue( request )
|
109
|
+
end
|
78
110
|
|
79
|
-
|
80
|
-
|
111
|
+
hydra.run
|
112
|
+
|
113
|
+
return results
|
81
114
|
end
|
82
115
|
|
83
116
|
|
84
|
-
###
|
85
|
-
|
86
|
-
|
87
|
-
|
117
|
+
### Return a request object built to test the specified webservice +node+.
|
118
|
+
def request_for_node( node_data )
|
119
|
+
options = {
|
120
|
+
method: node_data['http_method'] || DEFAULT_HTTP_METHOD,
|
121
|
+
http_version: node_data['http_version'] || DEFAULT_HTTP_VERSION,
|
122
|
+
headers: self.make_headers_hash( node_data ),
|
123
|
+
body: node_data['body'],
|
124
|
+
timeout: self.timeout,
|
125
|
+
connecttimeout: self.timeout / 2.0,
|
126
|
+
}
|
88
127
|
|
89
|
-
|
90
|
-
|
91
|
-
conn = client.head_async( uri )
|
92
|
-
connections[ conn ] = identifier
|
128
|
+
if ssl_opts = self.make_ssl_options( node_data['uri'], node_data )
|
129
|
+
options.merge!( ssl_opts )
|
93
130
|
end
|
94
131
|
|
95
|
-
return
|
132
|
+
return Typhoeus::Request.new( node_data['uri'], options )
|
96
133
|
end
|
97
134
|
|
98
135
|
|
99
|
-
###
|
100
|
-
|
101
|
-
|
102
|
-
results = {}
|
103
|
-
start = Time.now
|
104
|
-
timeout_at = Time.now + self.timeout
|
105
|
-
|
106
|
-
until connections.empty? || timeout_at.past?
|
107
|
-
responses = self.handle_connection_responses( connections )
|
108
|
-
results.merge!( responses )
|
109
|
-
end
|
136
|
+
### Make a Hash of SSL options if any are specified.
|
137
|
+
def make_ssl_options( uri, node_data )
|
138
|
+
return nil unless uri.start_with?( 'https:' )
|
110
139
|
|
111
|
-
|
112
|
-
|
113
|
-
errors = self.timeout_connections( connections )
|
114
|
-
results.merge!( errors )
|
140
|
+
ssl_attributes = SSL_ATTRIBUTES.each_with_object({}) do |(key, ssl_key), opts|
|
141
|
+
opts[ ssl_key ] = node_data[ key.to_s ] if node_data.key?( key.to_s )
|
115
142
|
end
|
116
143
|
|
117
|
-
return
|
144
|
+
return ssl_attributes
|
118
145
|
end
|
119
146
|
|
120
147
|
|
121
|
-
###
|
122
|
-
###
|
123
|
-
def
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
next unless conn.finished?
|
129
|
-
|
130
|
-
identifier = connections.delete( conn )
|
131
|
-
message = conn.pop
|
132
|
-
|
133
|
-
if message.ok?
|
134
|
-
results[ identifier ] = {
|
135
|
-
status: message.status_code,
|
136
|
-
http_version: message.http_version,
|
137
|
-
}
|
138
|
-
else
|
139
|
-
results[ identifier ] = {
|
140
|
-
error: "#{message.status_code} response",
|
141
|
-
status: message.status_code,
|
142
|
-
http_version: message.http_version,
|
143
|
-
}
|
144
|
-
end
|
145
|
-
rescue => err
|
146
|
-
identifier ||= connections.delete( conn ) or
|
147
|
-
raise "Couldn't find identifier for connection %p" % [ conn ]
|
148
|
-
results[ identifier ] = { error: err.message }
|
149
|
-
end
|
148
|
+
### Extract header values from the node_data, combine them with the defaults,
|
149
|
+
### and return them as a Hash.
|
150
|
+
def make_headers_hash( node_data )
|
151
|
+
headers = DEFAULT_HTTP_HEADERS.merge( node_data['http_headers'] || {} )
|
152
|
+
if node_data['body']
|
153
|
+
headers[ 'Content-type' ] ||= node_data['body_mimetype'] ||
|
154
|
+
'application/x-www-form-urlencoded'
|
150
155
|
end
|
151
156
|
|
152
|
-
return
|
157
|
+
return headers
|
153
158
|
end
|
154
159
|
|
155
160
|
|
156
|
-
###
|
157
|
-
def
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
161
|
+
### Return a Hash of options to pass to the request runner.
|
162
|
+
def runner_settings
|
163
|
+
return {
|
164
|
+
max_concurrency: Arborist::Monitor::Webservice.max_concurrency,
|
165
|
+
}
|
166
|
+
end
|
167
|
+
|
168
|
+
|
169
|
+
### Return a Hash of results appropriate for the specified +response+.
|
170
|
+
def make_response_results( response )
|
171
|
+
if response.success?
|
172
|
+
return { webservice: self.success_results(response) }
|
173
|
+
elsif response.timed_out?
|
174
|
+
self.log.error "Request timed out."
|
175
|
+
return { error: 'Request timed out.' }
|
176
|
+
elsif response.code == 0
|
177
|
+
self.log.error "Non-HTTP response: %s." % [ response.return_code ]
|
178
|
+
return { error: response.return_code }
|
179
|
+
else
|
180
|
+
self.log.error "Got a %03d %s response." % [ response.code, response.status_message ]
|
181
|
+
return {
|
182
|
+
error: "%03d %s" % [ response.code, response.status_message ]
|
163
183
|
}
|
164
184
|
end
|
185
|
+
end
|
165
186
|
|
166
|
-
|
187
|
+
|
188
|
+
### Return the information hash attached to webservice nodes for successful
|
189
|
+
### responses.
|
190
|
+
def success_results( response )
|
191
|
+
return {
|
192
|
+
status: response.code,
|
193
|
+
status_message: response.status_message,
|
194
|
+
headers: response.headers_hash,
|
195
|
+
appconnect_time: response.appconnect_time,
|
196
|
+
connect_time: response.connect_time,
|
197
|
+
lookup_time: response.name_lookup_time,
|
198
|
+
pretransfer_time: response.pretransfer_time,
|
199
|
+
redirect_count: response.redirect_count,
|
200
|
+
redirect_time: response.redirect_time,
|
201
|
+
start_transfer_time: response.start_transfer_time,
|
202
|
+
total_time: response.total_time,
|
203
|
+
}
|
167
204
|
end
|
168
205
|
|
169
206
|
end # class HTML
|
@@ -4,13 +4,16 @@
|
|
4
4
|
require 'loggability'
|
5
5
|
|
6
6
|
require 'arborist'
|
7
|
-
require 'arborist/webservice'
|
8
7
|
require 'arborist/node/service' unless defined?( Arborist::Node::Service )
|
9
8
|
|
9
|
+
require 'arborist/webservice'
|
10
|
+
require 'arborist/webservice/constants'
|
11
|
+
|
10
12
|
|
11
13
|
# A web-service node type for Arborist
|
12
14
|
class Arborist::Node::Webservice < Arborist::Node::Service
|
13
15
|
extend Loggability
|
16
|
+
include Arborist::Webservice::Constants
|
14
17
|
|
15
18
|
|
16
19
|
# Loggability API -- use the logger for this library
|
@@ -22,18 +25,21 @@ class Arborist::Node::Webservice < Arborist::Node::Service
|
|
22
25
|
|
23
26
|
### Create a new Webservice node.
|
24
27
|
def initialize( identifier, host, uri, attributes={}, &block )
|
25
|
-
@uri =
|
28
|
+
@uri = uri
|
29
|
+
uri_obj = URI( uri )
|
26
30
|
|
27
|
-
attributes[:app_protocol] ||=
|
28
|
-
attributes[:port] ||=
|
31
|
+
attributes[:app_protocol] ||= uri_obj.scheme
|
32
|
+
attributes[:port] ||= uri_obj.port
|
29
33
|
attributes[:protocol] = 'tcp'
|
30
|
-
attributes[:
|
31
|
-
attributes[:
|
34
|
+
attributes[:app_protocol] = 'http'
|
35
|
+
attributes[:http_method] ||= DEFAULT_HTTP_METHOD
|
36
|
+
attributes[:http_headers] ||= {}
|
37
|
+
attributes[:expected_status] ||= DEFAULT_EXPECTED_STATUS
|
38
|
+
attributes[:body] ||= ''
|
39
|
+
attributes[:body_mimetype] ||= DEFAULT_BODY_MIMETYPE
|
32
40
|
|
33
41
|
self.log.debug "Supering with attributes: %p " % [ attributes ]
|
34
42
|
super( identifier, host, attributes, &block )
|
35
|
-
|
36
|
-
@api_version = nil
|
37
43
|
end
|
38
44
|
|
39
45
|
|
@@ -43,11 +49,42 @@ class Arborist::Node::Webservice < Arborist::Node::Service
|
|
43
49
|
|
44
50
|
##
|
45
51
|
# The URI of an endpoint that can be used to monitor the webservice
|
46
|
-
|
52
|
+
dsl_accessor :uri
|
47
53
|
|
48
54
|
##
|
49
|
-
# The
|
50
|
-
|
55
|
+
# The http_method used by the service
|
56
|
+
dsl_accessor :http_method
|
57
|
+
|
58
|
+
##
|
59
|
+
# The expected_status used by the service
|
60
|
+
dsl_accessor :expected_status
|
61
|
+
|
62
|
+
##
|
63
|
+
# The body used by the service
|
64
|
+
dsl_accessor :body
|
65
|
+
|
66
|
+
##
|
67
|
+
# The body_mimetype used by the service
|
68
|
+
dsl_accessor :body_mimetype
|
69
|
+
|
70
|
+
|
71
|
+
SSL_ATTRIBUTES.each_key do |attrname|
|
72
|
+
dsl_accessor( attrname )
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
### Set node +attributes+ from a Hash.
|
77
|
+
def modify( attributes )
|
78
|
+
attributes = stringify_keys( attributes )
|
79
|
+
|
80
|
+
super
|
81
|
+
|
82
|
+
self.uri( attributes['uri'] )
|
83
|
+
self.http_method( attributes['http_method'] )
|
84
|
+
self.expected_status( attributes['expected_status'] )
|
85
|
+
self.body( attributes['body'] )
|
86
|
+
self.body_mimetype( attributes['body_mimetype'] )
|
87
|
+
end
|
51
88
|
|
52
89
|
|
53
90
|
### Returns +true+ if the node matches the specified +key+ and +val+ criteria.
|
@@ -55,8 +92,15 @@ class Arborist::Node::Webservice < Arborist::Node::Service
|
|
55
92
|
self.log.debug "Matching %p: %p against %p" % [ key, val, self ]
|
56
93
|
return case key
|
57
94
|
when 'uri'
|
58
|
-
|
59
|
-
|
95
|
+
URI( self.uri ) == URI( val )
|
96
|
+
when 'http_method'
|
97
|
+
self.http_method == val
|
98
|
+
when 'expected_status'
|
99
|
+
self.expected_status == val
|
100
|
+
when 'body'
|
101
|
+
self.body == val
|
102
|
+
when 'body_mimetype'
|
103
|
+
self.body_mimetype == val
|
60
104
|
else
|
61
105
|
super
|
62
106
|
end
|
@@ -67,21 +111,44 @@ class Arborist::Node::Webservice < Arborist::Node::Service
|
|
67
111
|
### monitor state.
|
68
112
|
def operational_values
|
69
113
|
return super.merge(
|
70
|
-
uri: self.uri
|
71
|
-
|
114
|
+
uri: self.uri,
|
115
|
+
http_method: self.http_method,
|
116
|
+
expected_status: self.expected_status,
|
117
|
+
body: self.body,
|
118
|
+
body_mimetype: self.body_mimetype
|
72
119
|
)
|
73
120
|
end
|
74
121
|
|
75
122
|
|
76
123
|
### Return service-node-specific information for #inspect.
|
77
124
|
def node_description
|
78
|
-
|
125
|
+
desc = "%s %s %s/1.1" % [
|
126
|
+
self.http_method,
|
79
127
|
self.uri,
|
80
|
-
self.
|
128
|
+
self.app_protocol.upcase,
|
81
129
|
]
|
130
|
+
|
131
|
+
if body && !body.empty?
|
132
|
+
desc << " {%s} (%s)" % [ self.body, self.body_mimetype ]
|
133
|
+
end
|
134
|
+
|
135
|
+
desc << ' -> %d response' % [ self.expected_status.to_i ]
|
136
|
+
|
137
|
+
return desc
|
82
138
|
end
|
83
139
|
|
84
140
|
|
141
|
+
### Serialize the resource node. Return a Hash of the host node's state.
|
142
|
+
def to_h( * )
|
143
|
+
return super.merge(
|
144
|
+
uri: self.uri,
|
145
|
+
http_method: self.http_method,
|
146
|
+
expected_status: self.expected_status,
|
147
|
+
body: self.body,
|
148
|
+
body_mimetype: self.body_mimetype
|
149
|
+
)
|
150
|
+
end
|
151
|
+
|
85
152
|
|
86
153
|
#######
|
87
154
|
private
|
data/lib/arborist/webservice.rb
CHANGED
@@ -17,7 +17,7 @@ module Arborist::Webservice
|
|
17
17
|
VERSION = '0.0.1'
|
18
18
|
|
19
19
|
# Version control revision
|
20
|
-
REVISION = %q$Revision:
|
20
|
+
REVISION = %q$Revision: 59e390021ccd $
|
21
21
|
|
22
22
|
|
23
23
|
### Return the name of the library with the version, and optionally the build ID if
|
@@ -32,5 +32,7 @@ module Arborist::Webservice
|
|
32
32
|
require 'arborist/monitor/webservice'
|
33
33
|
require 'arborist/node/webservice'
|
34
34
|
|
35
|
+
autoload :Constants, 'arborist/webservice/constants'
|
36
|
+
|
35
37
|
end # module Arborist::Webservice
|
36
38
|
|
@@ -8,7 +8,17 @@ require 'arborist/node/webservice'
|
|
8
8
|
|
9
9
|
describe Arborist::Node::Webservice do
|
10
10
|
|
11
|
-
|
11
|
+
it "can match on URI"
|
12
|
+
it "can match on HTTP method"
|
13
|
+
it "can match on request body"
|
14
|
+
it "can match on request body media type"
|
15
|
+
|
16
|
+
it "includes the URI in the operational attributes"
|
17
|
+
it "includes the HTTP method in the operational attributes"
|
18
|
+
it "includes the request body in the operational attributes"
|
19
|
+
it "includes the request body media type in the operational attributes"
|
20
|
+
|
21
|
+
it "provides a DSL declaration to disable SSL verification"
|
12
22
|
|
13
23
|
end
|
14
24
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arborist-webservice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.pre20180815100446
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIEbDCCAtSgAwIBAgIBATANBgkqhkiG9w0BAQUFADA+MQwwCgYDVQQDDANnZWQx
|
14
14
|
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
15
|
-
|
15
|
+
HhcNMTcwOTI3MDAzMDQ0WhcNMTgwOTI3MDAzMDQ0WjA+MQwwCgYDVQQDDANnZWQx
|
16
16
|
GTAXBgoJkiaJk/IsZAEZFglGYWVyaWVNVUQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
|
17
17
|
ggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC/JWGRHO+USzR97vXjkFgt
|
18
18
|
83qeNf2KHkcvrRTSnR64i6um/ziin0I0oX23H7VYrDJC9A/uoUa5nGRJS5Zw/+wW
|
@@ -25,17 +25,17 @@ cert_chain:
|
|
25
25
|
/D+K9JW9DDs3Yjgv9k4h7YMhW5gftosd+NkNC/+Y2CkCAwEAAaN1MHMwCQYDVR0T
|
26
26
|
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFHKN/nkRusdqCJEuq3lgB3fJvyTg
|
27
27
|
MBwGA1UdEQQVMBOBEWdlZEBGYWVyaWVNVUQub3JnMBwGA1UdEgQVMBOBEWdlZEBG
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
YWVyaWVNVUQub3JnMA0GCSqGSIb3DQEBBQUAA4IBgQB/qyi5pCjK8ceoKalfVAjS
|
29
|
+
vG64FEnLnD1bm39T5UaFIRmo+abZtfpg2QhwKvPbPjOicau2+m+MDQ2Cc3tgyaC3
|
30
|
+
dZxcP6w8APFg4AId09uWAZKf0xajvBMS2aOz8Bbmag6fwqRRkTMqsNYnmqcF7aRT
|
31
|
+
DuEzbEMfaOUYjU9RuB48vr4q8yRft0ww+3jq5iwNkrX1buL2pwBbyvgms6D/BV41
|
32
|
+
MaTVMjsHqJUwU2xVfhGtxGAWAer5S1HGYHkbio6mGVtiie0uWjmnzi7ppIlMr48a
|
33
|
+
7BNTsoZ+/JRk3iQWmmNsyFT7xfqBKye7cH11BX8V8P4MeGB5YWlMI+Myj5DZY3fQ
|
34
|
+
st2AGD4rb1l0ia7PfubcBThSIdz61eCb8gRi/RiZZwb3/7+eyEncLJzt2Ob9fGSF
|
35
|
+
X0qdrKi+2aZZ0NGuFj9AItBsVmAvkBGIpX4TEKQp5haEbPpmaqO5nIIhV26PXmyT
|
36
|
+
OMKv6pWsoS81vw5KAGBmfX8nht/Py90DQrbRvakATGI=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: arborist
|
@@ -66,19 +66,19 @@ dependencies:
|
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0.11'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
69
|
+
name: typhoeus
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '1.3'
|
75
75
|
type: :runtime
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
81
|
+
version: '1.3'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: hoe-mercurial
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,14 +99,14 @@ dependencies:
|
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0.
|
102
|
+
version: '0.9'
|
103
103
|
type: :development
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '0.
|
109
|
+
version: '0.9'
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: hoe-highline
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,61 +122,61 @@ dependencies:
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0.2'
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
|
-
name:
|
125
|
+
name: simplecov
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
130
|
+
version: '0.7'
|
131
131
|
type: :development
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
137
|
+
version: '0.7'
|
138
138
|
- !ruby/object:Gem::Dependency
|
139
|
-
name:
|
139
|
+
name: rdoc-generator-fivefish
|
140
140
|
requirement: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0.
|
144
|
+
version: '0.1'
|
145
145
|
type: :development
|
146
146
|
prerelease: false
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '0.
|
151
|
+
version: '0.1'
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
|
-
name: rdoc
|
153
|
+
name: rdoc
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '0
|
158
|
+
version: '4.0'
|
159
159
|
type: :development
|
160
160
|
prerelease: false
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '0
|
165
|
+
version: '4.0'
|
166
166
|
- !ruby/object:Gem::Dependency
|
167
167
|
name: hoe
|
168
168
|
requirement: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '3.
|
172
|
+
version: '3.16'
|
173
173
|
type: :development
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '3.
|
179
|
+
version: '3.16'
|
180
180
|
description: |-
|
181
181
|
This is a collection of webservice monitoring tools for the Arborist monitoring toolkit (http://arbori.st/).
|
182
182
|
|
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
version: 1.3.1
|
227
227
|
requirements: []
|
228
228
|
rubyforge_project:
|
229
|
-
rubygems_version: 2.
|
229
|
+
rubygems_version: 2.7.6
|
230
230
|
signing_key:
|
231
231
|
specification_version: 4
|
232
232
|
summary: This is a collection of webservice monitoring tools for the Arborist monitoring
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|