scout_api 1.0.3 → 1.0.4.pre
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.
- data/CHANGELOG +7 -0
- data/lib/scout_api/account.rb +1 -1
- data/lib/scout_api/metric.rb +2 -9
- data/lib/scout_api/metric_proxy.rb +1 -1
- data/lib/scout_api/version.rb +1 -1
- data/scout_api.gemspec +3 -4
- metadata +24 -22
- data/Gemfile.lock +0 -27
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== Master
|
2
|
+
|
3
|
+
* Better error handling
|
4
|
+
* Ignoring Gemfile.lock
|
5
|
+
* Removing call to #blank? as that requires Rails
|
6
|
+
* Returning an empty array when Metric#to_array handles a response w/no records rather than raising an exception
|
7
|
+
|
1
8
|
== 1.0.3
|
2
9
|
|
3
10
|
* Fixing response header change w/HTTParty 0.8
|
data/lib/scout_api/account.rb
CHANGED
@@ -61,6 +61,6 @@ class Scout::Account
|
|
61
61
|
uri = "/#{param}" + uri + (uri.include?('?') ? '&' : '?') + "api_version=#{Scout::VERSION}"
|
62
62
|
#puts "GET: #{uri}"
|
63
63
|
response = http_get(uri)
|
64
|
-
response.code.to_s =~ /^(4|5)/ ? raise( Scout::Error,response.message) : response
|
64
|
+
response.code.to_s =~ /^(4|5)/ ? raise( Scout::Error,response['error'] ? response['error']['message'] : response.message) : response
|
65
65
|
end
|
66
66
|
end
|
data/lib/scout_api/metric.rb
CHANGED
@@ -120,12 +120,10 @@ class Scout::Metric < Hashie::Mash
|
|
120
120
|
consolidate,name,ids=series_options(id_or_name,options)
|
121
121
|
|
122
122
|
response = Scout::Account.get("/descriptors/series.xml?name=#{CGI.escape(name.to_s)}&ids=#{ids}&function=#{function}&consolidate=#{consolidate}&plugin_ids=#{options[:plugin_ids]}&server_ids=#{options[:server_ids]}&group_ids=#{options[:group_ids]}&start=#{start_time}&end=#{end_time}")
|
123
|
-
|
124
123
|
if response['records']
|
125
|
-
response['records']
|
126
124
|
response['records'].values.flatten.map { |r| [Time.parse(r['time']),r['value'].to_f] }
|
127
125
|
else
|
128
|
-
|
126
|
+
[]
|
129
127
|
end
|
130
128
|
end
|
131
129
|
|
@@ -225,12 +223,7 @@ class Scout::Metric < Hashie::Mash
|
|
225
223
|
end
|
226
224
|
|
227
225
|
response = Scout::Account.get("/data/value?name=#{CGI.escape(name.to_s)}&ids=#{ids}&function=#{function}&consolidate=#{consolidate}&plugin_ids=#{options[:plugin_ids]}&server_ids=#{options[:server_ids]}&group_ids=#{options[:group_ids]}&start=#{start_time}&end=#{end_time}")
|
228
|
-
|
229
|
-
if response['data']
|
230
|
-
response['data']
|
231
|
-
else
|
232
|
-
raise Scout::Error, response['error']
|
233
|
-
end
|
226
|
+
response['data']
|
234
227
|
end
|
235
228
|
|
236
229
|
# API expects times in epoch.
|
@@ -90,7 +90,7 @@ class Scout::MetricProxy
|
|
90
90
|
# @return [String]
|
91
91
|
def metric_from_options(options)
|
92
92
|
metric_name = options[:name]
|
93
|
-
raise Scout::Error, "The name of the metric is required (:name => metric_name)" if metric_name.
|
93
|
+
raise Scout::Error, "The name of the metric is required (:name => metric_name)" if (metric_name.nil? or metric_name == '')
|
94
94
|
metric_name
|
95
95
|
end
|
96
96
|
|
data/lib/scout_api/version.rb
CHANGED
data/scout_api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{scout_api}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.4.pre"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jesse Newland", "Derek Haynes"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2012-04-12}
|
13
13
|
s.description = %q{A library for interacting with Scout (http://scoutapp.com), a hosted server monitoring service. Query for metric data, manage servers, and more.}
|
14
14
|
s.email = %q{support@scoutapp.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
|
|
20
20
|
".document",
|
21
21
|
"CHANGELOG",
|
22
22
|
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
23
|
"LICENSE",
|
25
24
|
"README.rdoc",
|
26
25
|
"Rakefile",
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 961915972
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
9
|
+
- 4
|
10
|
+
- pre
|
11
|
+
version: 1.0.4.pre
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Jesse Newland
|
@@ -16,13 +17,10 @@ autorequire:
|
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date:
|
20
|
+
date: 2012-04-12 00:00:00 -06:00
|
20
21
|
default_executable:
|
21
22
|
dependencies:
|
22
23
|
- !ruby/object:Gem::Dependency
|
23
|
-
prerelease: false
|
24
|
-
name: hashie
|
25
|
-
type: :runtime
|
26
24
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
27
25
|
none: false
|
28
26
|
requirements:
|
@@ -35,10 +33,10 @@ dependencies:
|
|
35
33
|
- 8
|
36
34
|
version: 0.1.8
|
37
35
|
requirement: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
36
|
prerelease: false
|
40
|
-
name:
|
37
|
+
name: hashie
|
41
38
|
type: :runtime
|
39
|
+
- !ruby/object:Gem::Dependency
|
42
40
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
43
41
|
none: false
|
44
42
|
requirements:
|
@@ -49,10 +47,10 @@ dependencies:
|
|
49
47
|
- 0
|
50
48
|
version: "0"
|
51
49
|
requirement: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
50
|
prerelease: false
|
54
|
-
name:
|
51
|
+
name: httparty
|
55
52
|
type: :runtime
|
53
|
+
- !ruby/object:Gem::Dependency
|
56
54
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
57
55
|
none: false
|
58
56
|
requirements:
|
@@ -63,10 +61,10 @@ dependencies:
|
|
63
61
|
- 0
|
64
62
|
version: "0"
|
65
63
|
requirement: *id003
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
64
|
prerelease: false
|
68
|
-
name:
|
69
|
-
type: :
|
65
|
+
name: nokogiri
|
66
|
+
type: :runtime
|
67
|
+
- !ruby/object:Gem::Dependency
|
70
68
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
69
|
none: false
|
72
70
|
requirements:
|
@@ -77,10 +75,10 @@ dependencies:
|
|
77
75
|
- 0
|
78
76
|
version: "0"
|
79
77
|
requirement: *id004
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
78
|
prerelease: false
|
82
|
-
name:
|
79
|
+
name: fakeweb
|
83
80
|
type: :development
|
81
|
+
- !ruby/object:Gem::Dependency
|
84
82
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
83
|
none: false
|
86
84
|
requirements:
|
@@ -93,6 +91,9 @@ dependencies:
|
|
93
91
|
- 0
|
94
92
|
version: 1.5.0
|
95
93
|
requirement: *id005
|
94
|
+
prerelease: false
|
95
|
+
name: jeweler
|
96
|
+
type: :development
|
96
97
|
description: A library for interacting with Scout (http://scoutapp.com), a hosted server monitoring service. Query for metric data, manage servers, and more.
|
97
98
|
email: support@scoutapp.com
|
98
99
|
executables: []
|
@@ -106,7 +107,6 @@ files:
|
|
106
107
|
- .document
|
107
108
|
- CHANGELOG
|
108
109
|
- Gemfile
|
109
|
-
- Gemfile.lock
|
110
110
|
- LICENSE
|
111
111
|
- README.rdoc
|
112
112
|
- Rakefile
|
@@ -160,12 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
161
|
none: false
|
162
162
|
requirements:
|
163
|
-
- - "
|
163
|
+
- - ">"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
hash:
|
165
|
+
hash: 25
|
166
166
|
segments:
|
167
|
-
-
|
168
|
-
|
167
|
+
- 1
|
168
|
+
- 3
|
169
|
+
- 1
|
170
|
+
version: 1.3.1
|
169
171
|
requirements: []
|
170
172
|
|
171
173
|
rubyforge_project:
|
data/Gemfile.lock
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
fakeweb (1.3.0)
|
5
|
-
git (1.2.5)
|
6
|
-
hashie (0.1.8)
|
7
|
-
httparty (0.8.1)
|
8
|
-
multi_json
|
9
|
-
multi_xml
|
10
|
-
jeweler (1.5.2)
|
11
|
-
bundler (~> 1.0.0)
|
12
|
-
git (>= 1.2.5)
|
13
|
-
rake
|
14
|
-
multi_json (1.0.3)
|
15
|
-
multi_xml (0.4.1)
|
16
|
-
nokogiri (1.5.0)
|
17
|
-
rake (0.9.2)
|
18
|
-
|
19
|
-
PLATFORMS
|
20
|
-
ruby
|
21
|
-
|
22
|
-
DEPENDENCIES
|
23
|
-
fakeweb
|
24
|
-
hashie (~> 0.1.8)
|
25
|
-
httparty
|
26
|
-
jeweler (~> 1.5.0)
|
27
|
-
nokogiri
|